]> git.ipfire.org Git - people/ms/u-boot.git/commit
fdt: fix address cell count checking in fdt_translate_address()
authorPrzemyslaw Marczak <p.marczak@samsung.com>
Wed, 28 Oct 2015 14:37:57 +0000 (15:37 +0100)
committerSimon Glass <sjg@chromium.org>
Thu, 7 Jan 2016 18:28:04 +0000 (11:28 -0700)
commit71105f50fedddfa5b0535d102c3d5078671721ad
tree4a226f2ff3ec7c096c5162773c5323d41a54d726
parent8a8348703081098dcd0b3affd5ee432164d2f535
fdt: fix address cell count checking in fdt_translate_address()

Commit: dm: core: Enable optional use of fdt_translate_address()

Enables use of this function as default, but after this it's not
possible to get dev address for the case in which: '#size-cells == 0'

This causes errors when getting address for some GPIOs, for which
the '#size-cells' is set to 0.

Example error:
'__of_translate_address: Bad cell count for gpx0'

Allowing for that case by modifying the macro 'OF_CHECK_COUNTS',
(called from )__of_translate_address(), fixes the issue.

Now, this macro doesn't check, that '#size-cells' is greater than 0.

This is possible from the specification point of view, but I'm not sure
that it doesn't introduce a regression for other configs.

Please test and share the results.

Tested-on: Odroid U3, Odroid X2, Odroid XU3, Sandbox.

Signed-off-by: Przemyslaw Marczak <p.marczak@samsung.com>
Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Cc: Lukasz Majewski <l.majewski@samsung.com>
Cc: Jaehoon Chung <jh80.chung@samsung.com>
Cc: Stefan Roese <sr@denx.de>
Cc: Simon Glass <sjg@chromium.org>
Cc: Bin Meng <bmeng.cn@gmail.com>
Cc: Marek Vasut <marex@denx.de>
Tested-by: Jaehoon Chung <jh80.chung@samsung.com>
Tested-by: Lukasz Majewski <l.majewski@samsung.com>
common/fdt_support.c