aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2017-07-11tegra: nyan-big: Enable the debug UARTSimon Glass1-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
2017-07-11tegra: video: Time the LCD initSimon Glass1-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
2017-07-11dm: core: Add functions to obtain node's address/size cellsSimon Glass8-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
2017-07-11dm: core: Add dev_read_enabled() to check if a device is enabledSimon Glass2-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
2017-07-11dm: core: Add dev_read_resource() to read device resourcesSimon Glass3-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
2017-07-11dm: core: Add ofnode_read_string_count()Simon Glass3-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
2017-07-11binman: Put our local modules ahead of system modulesSimon Glass1-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>
2017-07-11dtoc: Add testsSimon Glass7-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>
2017-07-11sandbox: Stop printing platdata at the start of SPLSimon Glass2-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>
2017-07-11dtoc: Add a comment about string replace in conv_name_to_c()Simon Glass1-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>
2017-07-11dtoc: Move the main logic into the dtb_platdata fileSimon Glass2-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>
2017-07-11dtoc: Move static functions out of the classSimon Glass1-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>
2017-07-11dtoc: Pass include_disabled explicitlySimon Glass2-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>
2017-07-11dtoc: Don't handle properties with / in themSimon Glass1-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>
2017-07-11dtoc: Fix pylint warningsSimon Glass2-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>
2017-07-11dtoc: Split out the main class into its own fileSimon Glass2-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>
2017-07-11dtoc: Add a comment at the topSimon Glass1-0/+20
Add a description of the dtoc tool at the top of the file. Signed-off-by: Simon Glass <sjg@chromium.org>
2017-07-11dtoc: Use self._options instead of the global optionsSimon Glass1-2/+2
This class should use the options object passed to it rather than finding the global one. Fix it. Signed-off-by: Simon Glass <sjg@chromium.org>
2017-07-11moveconfig: Allow automatic location and adding of 'imply'Simon Glass1-9/+215
By using a Kconfig parser we can find the location of each option in the Kconfig tree. Using the information from the database we can then automatically add an 'imply' option into the right place if requested by the user. Add a -a option to support adding 'imply' options. Display the location of any existing 'imply' option so that progress can be examined. Add a -A option to hide any existing 'imply' options so that already-completed additions need not be considered further. Also add documentation for this feature. Signed-off-by: Simon Glass <sjg@chromium.org>
2017-07-11moveconfig: Allow control of which implying configs are shownSimon Glass1-4/+32
Sometimes it is useful to display CONFIG_TARGET or CONFIG_CMD configs. Add an option to control this. Also we generally ignore implying configs which affect fewer than 5 boards. But sometimes it is useful to show those those, so add an option that reduces the minimum to two. ERRATUM configs are never useful for implying things, so ignore those. Signed-off-by: Simon Glass <sjg@chromium.org>
2017-07-11moveconfig: Allow piping in 'git show --stat' outputSimon Glass1-0/+2
It is useful to be able to process only a subset of boards to save time. Often that subset is defined by the defconfig files in a git commit. This change allows things like: # Build the database ./tools.moveconfig.py -b # Find some implying configs ./tools/moveconfig.py -i CONFIG_X # Add some 'imply' statements to Kconfig files ./tools/moveconfig.py -i CONFIG_X -a CONFIG_A,CONFIG_B # Reprocess the defconfig files to see if we can drop some changes git show --stat | ./tools/moveconfig.py -s -d - # Update the commit, with fewer defconfig changes gii commit -au Where the commit contains defconfig files, this will reprocess them to take account of the imply statements that you added. Signed-off-by: Simon Glass <sjg@chromium.org>
2017-07-11sandbox: Drop special case console code for sandboxSimon Glass1-13/+0
At present sandbox has a special case where it directly calls os_putc() when it does not have a console yet. Now that we have the pre-console buffer enabled we can drop this. Any early characters will be buffered and output later. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Tested-by: Stephen Warren <swarren@nvidia.com>
2017-07-11sandbox: Enable more console optionsSimon Glass4-1/+5
Enable the pre-console buffer, displaying the model and post-relocation console announce on sandbox. Also add a model name to the device tree. This allows testing of these features. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Tested-by: Stephen Warren <swarren@nvidia.com>
2017-07-11console: Use map_sysmem() for the pre-relocation consoleSimon Glass1-2/+9
At present this feature casts the address to a pointer. Use the map_sysmem() function so that it will work correctly on sandbox. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Tested-by: Bin Meng <bmeng.cn@gmail.com> Tested-by: Stephen Warren <swarren@nvidia.com>
2017-07-11test: Add a test for snprintf() and the banner/versionSimon Glass2-0/+84
Add a simple test to make sure that these functions obey the buffer size passed into them. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Tested-by: Stephen Warren <swarren@nvidia.com>
2017-07-11Allow displaying the U-Boot banner on a video displaySimon Glass3-4/+26
At present the U-Boot banner is only displayed on the serial console. If this is not visible to the user, the banner does not show. Some devices have a video display which can usefully display this information. Add a banner which is printed after relocation only on non-serial devices if CONFIG_DISPLAY_BOARDINFO_LATE is defined. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Tested-by: Bin Meng <bmeng.cn@gmail.com> Tested-by: Stephen Warren <swarren@nvidia.com>
2017-07-11display_options: Refactor to allow obtaining the bannerSimon Glass3-6/+53
Move the display options code into a separate function so that the U-Boot banner can be obtained from other code. Adjust the 'version' command to use it. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Tested-by: Bin Meng <bmeng.cn@gmail.com> Tested-by: Stephen Warren <swarren@nvidia.com>
2017-07-11x86: Move link to use driver model for SCSISimon Glass4-1/+27
As a demonstration of how to use SCSI with driver model, move link over to use this. This patch needs more work, but illustrates the concept. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2017-07-11dm: scsi: Drop scsi_init() when driver model is usedSimon Glass1-2/+4
This function should not be used with driver model. Update the code to reflect this. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2017-07-11dm: ahci: Add a driver for SCSI on AHCISimon Glass2-0/+79
Some AHCI drivers use SCSI under the hood. Rather than making the AHCI driver be in the SCSI uclass it makes sense to have the AHCI device create a SCSI device as a child. That way we can handle any AHCI-specific operations rather than trying to pretend tha the device is just SCSI. To handle this we need to provide a way for AHCI drivers to bind a SCSI device as its child, and probe it. Add functions for this. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2017-07-11dm: scsi: Split out the bus scanning codeSimon Glass2-12/+31
Split out the code that scans a single SCSI bus into a separate function. This will allow it to be used from driver model. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2017-07-11dm: scsi: Adjust return value of scsi_exec()Simon Glass2-7/+7
Change this function to return an error number instead of true/false. This allows us to return a proper error number. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2017-07-11dm: scsi: Add operations for SCSI devicesSimon Glass5-5/+52
The SCSI uclass currently has no operations. It just uses the global SCSI functions. Fix this by adding operations to the only two drivers that use the uclass, and replacing the global functions with those defined locally in the SCSI code. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2017-07-11dm: ahci: Create a local version of two SCSI functionsSimon Glass1-2/+13
With driver model we need to define implementations of exec() and bus_reset() separately for each SCSI driver. As a first step, create a local version of each function in the AHCI driver and call each from its global version. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2017-07-11dm: scsi: Document and rename the scsi_scan() parameterSimon Glass7-20/+22
The 'mode' parameter is actually a flag to determine whether to display a list of devices found during the scan. Rename it to reflect this, add a function comment and adjust callers to use a boolean. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2017-07-11dm: scsi: Add a device pointer to scan_exec(), scsi_bus_reset()Simon Glass6-21/+40
With driver model these functions need a device pointer. Add one even when CONFIG_DM_SCSI is not defined. This avoids having ugly conditional function prototypes, When CONFIG_DM_SCSI is not defined we can just ignore the pointer. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2017-07-11dm: scsi: Add operationsSimon Glass1-0/+20
Add operations for SCSI. These are not yet implemented, but we have the struct. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2017-07-11dm: ahci: Drop use of probe_entSimon Glass3-30/+52
With driver model we cannot have static data or assume that there is only one device of each time. Adjust the code so that 'probe_ent' is not needed with driver model. Add a new ahci_init_dm() function which can init AHCI for driver model without re-allocating the uclass data. Move over the only existing driver to use this new function. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2017-07-11dm: ahci: Unwind the confusing init codeSimon Glass6-19/+42
Two AHCI drivers use SCSI with CONFIG_DM_SCSI. The SCSI uclass calls scsi_low_level_init() which is implemented by ahci.c. If CONFIG_SCSI_AHCI_PLAT is defined it does one thing and if it is not it does something else. We don't need to call through scsi_low_level_init() to get the init completed. Instead, adjust the two drivers to call into AHCI directly. Drop the post-probe init in the SCSI uclass. This means that driver model doesn't need to use scsi_low_level_init(). It is a legacy function and driver model should use a driver's probe() method instead. While we are here, add a comment to the top of the file explaining what ahci.c does. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2017-07-11dm: ahci: Move common code for starting ports into a functionSimon Glass1-23/+22
This code is duplicated. Create a ahci_start_ports() function to handle this and call it from both places. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2017-07-11dm: scsi: Indent the confusing #ifdefsSimon Glass1-13/+13
These are very confusing without some sort of indentation. At some point we will be able to remove them, but for now, indent them. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2017-07-11dm: ahci: Refactor to avoid static variablesSimon Glass1-68/+76
With driver model we need each device to have its own state. As a step towards this, restrict use of the global 'probe_ent' to just a few places in the file. This will allow us to add driver-model functions which can pass the correct data around. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2017-07-11dm: sata: Move ataid into struct ahci_uc_privSimon Glass2-23/+28
This array relates to the AHCI controller so should be exist out on its own in the file. Move it into the structure. Adjust functions that need access to this to take the structure as a parameter. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2017-07-11dm: ahci: Rename struct ahci_probe_entSimon Glass4-47/+58
This is not a very useful name since once it is probed it still hangs around. With driver model we will use uclass data for this, so rename the struct. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2017-07-11dm: scsi: Use the uclass platform dataSimon Glass5-7/+6
At present the two driver-model SCSI drivers use device platform data to store information that relates to the uclass. It is better to use uclass platform data in this situation. Update the code to do this. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2017-07-11dm: scsi: Drop the ccb typedefSimon Glass5-43/+44
We should not be using typedefs in U-Boot and 'ccb' is a pretty short name. It is also used with variables. Drop the typedef and use 'struct' instead. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2017-07-11dm: scsi: Rename struct SCSI_cmd_block to struct scsi_cmdSimon Glass2-2/+2
This name should be lower case. Also the _block suffix is superfluous. Rename it. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2017-07-11dm: scsi: Rearrange header file for driver modelSimon Glass1-20/+14
Put the driver-model declarations first since we are migrating to that. Also drop scsi_init() when driver model is used. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2017-07-11scsi: Move drivers into new drivers/scsi directorySimon Glass10-24/+42
At present we have the SCSI drivers in the drivers/block and common/ directories. It is better to split them out into their own place. Use drivers/scsi which is what Linux does. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2017-07-11sata: Move drivers into new drivers/ata directorySimon Glass28-63/+90
At present we have the SATA and PATA drivers mixed up in the drivers/block directory. It is better to split them out into their own place. Use drivers/ata which is what Linux does. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>