diff options
author | Dario Binacchi <dariobin@libero.it> | 2021-05-01 17:05:26 +0200 |
---|---|---|
committer | Lokesh Vutla <lokeshvutla@ti.com> | 2021-05-12 16:27:57 +0530 |
commit | a47abd7bf4b87e4bd5cbdaf88bbece6810d8c837 (patch) | |
tree | 041bf77db28e7e3659ee632e08bd104d1bcdd736 /test | |
parent | 5a6caf916cb302a6b83edce8c60d830d9261956d (diff) | |
download | u-boot-a47abd7bf4b87e4bd5cbdaf88bbece6810d8c837.tar.gz |
Revert "fdt: translate address if #size-cells = <0>"
This reverts commit d64b9cdcd475eb7f07b49741ded87e24dae4a5fc.
As pointed by [1] and [2], the reverted patch made every DT 'reg'
property translatable. What the patch was trying to fix was fixed in a
different way from previously submitted patches which instead of
correcting the generic address translation function fixed the issue with
appropriate platform code.
[1] https://patchwork.ozlabs.org/project/uboot/patch/1614324949-61314-1-git-send-email-bmeng.cn@gmail.com/
[2] https://lore.kernel.org/linux-clk/20210402192054.7934-1-dariobin@libero.it/T/
Signed-off-by: Dario Binacchi <dariobin@libero.it>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Diffstat (limited to 'test')
-rw-r--r-- | test/dm/test-fdt.c | 68 |
1 files changed, 0 insertions, 68 deletions
diff --git a/test/dm/test-fdt.c b/test/dm/test-fdt.c index 6552d09ba3..9b771fdf19 100644 --- a/test/dm/test-fdt.c +++ b/test/dm/test-fdt.c @@ -5,7 +5,6 @@ #include <common.h> #include <dm.h> -#include <dm/device_compat.h> #include <errno.h> #include <fdtdec.h> #include <log.h> @@ -551,64 +550,6 @@ U_BOOT_DRIVER(fdt_dummy_drv) = { .id = UCLASS_TEST_DUMMY, }; -static int zero_size_cells_bus_bind(struct udevice *dev) -{ - ofnode child; - int err; - - ofnode_for_each_subnode(child, dev_ofnode(dev)) { - if (ofnode_get_property(child, "compatible", NULL)) - continue; - - err = device_bind_driver_to_node(dev, - "zero_size_cells_bus_child_drv", - "zero_size_cells_bus_child", - child, NULL); - if (err) { - dev_err(dev, "%s: failed to bind %s\n", __func__, - ofnode_get_name(child)); - return err; - } - } - - return 0; -} - -static const struct udevice_id zero_size_cells_bus_ids[] = { - { .compatible = "sandbox,zero-size-cells-bus" }, - { } -}; - -U_BOOT_DRIVER(zero_size_cells_bus) = { - .name = "zero_size_cells_bus_drv", - .id = UCLASS_TEST_DUMMY, - .of_match = zero_size_cells_bus_ids, - .bind = zero_size_cells_bus_bind, -}; - -static int zero_size_cells_bus_child_bind(struct udevice *dev) -{ - ofnode child; - int err; - - ofnode_for_each_subnode(child, dev_ofnode(dev)) { - err = lists_bind_fdt(dev, child, NULL, false); - if (err) { - dev_err(dev, "%s: lists_bind_fdt, err=%d\n", - __func__, err); - return err; - } - } - - return 0; -} - -U_BOOT_DRIVER(zero_size_cells_bus_child_drv) = { - .name = "zero_size_cells_bus_child_drv", - .id = UCLASS_TEST_DUMMY, - .bind = zero_size_cells_bus_child_bind, -}; - static int dm_test_fdt_translation(struct unit_test_state *uts) { struct udevice *dev; @@ -630,17 +571,8 @@ static int dm_test_fdt_translation(struct unit_test_state *uts) /* No translation for busses with #size-cells == 0 */ ut_assertok(uclass_find_device_by_seq(UCLASS_TEST_DUMMY, 3, &dev)); ut_asserteq_str("dev@42", dev->name); - /* No translation for busses with #size-cells == 0 */ ut_asserteq(0x42, dev_read_addr(dev)); - /* Translation for busses with #size-cells == 0 */ - gd->dm_flags |= GD_DM_FLG_SIZE_CELLS_0; - ut_asserteq(0x8042, dev_read_addr(dev)); - ut_assertok(uclass_find_device_by_seq(UCLASS_TEST_DUMMY, 4, &dev)); - ut_asserteq_str("dev@19", dev->name); - ut_asserteq(0xc019, dev_read_addr(dev)); - gd->dm_flags &= ~GD_DM_FLG_SIZE_CELLS_0; - /* dma address translation */ ut_assertok(uclass_find_device_by_seq(UCLASS_TEST_DUMMY, 0, &dev)); dma_addr[0] = cpu_to_be32(0); |