Commit Graph

289 Commits

Author SHA1 Message Date
Joseph Chen ef5a68b123 core: device: always use wdt from U-Boot
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: Icedfecb6de80cb9dc1a71118e7271e2b7b66e90c
2020-12-28 16:19:25 +08:00
Joseph Chen 6a1649e26d core: node: remove unused API
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I797cb2f594865ab9310651183bf98b8112fe429e
2020-11-02 18:34:21 +08:00
Joseph Chen 659e640a99 core: dump: add symbol for remained dm device
Symbol:
	"**" : pre-reloc node and the device is remained in dm tree.
	"* " : pre-reloc node but the device is already being removed from dm tree.

=> dm tree
 Class      Probed        Driver               Name

Change-Id: Ie242117d4d323ba24894dd99ab061d187230621d
----------------------------------------------------------
 root       [ + ]   root_driver                root_driver
 rsa_mod_ex [   ]   mod_exp_sw                 |-- mod_exp_sw
 clk        [   ]   fixed_rate_clock           |-- external-gmac-clockm0 *
 clk        [   ]   fixed_rate_clock           |-- external-gmac-clockm1 *
 syscon     [ + ]   rv1126_syscon              |-- syscon@fe000000 *
 syscon     [ + ]   rv1126_syscon              |-- syscon@fe020000 *
 ......
 mtd        [   ]   rk_nandc_v6                |-- nandc@ffc80000 **
 blk        [   ]   mtd_blk                    |   `-- nandc@ffc80000.blk
 spi        [   ]   rockchip_sfc               |-- sfc@ffc90000 *
 mtd        [   ]   spi_nand                   |   |-- flash@0 **
 blk        [   ]   mtd_blk                    |   |   `-- flash@0.blk
 spi_flash  [   ]   spi_flash_std              |   `-- flash@1 **
 blk        [   ]   mtd_blk                    |       `-- flash@1.blk
 ......

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I5bf643b9a2b29a86ac7315462ad9f65f30e18442
2020-07-08 17:20:32 +08:00
Joseph Chen 8f5dfc4a5c core: device: use list_del_init() instead of list_del() to remove node
In order to check this node by list_del_init().

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I723821d8b9fc6d899fbd5c0b830b240486a48c73
2020-07-08 17:20:32 +08:00
Joseph Chen d5cc49d9e2 core: dump: update "dm uclass" print format
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I751a9458721df165e6cfb1ce34d00dc85edf4716
2020-05-28 16:24:55 +08:00
Joseph Chen 05e0f98eb3 driver: core: add dev_del_prop() api
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: Id016f2f3e2d4d80a7dbd72d02a038c07b3a0de26
2020-03-17 08:53:09 +08:00
Jean-Jacques Hiblot 94fbbf0f6d UPSTREAM: dm: Add a No-op uclass
This uclass is intended for devices that do not need any features from the
uclass, including binding children.
This will typically be used by devices that are used to bind child devices
but do not use dm_scan_fdt_dev() to do it. That is for example the case of
several USB wrappers that have 2 child devices (1 for device and 1 for
host) but bind only one at a any given time.

Change-Id: Iad9ba5f368bd2de9940cf069baf9bec9d668920c
Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
(cherry picked from commit 07e33711fec4f1106f36805b5dc830da07c783c5)
2020-02-27 17:51:21 +08:00
Joseph Chen 30a8590450 core: device: add and update some comment
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I7e58aab5eeb77913c8438ed066a7a73c7d6f0bb6
2020-02-21 16:20:07 +08:00
Joseph Chen 028a3c0879 dm: cmd: add "dm aliases" support
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I46d44a31a6fe82627bde5ff655b125e44add7a8a
2019-12-16 21:01:05 +08:00
Joseph Chen 503458d2fe core: device: allow serial node bind from kernel dtb
Previously we have to use serial node only from U-Boot dtb,
because we can't handle two problems to avoid serial intr fail:

- CRU phandle miss match between kernel and U-Boot dtb
- No "clock-frequency" in kernel serial node

These problems are workarund by current code, but the dm serial
seems to be works normally only for uart debug but not other uart.

