Skip to content

Commit

Permalink
common/dpaax: fallback to check separate memory node for VM
Browse files Browse the repository at this point in the history
[ upstream commit c9d9825 ]

In Virtual Machine the memory node in the device tree is at
'/proc/device-tree/memory/reg' which is separate from the memory
node path on the host. This patch enables check on both the paths.

Fixes: 2f3d633 ("common/dpaax: add library for PA/VA translation table")

Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
  • Loading branch information
nipungupta87 authored and kevintraynor committed Dec 10, 2019
1 parent a6aa809 commit 7a93e04
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 5 additions & 2 deletions drivers/common/dpaax/dpaax_iova_table.c
Expand Up @@ -68,9 +68,12 @@ read_memory_node(unsigned int *count)
*count = 0;

ret = glob(MEM_NODE_PATH_GLOB, 0, NULL, &result);
if (ret != 0)
ret = glob(MEM_NODE_PATH_GLOB_VM, 0, NULL, &result);

if (ret != 0) {
DPAAX_DEBUG("Unable to glob device-tree memory node: (%s)(%d)",
MEM_NODE_PATH_GLOB, ret);
DPAAX_DEBUG("Unable to glob device-tree memory node (err: %d)",
ret);
goto out;
}

Expand Down
2 changes: 2 additions & 0 deletions drivers/common/dpaax/dpaax_iova_table.h
Expand Up @@ -45,6 +45,8 @@ extern struct dpaax_iova_table *dpaax_iova_table_p;
* is SoC dependent, or even Uboot fixup dependent.
*/
#define MEM_NODE_PATH_GLOB "/proc/device-tree/memory[@0-9]*/reg"
/* For Virtual Machines memory node is at different path (below) */
#define MEM_NODE_PATH_GLOB_VM "/proc/device-tree/memory/reg"
/* Device file should be multiple of 16 bytes, each containing 8 byte of addr
* and its length. Assuming max of 5 entries.
*/
Expand Down

0 comments on commit 7a93e04

Please sign in to comment.