summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* board: atmel: use get_nand_dev_by_index()Grygorii Strashko2017-07-119-9/+9
| | | | | | | | As part of preparation for nand DM conversion the new API has been introduced to remove direct access to nand_info array. So, use it here instead of accessing to nand_info array directly. Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
* cmd: mvebu: bubt: use get_nand_dev_by_index()Grygorii Strashko2017-07-111-8/+6
| | | | | | | | As part of preparation for nand DM conversion the new API has been introduced to remove direct access to nand_info array. So, use it here instead of accessing to nand_info array directly. Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
* mtd: nand: drv: use get_nand_dev_by_index()Grygorii Strashko2017-07-112-2/+2
| | | | | | | | As part of preparation for nand DM conversion the new API has been introduced to remove direct access to nand_info array. So, use it here instead of accessing to nand_info array directly Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
* net: fm: use get_nand_dev_by_index()Grygorii Strashko2017-07-111-1/+2
| | | | | | | | | As part of preparation for nand DM conversion the new API has been introduced to remove direct access to nand_info array. So, use it here instead of accessing to nand_info array directly. Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com> Reviewed-by: Joe Hershberger <joe.hershberger@ni.com>
* net: phy: cortina: use get_nand_dev_by_index()Grygorii Strashko2017-07-111-1/+2
| | | | | | | | | As part of preparation for nand DM conversion the new API has been introduced to remove direct access to nand_info array. So, use it here instead of accessing to nand_info array directly Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com> Reviewed-by: Joe Hershberger <joe.hershberger@ni.com>
* cmd: nand: remove direct access to struct mtd_info->privGrygorii Strashko2017-07-111-1/+1
| | | | | | | Replace direct access to struct mtd_info->priv with proper accessor mtd_to_nand(). Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
* fs: use get_nand_dev_by_index()Grygorii Strashko2017-07-113-5/+18
| | | | | | | | As part of preparation for nand DM conversion the new API has been introduced to remove direct access to nand_info array. So, use it here instead of accessing to nand_info array directly. Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
* common: use get_nand_dev_by_index()Grygorii Strashko2017-07-112-3/+4
| | | | | | | | As part of preparation for nand DM conversion the new API has been introduced to remove direct access to nand_info array. So, use it here instead of accessing to nand_info array directly. Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
* cmd: jffs2: use get_nand_dev_by_index()Grygorii Strashko2017-07-111-3/+4
| | | | | | | | As part of preparation for nand DM conversion the new API has been introduced to remove direct access to nand_info array. So, use it here instead of accessing to nand_info array directly. Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
* cmd: bootm: use get_nand_dev_by_index()Grygorii Strashko2017-07-111-1/+1
| | | | | | | | As part of preparation for nand DM conversion the new API has been introduced to remove direct access to nand_info array. So, use it here instead of accessing to nand_info array directly. Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
* dfu: dfu_nand: use get_nand_dev_by_index()Grygorii Strashko2017-07-111-7/+5
| | | | | | | | As part of preparation for nand DM conversion the new API has been introduced to remove direct access to nand_info array. So, use it here instead of accessing to nand_info array directly. Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
* common: env_nand: use get_nand_dev_by_index()Grygorii Strashko2017-07-111-12/+21
| | | | | | | | As part of preparation for nand DM conversion the new API has been introduced to remove direct access to nand_info array. So, use it here instead of accessing to nand_info array directly. Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
* cmd: nand: abstract global variable usage for dm conversionMugunthan V N2017-07-114-41/+65
| | | | | | | | nand_info is used all over the file so abstract it with get_nand_dev_by_index() which will help for DM conversion. Signed-off-by: Mugunthan V N <mugunthanvnm@ti.com> Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
* Merge git://git.denx.de/u-boot-dmTom Rini2017-07-11282-1978/+3277
|\
| * dm: ofnode: use fdt32_t for DT property value to fix sparse warningMasahiro Yamada2017-07-111-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | DTB is encoded in big endian. When we retrieve property values, we need to use fdt32_to_cpu (aka be32_to_cpu) for endian conversion. This is a bit error-prone, but sparse is useful to detect endian mismatch. We need to use (fdt32_t *) instead of (u32 *) for a pointer of a property value. Otherwise sparse warns "cast to restricted __be32". Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Reviewed-by: Simon Glass <sjg@chromium.org>
| * dm: include <dm/util.h> from driver/core/dump.cMasahiro Yamada2017-07-111-0/+1
| | | | | | | | | | | | | | | | | | | | Include <dm/util.h> to fix sparse warnings: symbol 'dm_dump_all' was not declared. Should it be static? symbol 'dm_dump_uclass' was not declared. Should it be static? Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Acked-by: Simon Glass <sjg@chromium.org>
| * dm: ofnode: simplify ofnode_read_bool()Masahiro Yamada2017-07-111-9/+5
| | | | | | | | | | | | | | Reuse ofnode_get_property() to simplify the implementation. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Acked-by: Simon Glass <sjg@chromium.org>
| * dm: ofnode: rename ofnode_read_prop() to ofnode_get_property()Masahiro Yamada2017-07-118-11/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | This function returns the pointer to the value of a node property. The current name ofnode_read_prop() is confusing. Follow the naming of_get_property() from Linux. The return type (const u32 *) is wrong. DT property values can be strings as well as integers. This is why of_get_property/fdt_getprop returns an opaque pointer. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Acked-by: Simon Glass <sjg@chromium.org>
| * dm: ofnode: simplify ofnode_read_prop()Masahiro Yamada2017-07-111-9/+3
| | | | | | | | | | | | | | The code inside the if-block is the same as of_get_property(). Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Acked-by: Simon Glass <sjg@chromium.org>
| * dm: ofnode: use ofnode_read_bool() to check property existenceMasahiro Yamada2017-07-111-5/+5
| | | | | | | | | | | | | | This will clarify the code. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Acked-by: Simon Glass <sjg@chromium.org>
| * dm: include <dm/util.h> from drivers/core/util.cMasahiro Yamada2017-07-111-0/+5
| | | | | | | | | | | | | | | | | | Fix sparse warnings "... was not declared. Should it be static?" Also, fix redefinition of dm_warn/dm_dbg. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
| * fdt: Check for NULL return from fdt_getprop in 'fdt set'Tom Rini2017-07-111-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | While the previous pass through fixed one place where we knew that fdt_getprop would be given a positive len, in the case of 'fdt set' we do not, so check that we did no get NULL from fdt_getprop(). Cc: Simon Glass <sjg@chromium.org> Reported-by: Coverity (CID: 163249) Fixes 72c98ed1ab48 ("fdt: Add a check to do_fdt() for coverity") Signed-off-by: Tom Rini <trini@konsulko.com> Reviewed-by: Simon Glass <sjg@chromium.org>
| * tegra: fdt: Ensure that the console UART is enabledSimon Glass2017-07-1117-0/+68
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Many tegra boards have the console UART node disabled. With livetree this prevents serial from working since it does not 'force' the console to be bound. Updates the affected boards to fix this error. The boards were checked with: for b in $(grep tegra boards.cfg |grep -v integrator | \ awk '{print $7}' | sort); do echo $b; fdtgrep -c nvidia,tegra20-uart b/$b/u-boot.dtb |grep okay; done Signed-off-by: Simon Glass <sjg@chromium.org> Tested-by: Marcel Ziswiler <marcel.ziswiler@toradex.com> Tested-on: Beaver, Jetson-TK1
| * tegra: Show a debug message if the LCD PMIC fails to startSimon Glass2017-07-111-1/+3
| | | | | | | | | | | | | | | | This error condition should have a debug() message. Add it. Signed-off-by: Simon Glass <sjg@chromium.org> Tested-by: Marcel Ziswiler <marcel.ziswiler@toradex.com> Tested-on: Beaver, Jetson-TK1
| * dm: serial: Add livetree supportSimon Glass2017-07-111-3/+15
| | | | | | | | | | | | | | | | Add support for a live device tree to the core serial uclass. Signed-off-by: Simon Glass <sjg@chromium.org> Tested-by: Marcel Ziswiler <marcel.ziswiler@toradex.com> Tested-on: Beaver, Jetson-TK1
| * dm: serial: Separate out the core serial-device finding codeSimon Glass2017-07-111-40/+44
| | | | | | | | | | | | | | | | | | This function is quite long. Move the core code into a separate function in preparation for adding livetree support. Signed-off-by: Simon Glass <sjg@chromium.org> Tested-by: Marcel Ziswiler <marcel.ziswiler@toradex.com> Tested-on: Beaver, Jetson-TK1
| * dm: serial: ns16550: Convert to livetreeSimon Glass2017-07-111-10/+5
| | | | | | | | | | | | | | | | Update this driver to support a live device tree. Signed-off-by: Simon Glass <sjg@chromium.org> Tested-by: Marcel Ziswiler <marcel.ziswiler@toradex.com> Tested-on: Beaver, Jetson-TK1
| * tegra: Fix up include file orderingSimon Glass2017-07-112-16/+10
| | | | | | | | | | | | | | | | Update these two files so include files in the right order. Signed-off-by: Simon Glass <sjg@chromium.org> Tested-by: Marcel Ziswiler <marcel.ziswiler@toradex.com> Tested-on: Beaver, Jetson-TK1
| * video: simple-panel: Add a little more debuggingSimon Glass2017-07-111-0/+2
| | | | | | | | | | | | | | | | | | Add some debugging to show when the backlight is enabled. Signed-off-by: Simon Glass <sjg@chromium.org> Acked-by: Anatolij Gustschin <agust@denx.de> Tested-by: Marcel Ziswiler <marcel.ziswiler@toradex.com> Tested-on: Beaver, Jetson-TK1
| * dm: video: Update pwm_backlight to support livetreeSimon Glass2017-07-111-10/+12
| | | | | | | | | | | | | | | | | | Update this driver to support a live device tree. Signed-off-by: Simon Glass <sjg@chromium.org> Acked-by: Anatolij Gustschin <agust@denx.de> Tested-by: Marcel Ziswiler <marcel.ziswiler@toradex.com> Tested-on: Beaver, Jetson-TK1
| * dm: video: Sync display on backspaceSimon Glass2017-07-111-0/+1
| | | | | | | | | | | | | | | | | | | | We should sync the display (e.g. flush cache) when backspace is pressed to ensure that the character is erased correctly. Signed-off-by: Simon Glass <sjg@chromium.org> Acked-by: Anatolij Gustschin <agust@denx.de> Tested-by: Marcel Ziswiler <marcel.ziswiler@toradex.com> Tested-on: Beaver, Jetson-TK1
| * tegra: nyan-big: Enable bootstageSimon Glass2017-07-111-0/+5
| | | | | | | | | | | | | | | | Enable full bootstage support so we can time SPL and U-Boot. Signed-off-by: Simon Glass <sjg@chromium.org> Tested-by: Marcel Ziswiler <marcel.ziswiler@toradex.com> Tested-on: Beaver, Jetson-TK1
| * dm: Fix error handling when unflattening the DTSimon Glass2017-07-111-1/+6
| | | | | | | | | | | | | | | | | | The error handling code does not current detect an error right away. Adjust it to return immediately. Signed-off-by: Simon Glass <sjg@chromium.org> Tested-by: Marcel Ziswiler <marcel.ziswiler@toradex.com> Tested-on: Beaver, Jetson-TK1
| * tegra: nyan-big: Enable the debug UARTSimon Glass2017-07-111-0/+4
| | | | | | | | | | | | | | | | | | Enable this to allow debugging when the serial UART driver is misconfigured. Signed-off-by: Simon Glass <sjg@chromium.org> Tested-by: Marcel Ziswiler <marcel.ziswiler@toradex.com> Tested-on: Beaver, Jetson-TK1
| * tegra: video: Time the LCD initSimon Glass2017-07-111-0/+2
| | | | | | | | | | | | | | | | Calculate the time taken to set up the LCD. Signed-off-by: Simon Glass <sjg@chromium.org> Tested-by: Marcel Ziswiler <marcel.ziswiler@toradex.com> Tested-on: Beaver, Jetson-TK1
| * dm: core: Add functions to obtain node's address/size cellsSimon Glass2017-07-118-6/+128
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The of_n_addr_cells() and of_n_size_cells() functions are useful for getting the size of addresses in a node, but in a few places U-Boot needs to obtain the actual property value for a node without walking up the stack. Add functions for this and just the existing code to use it. Add a comment to the existing ofnode functions which do not do the right thing with a flat tree. This fixes a problem reading PCI addresses. Signed-off-by: Simon Glass <sjg@chromium.org> Tested-by: Marcel Ziswiler <marcel.ziswiler@toradex.com> Tested-on: Beaver, Jetson-TK1
| * dm: core: Add dev_read_enabled() to check if a device is enabledSimon Glass2017-07-112-0/+29
| | | | | | | | | | | | | | | | | | | | | | | | This function allows a device's status to be read. This indicates whether the device should be enabled or disabled. Note: In normal operation disabled devices will not be present in the driver-model tree. Signed-off-by: Simon Glass <sjg@chromium.org> Tested-by: Marcel Ziswiler <marcel.ziswiler@toradex.com> Tested-on: Beaver, Jetson-TK1
| * dm: core: Add dev_read_resource() to read device resourcesSimon Glass2017-07-113-1/+50
| | | | | | | | | | | | | | | | | | | | | | | | | | Add a function which reads resources from a device, such as the device hardware address. This uses the "reg" property in the device. Unlike other functions there is little sense in inlining this when livetree is not being used because it has some logic in it and this would just bloat the code size. Signed-off-by: Simon Glass <sjg@chromium.org> Tested-by: Marcel Ziswiler <marcel.ziswiler@toradex.com> Tested-on: Beaver, Jetson-TK1
| * dm: core: Add ofnode_read_string_count()Simon Glass2017-07-113-1/+39
| | | | | | | | | | | | | | | | | | This provides a way to find the number of strings in a string list. Add it and also fix up the comment for ofnode_read_string_index(). Signed-off-by: Simon Glass <sjg@chromium.org> Tested-by: Marcel Ziswiler <marcel.ziswiler@toradex.com> Tested-on: Beaver, Jetson-TK1
| * binman: Put our local modules ahead of system modulesSimon Glass2017-07-111-5/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | If a system module is named the same as one of those used by binman we currently pick the system module. Adjust the ordering so that our modules are chosen instead. The module conflict reported was 'tools' from jira-python. I cannot access that package to test it. Signed-off-by: Simon Glass <sjg@chromium.org> Reported-by: Kevin Hilman <khilman@baylibre.com> Acked-by: Kevin Hilman <khilman@baylibre.com>
| * dtoc: Add testsSimon Glass2017-07-117-4/+411
| | | | | | | | | | | | | | Add some tests of dtoc's functionality to make it easier to expand and enhance the tool. Signed-off-by: Simon Glass <sjg@chromium.org>
| * sandbox: Stop printing platdata at the start of SPLSimon Glass2017-07-112-40/+1
| | | | | | | | | | | | | | | | | | Currently we have code which prints out platform data at the start of SPL. Now that we have tests for dtoc this is probably not necessary. Drop it. Update test_ofplatdata to check for empty output since it is useful to check that sandbox_spl works as expected. Signed-off-by: Simon Glass <sjg@chromium.org>
| * dtoc: Add a comment about string replace in conv_name_to_c()Simon Glass2017-07-111-0/+3
| | | | | | | | | | | | | | | | This function uses several separate string replaces where a regular expression might seem more reasonable. Add a comment justifying the way it is currently done. Signed-off-by: Simon Glass <sjg@chromium.org>
| * dtoc: Move the main logic into the dtb_platdata fileSimon Glass2017-07-112-17/+31
| | | | | | | | | | | | | | | | Collect the main logic of dtoc into a function and put it into dtb_platdata. This will allow tests to use this function instead of duplicating the code themselves. Signed-off-by: Simon Glass <sjg@chromium.org>
| * dtoc: Move static functions out of the classSimon Glass2017-07-111-62/+63
| | | | | | | | | | | | | | Rather than using static functions within the class, move them out of the class. This will make it slightly easier for tests to call them. Signed-off-by: Simon Glass <sjg@chromium.org>
| * dtoc: Pass include_disabled explicitlySimon Glass2017-07-112-5/+5
| | | | | | | | | | | | | | | | This option is the only one actually used by the dtb_platdata class. Pass it explicitly to avoid needing to pass the whole option object to the constructor. Signed-off-by: Simon Glass <sjg@chromium.org>
| * dtoc: Don't handle properties with / in themSimon Glass2017-07-111-1/+0
| | | | | | | | | | | | | | This conversion appears to not be needed as it does not occur in practice. Drop it. Signed-off-by: Simon Glass <sjg@chromium.org>
| * dtoc: Fix pylint warningsSimon Glass2017-07-112-131/+144
| | | | | | | | | | | | | | Unfortunately I neglected to run pylint on this tool with its initial submission. Fix the warnings. Signed-off-by: Simon Glass <sjg@chromium.org>
| * dtoc: Split out the main class into its own fileSimon Glass2017-07-112-405/+414
| | | | | | | | | | | | | | | | To simplify running tests we should move this class into its own file. This allows the tests to import it without having to import dtoc.py, which runs the tests. Signed-off-by: Simon Glass <sjg@chromium.org>
| * dtoc: Add a comment at the topSimon Glass2017-07-111-0/+20
| | | | | | | | | | | | Add a description of the dtoc tool at the top of the file. Signed-off-by: Simon Glass <sjg@chromium.org>