Since the problems have been solved, let's allow serial driver-device
bind from kernel dtb.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: If3453509151e086afc5b7558277bec53842ac8eb
2019-12-16 21:01:05 +08:00
Joseph Chen b455f42c3d core: root: fix reloc condition error '||' => '&&'
Fixes: (930ceb1 driver: core/input: treat 'u-boot,dm-spl' as 'u-boot,dm-pre-reloc')

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: Ie0dad067451bc35ade865fbd9e52f43d0ec83aab
2019-12-03 13:09:21 +08:00
Joseph Chen 270d4d86b3 core: read: add dev_read_s32_default()
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I174670da004001feafcec568e978d2dfd9f55ef9
2019-11-22 08:42:16 +08:00
Joseph Chen 930ceb12e0 driver: core/input: treat 'u-boot,dm-spl' as 'u-boot,dm-pre-reloc'
It works when CONFIG_USING_KERNEL_DTB is enabled, because we can
set either 'u-boot,dm-spl' or 'u-boot,dm-pre-reloc' for the node
that we can to leave in the u-boot.dtb.

Change-Id: Id3cec0c64ee55ca9bc1e5871e7ad5a2ebb4b1b6a
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-10-24 10:52:45 +08:00
Jason Zhu 5a1674a738 drivers: core: do not use mtd node from kernel dtb
Do not use mtd node from kernel dtb, otherwise the driver will
be initialized twice.

Change-Id: I6f3dca8fd8c3e05475f4359fe6c3c5312c0984cd
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2019-06-24 18:31:03 +08:00
Joseph Chen 04539b46d5 dm: core: add function dev_write_u32_array() to write u32 array values
Change-Id: I6633395c7704eefff59c2145562fe239e21f3b35
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-06-14 18:22:36 +08:00
Joseph Chen b07f31ddba core: dump: add "*" for node from U-Boot dtb
This is useful for debugging.

Change-Id: If6a6e29053c1519ec40ccbcb183e35ffd81c64e8
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-06-06 09:13:10 +08:00
Joseph Chen ea4b8016c1 core: device_bind_common: always use crypto node from U-Boot dtb
There is not crypto node in kernel dtb for early platform(such as
rk322x/rk3288/rk3368/rk3399, etc), so we decide to add crypto node
always in U-Boot dtb and ignore crypto node from kernel dtb.

This is a way to compatible with early platforms. Actually, we
need crypto during secure boot sequence, the crypto had better
not depends on kernel dtb.

Change-Id: Ibab4fca0741b45042b8d0868240449fb6b52aa14
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-05-31 17:31:14 +08:00
Joseph Chen d7a244f923 core: device_bind_common: only delete U-Boot existance node
Use "u-boot,dm-pre-reloc" to identify whether the existance
node is from U-Boot or not. This avoids deleting the same name
nodes from kernel dtb.

Change-Id: I6503965c0013053feefad7e93f98b01b5af71f44
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-05-28 20:31:02 +08:00
Masahiro Yamada 0e00a84cde UPSTREAM: libfdt: move headers to <linux/libfdt.h> and <linux/libfdt_env.h>
Thomas reported U-Boot failed to build host tools if libfdt-devel
package is installed because tools include libfdt headers from
/usr/include/ instead of using internal ones.

This commit moves the header code:
  include/libfdt.h         -> include/linux/libfdt.h
  include/libfdt_env.h     -> include/linux/libfdt_env.h

and replaces include directives:
  #include <libfdt.h>      -> #include <linux/libfdt.h>
  #include <libfdt_env.h>  -> #include <linux/libfdt_env.h>

Change-Id: I6c0f7e50e8b571106627f25ddac008a62bd2994e
Reported-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
2018-12-24 17:20:37 +08:00
Joseph Chen d24a078f3f core: device_bind_common: don't bind UCLASS_SPI_FLASH again
Change-Id: Ie4cfe40398fc1e483b558832663bc50683510ac0
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2018-12-19 18:46:07 +08:00
Joseph Chen f935b6dc55 core: of_access: delete exist aliases when adding new one
This new one is from kernel dtb if kernel dtb is enabled.

Change-Id: I6fb54812188fe8749271a7aaae565bc7fa4cb3cc
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2018-12-10 16:28:11 +08:00
Joseph Chen d59cf5aebb dm: of_access: add ofnode_read_u64() support
only support of-live.

Change-Id: I37c10efa30ef46369f4a4ad7f16c4c758d6ad563
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2018-11-28 14:09:47 +08:00
Joseph Chen 064eb49314 serial: ns16550: support using pre-loader serial
- pass pre-loader serial configure by rk atags;
- it depends on serial aliases to find uart port;
- enabled by CONFIG_ROCKCHIP_USING_PRELOADER_SERIAL;

