diff options
author | Tom Rini <trini@konsulko.com> | 2019-07-23 14:16:21 -0400 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2019-07-23 14:16:21 -0400 |
commit | ff8c23e784f57a7098e91a200ed7f5a48612b653 (patch) | |
tree | 2d007e81ba9fc0d6334a9568d31422bd0e9dba88 /drivers/remoteproc/sandbox_testproc.c | |
parent | 9565bd7c6f4241af746fd67ee5c8406a99c148b3 (diff) | |
parent | 1f99eaff08f699472860c82480344e824a737d57 (diff) |
Merge tag 'u-boot-stm32-20190723' of https://gitlab.denx.de/u-boot/custodians/u-boot-stm
- add rtc driver for stm32mp1
- add remoteproc driver for stm32mp1
- use kernel qspi compatible string for stm32
Diffstat (limited to 'drivers/remoteproc/sandbox_testproc.c')
-rw-r--r-- | drivers/remoteproc/sandbox_testproc.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/drivers/remoteproc/sandbox_testproc.c b/drivers/remoteproc/sandbox_testproc.c index 51a67e6bf1a..5f35119ab71 100644 --- a/drivers/remoteproc/sandbox_testproc.c +++ b/drivers/remoteproc/sandbox_testproc.c @@ -8,6 +8,7 @@ #include <dm.h> #include <errno.h> #include <remoteproc.h> +#include <asm/io.h> /** * enum sandbox_state - different device states @@ -300,6 +301,23 @@ static int sandbox_testproc_ping(struct udevice *dev) return ret; } +#define SANDBOX_RPROC_DEV_TO_PHY_OFFSET 0x1000 +/** + * sandbox_testproc_device_to_virt() - Convert device address to virtual address + * @dev: device to operate upon + * @da: device address + * @return converted virtual address + */ +static void *sandbox_testproc_device_to_virt(struct udevice *dev, ulong da) +{ + u64 paddr; + + /* Use a simple offset conversion */ + paddr = da + SANDBOX_RPROC_DEV_TO_PHY_OFFSET; + + return phys_to_virt(paddr); +} + static const struct dm_rproc_ops sandbox_testproc_ops = { .init = sandbox_testproc_init, .reset = sandbox_testproc_reset, @@ -308,6 +326,7 @@ static const struct dm_rproc_ops sandbox_testproc_ops = { .stop = sandbox_testproc_stop, .is_running = sandbox_testproc_is_running, .ping = sandbox_testproc_ping, + .device_to_virt = sandbox_testproc_device_to_virt, }; static const struct udevice_id sandbox_ids[] = { |