dm: Introduce DMA constraints into the core device model
authorNicolas Saenz Julienne <nsaenzjulienne@suse.de>
Tue, 12 Jan 2021 12:55:24 +0000 (13:55 +0100)
committerMatthias Brugger <mbrugger@suse.com>
Thu, 18 Feb 2021 10:56:25 +0000 (11:56 +0100)
commit4abf68d57d495674e521b693191be1dcada46ecd
tree6471b542fbfc4730c539778640611cb5c96c2b15
parent283628c412a2b98bdb22093a732aef4d5668e106
dm: Introduce DMA constraints into the core device model

Calculating the DMA offset between a bus address space and CPU's every
time we call phys_to_bus() and bus_to_phys() isn't ideal performance
wise, as it implies traversing the device tree from the device's node up
to the root. Since this information is static and available before the
device's initialization, parse it before the probe call an provide the
DMA offset in 'struct udevice' for the address translation code to use
it.

Signed-off-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Tested-by: Peter Robinson <pbrobinson@gmail.com>
Signed-off-by: Matthias Brugger <mbrugger@suse.com>
drivers/core/Kconfig
drivers/core/device.c
include/dm/device.h