Change-Id: I6723cccc5e1f3dac77203b4cc19cdac631f5133b
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2018-10-19 17:40:56 +08:00
Joseph Chen 2e02c4e25b dm: of_access: add of_alias_get_dev() and of_alias_dump()
- support get device_node by given stem and alias id;
 - dump of alias nodes added in aliases_lookup.

Change-Id: I3ed8bd4692dd3fbbeebe9978a797a5a2dcf7eb23
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2018-10-18 10:32:18 +08:00
Philipp Tomsich e7ca7e39ee UPSTREAM: core: ofnode: add ofnode_get_parent function
The Rockchip video drivers need to walk the ofnode-parrents to find
an enclosing device that has a UCLASS_DISPLAY driver bound.  This
adds a ofnode_get_parent()-function that returns the parent-node.

Change-Id: I312236c966348aaa36ffc30e3f7dbc83d706fb36
Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Tested-by: Klaus Goger <klaus.goger@theobroma-systems.com>
Reviewed-by: Anatolij Gustschin <agust@denx.de>
Signed-off-by: Wyon Bi <bivvy.bi@rock-chips.com>
(cherry picked from commit e2d5997ffdf5cbf4f7d53584dab2ffc673f50987)
2018-08-23 10:26:10 +08:00
Kever Yang cadc8d74e2 clock: remove clk_set_defaults() in device core
We do not need to assign-clock for every driver in Rockchip platform,
only below module need this feature, remove it for boot time optimize:
- GMAC (need set parent from dts)
- CRU ARM clock (rockchip board will call set_armclk_rate() instead)
- VOP (need set parent)

Change-Id: Ie8facfb7499323f4649e0e1d908f850de1338e12
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
2018-07-27 15:44:58 +08:00
Joseph Chen d114ba00ec core: dump: increase info length
Change-Id: Ide57bc45fcdeb5fb158ae67d0c56a9f80ac4d8cf
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2018-07-20 11:23:33 +08:00
Kever Yang 527e4be7d9 rockchip: core: update kernel dtb node handle
Don't duplicate bind EMMC and NAND device after load kernel dtb.
Always use serial node from u-boot and use all other nodes from kernel.

Change-Id: Iaef9258f66f4f1060f057a9f7b194694e0e1df21
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
2018-07-18 10:34:38 +08:00
Yifeng Zhao 541f90ebf1 drivers: core: do not use nand node from kernel dtb
Do not use nand node from kernel dtb, or the driver will
be initialized twice.

Change-Id: Iae3e76094d074549e6f52c20261ceefa9b98be1b
Signed-off-by: Yifeng Zhao <zyf@rock-chips.com>
2018-06-22 17:22:08 +08:00
Finley Xiao 713d964649 core: device_bind_common: remove the same clk device
With kernel dtb support, there are two dtbs and some devices may have
the same driver and nanme, the api uclass_get_device_by_driver() and
uclass_get_device_by_name() may get wrong value. In order to use cru
node in kernel dtb, remove the same device whose node is in u-boot dtb.

Change-Id: Id19eedb276731fa18b07bca51bbc203636f20c31
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2018-06-13 11:07:38 +08:00
Andy Yan 45c78162f3 dm: regmap: use devfdt_get_addr_size_index get reg
fdtdec_get_addr_size() hard-codes the number of cells used to represent
an address or size in DT. This is incorrect in many cases depending on
the DT binding for a particular node or property (e.g. it is incorrect
for the "reg" property). In most cases, DT parsing code must use the
properties #address-cells and #size-cells to parse addres properties.

Change-Id: I736cf41f48eaac5d6b82510a037f447ff874a9e4
Signed-off-by: Andy Yan <andy.yan@rock-chips.com>
2018-05-24 16:43:18 +08:00
Kever Yang 33ffdd2473 debug: convert to use pr_debug for pte init and find dev
These two op have too much print, convert to pr_debug and not print
by default.

Change-Id: I5b3c738db783419717441e24ee0b04ab6f02d61e
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
2018-03-16 18:09:21 +08:00
Kever Yang 55e9fafcca core: do not fail in device_probe() when clk set default fail
Assigned clocks are widely used in kernel, but not in U-Boot yet,
many U-Boot clock driver do not have the API while dts port from kernel
have "assigned-clocks" node.

