• Bjorn Andersson's avatar
    of: reserved_mem: Accessor for acquiring reserved_mem · eb297bc7
    Bjorn Andersson authored
    In some cases drivers referencing a reserved-memory region might want to
    remap the entire region, but when defining the reserved-memory by "size"
    the client driver has no means to know the associated base address of
    the reserved memory region.
    
    This patch adds an accessor for such drivers to acquire a handle to
    their associated reserved-memory for this purpose.
    
    A complicating factor for the implementation is that the reserved_mem
    objects are created from the flattened DeviceTree, as such we can't
    use the device_node address for comparison. Fortunately the name of the
    node will be used as "name" of the reserved_mem and will be used when
    building the full_name, so we can compare the "name" with the basename
    of the full_name to find the match.
    Reviewed-by: default avatarRob Herring <robh@kernel.org>
    Signed-off-by: default avatarBjorn Andersson <bjorn.andersson@linaro.org>
    Signed-off-by: default avatarAndy Gross <andy.gross@linaro.org>
    eb297bc7
of_reserved_mem.c 10.8 KB