Just give a warning now instead of a device probe fail.

Change-Id: Icc1da8bdd1a21d6d118e37d305bd7909758c40b2
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
2018-02-27 09:00:03 +08:00
Kever Yang 5039ac47ff core: device_bind_common: do not use mmc node from kernel
The driver for U-Boot and kernel are different, we can not re-use
mmc node from kernel now.
BTW: U-Boot need alias for mmc to make sure emmc at mmc0(not support
     in kernel dtb).

Change-Id: I1b8fd3ab8a28e3abb5964dc113d0028abe2beaa2
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
2018-02-26 09:17:17 +08:00
Philipp Tomsich 0b2881acbd clk: implement clk_set_defaults()
Linux uses the properties 'assigned-clocks', 'assigned-clock-parents'
and 'assigned-clock-rates' to configure the clock subsystem for use
with various peripheral nodes.

This implements clk_set_defaults() and hooks it up with the general
device probibin in drivers/core/device.c: when a new device is probed,
clk_set_defaults() will be called for it and will process the
properties mentioned above.

Note that this functionality is designed to fail gracefully (i.e. if a
clock-driver does not implement set_parent(), we simply accept this
and ignore the error) as not to break existing board-support.

Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Tested-by: David Wu <david.wu@rock-chips.com>

Series-changes: 2
- Fixed David's email address.

Series-version: 2

Cover-letter:
clk: support assigned-clock, assigned-clock-parents, assigned-clock-rates

For various peripherals on Rockchip SoCs (e.g. for the Ethernet GMAC),
the parent-clock needs to be set via the DTS.  This adds the required
plumbing and implements the GMAC case for the RK3399.
END

(cherry picked from commit f4fcba5c5baaaa9d477d753f97124efdb8e45893)

Change-Id: I549891987c5a3e8546b96f1f54ad575950f92b12
Signed-off-by: David Wu <david.wu@rock-chips.com>
2018-02-24 19:02:43 +08:00
Simon Glass 440e24d771 UPSTREAM: dm: core: Add a function to look up a uclass by name
Each uclass has a driver name which we can use to look up the uclass. This
is useful for logging, where the uclass ID is used as the category.

Add a function to handle this, as well as a test.

Change-Id: Id221809d6f9f818b52a5bf88f4e12d409a070f05
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
(cherry picked from commit 6e43d1b19982b1756b7c607569d1778e556d6577)
2018-02-11 19:58:01 +08:00
Mario Six 18aa8da9a4 UPSTREAM: core: Make device_is_compatible live-tree compatible
Judging from its name and parameters, device_is_compatible looks like it
is compatible with a live device tree, but it actually isn't.

Make it compatible with a live device tree.

Reviewed-by: Simon Glass <sjg@chromium.org>
Change-Id: I892142d611ab5068d4ec6bdb51666a673b679794
Signed-off-by: Mario Six <mario.six@gdsys.cc>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
(cherry picked from commit 29d11b8838bb2aa324b8873159cbd7088870a75b)
2018-02-11 19:58:01 +08:00
Kever Yang 89f947ecb4 core: device: skip bind device already there
With kernel dtb support, there have two dtb and some device may the same,
skip it if already in the list, node in u-boot dtb will be used.

Change-Id: Ic9f8b73e3708a03416a9dc4ab6c72fa0184a6fdb
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
2018-02-09 12:00:21 +08:00
Kever Yang df5ceb01db core: add ofnode_get_by_phandle() api
We need to get ofnode from a phandle, add interface to support
both live dt and fdt.

Change-Id: I01a5241e2eced37b68ab6556cc1b16001eecbe0f
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
2018-02-08 21:56:47 +08:00
Kever Yang 1d5894f273 core: add uclass_get_device_by_phandle_id() api
Add to api for who can not get phandle from a device property.

Change-Id: I8395f02d1731a4bbb00af1e4fa9d151830fc54b0
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
2018-02-08 21:10:31 +08:00
Kever Yang d2e8ba4eb0 Revert "rockchip: add support to load and use kernel dtb"
This reverts commit af586a3812.

Change-Id: Ie1f8012b89ac810e3bc6219459127bc9ee88c674
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
2018-02-07 18:12:44 +08:00
Kever Yang b96443cc1c core: break when uclass_find() get UCLASS_ROOT
After reloc and before dm_scan_init again, the dm_root is broken.

Change-Id: Ia5b1f762a396daa78d2498b160f89a951a4ec544
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
2018-02-07 18:12:37 +08:00
Kever Yang a49612a6a2 core: do not assert if node not valid in ofnode_get_name()
In some case with LIVE DT, some node always not valid.

Change-Id: I20ebc530f7addfef167dd5abbab46e8da0627dd8
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
2018-02-07 18:12:32 +08:00
Kever Yang d5b5cd1471 core: add dev_count_phandle_with_args for of_live
This is a fix to:
642346a dm: core: add ofnode_count_phandle_with_args()

Change-Id: I25befa448e44884440060d43be905744cd4cd319
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
2018-01-26 16:40:37 +08:00
Kever Yang af586a3812 rockchip: add support to load and use kernel dtb
We are going to use a tiny dtb(with 'u-boot,dm-pre-reloc') in pre-relocate,
and then read kernel dtb and use it after relocate.
This feature only works with CONFIG_OF_LIVE enabled now.

Change-Id: I429ccd90ef562a96f2f7916255e7e427ce8f451d
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
2018-01-26 16:40:36 +08:00
Kever Yang b283d2ae7b core: read: fix some device may not have of node
Some device like syscon, blk do not have of node, return directly.

Change-Id: Icc4629632522f4a3af6532c6a9f2152b0e45de8b
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
2018-01-26 08:37:05 +08:00
Simon Glass 1abc22cc20 UPSTREAM: dm: core: Correct address cast in dev_read_addr_ptr()
This currently causes a warning in sandbox and will not do the right
thing:

drivers/core/read.c: In function ‘dev_read_addr_ptr’:
drivers/core/read.c:64:44: warning: cast to pointer from integer of
	different size [-Wint-to-pointer-cast]
  return (addr == FDT_ADDR_T_NONE) ? NULL : (void *)addr;

Use map_sysmem() which is the correct way to convert an address to a
pointer.

Fixes: c131c8bca8 (dm: core: add dev_read_addr_ptr())
Change-Id: Ic8ef1cb185d98d84dc6cf35a7001dcdcb4caa849
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested-by: Bin Meng <bmeng.cn@gmail.com>
Acked-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
(cherry picked from commit 8ccc2db6e84244e5cb57885dc9dfd7e752071b98)
2018-01-17 15:27:28 +08:00
Masahiro Yamada aea2f111e0 UPSTREAM: simple-bus: remove DECLARE_GLOBAL_DATA_PTR
No global pointer is used in this file.

Change-Id: I0c2dcde65300f815348d6f44922577225dd0ddf4
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
(cherry picked from commit 3d569a807e17b146731c37db0cf21125134dee23)
2018-01-17 15:27:28 +08:00
Klaus Goger 1b189a920d UPSTREAM: dm: ofnode: query correct property in livetree ofnode_get_addr_size
The livetree codepath of ofnode_get_addr_size always used the "reg"
property for of_get_property. Use the property parameter of the function
call instead and check the return value if the property exists.
Otherwise return FDT_ADDR_T_NONE.

This was discoverd while using SPI NOR with livetree.
spi_flash_decode_fdt checks for memory-map and will not fail with
livetree even if the property does not exist.

Change-Id: Icc63d2edbccea6a9f17cdcb5818993d317736ede
Signed-off-by: Klaus Goger <klaus.goger@theobroma-systems.com>
Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
(cherry picked from commit 68a345294ac74505f17d65b003a7de836b3d9cba)
2018-01-17 15:27:28 +08:00
Faiz Abbas 9ab2e5eb63 UPSTREAM: dm: core: Round up size when allocating so that it is cache line aligned
The size variable may not be always be a mulitple of
ARCH_DMA_MINALIGN and using it to flush cache leads to cache
misaligned warnings.

Therefore, round up the size to a multiple of ARCH_DMA_MINLAIGN
when allocating private data.

Change-Id: I29c4fb89f4be628518c2f5350d3efbccd28acd36
Signed-off-by: Faiz Abbas <faiz_abbas@ti.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
(cherry picked from commit 5924da1dfe56d32a45b8adf29bdc8caf788bd4c8)
2018-01-17 15:27:28 +08:00