aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2021-01-05dtoc: Tidy up pylint warnings in testSimon Glass1-71/+85
Tidy up this file to reduce the number of pylint warnings. Signed-off-by: Simon Glass <sjg@chromium.org>
2021-01-05dm: core: Add logging when lists_bind_fdt() failsSimon Glass1-1/+1
It is useful to see the error code when this fails. Add logging for this function. Signed-off-by: Simon Glass <sjg@chromium.org>
2021-01-05dm: core: Allow the uclass list to moveSimon Glass6-11/+19
At present the uclass list head is in global_data. This is convenient but with the new of-platdata we need the list head to be declared by the generated code. Change this over to be a pointer. Provide a 'static' version in global_data to retain the current behaviour. Signed-off-by: Simon Glass <sjg@chromium.org>
2021-01-05dm: core: Split out scanning code to dm_scan()Simon Glass1-14/+35
Move the code related to scanning for devices to bind, into a new function. This will make it easier to skip this step with the new of-platdata improvements. Signed-off-by: Simon Glass <sjg@chromium.org>
2021-01-05dm: core: Rename device node to indicate it is privateSimon Glass1-4/+7
To avoid having people accidentally access this member, add a trailing underscore. Also remove it when of-platdata is enabled, since it is not used. Signed-off-by: Simon Glass <sjg@chromium.org>
2021-01-05dm: core: Access device ofnode through functionsSimon Glass50-82/+113
At present ofnode is present in the device even if it is never used. With of-platdata this field is not used, so can be removed. In preparation for this, change the access to go through inline functions. Signed-off-by: Simon Glass <sjg@chromium.org>
2021-01-05dm: core: Use dev_has_ofnode() instead of dev_of_valid()Simon Glass15-35/+30
We have two functions which do the same thing. Standardise on dev_has_ofnode() since there is no such thing as an 'invalid' ofnode in normal operation: it is either null or missing. Also move the functions into one place. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2021-01-05dm: core: Rename dev_has_of_node() to dev_has_ofnode()Simon Glass5-5/+5
We use 'ofnode' rather than 'of_node' in U-Boot. Rename this function to fit. Signed-off-by: Simon Glass <sjg@chromium.org>
2021-01-05dm: core: Rename device flags to indicate it is privateSimon Glass1-8/+9
To avoid having people accidentally access this member, add a trailing underscore. Signed-off-by: Simon Glass <sjg@chromium.org>
2021-01-05dm: core: Access device flags through functionsSimon Glass16-59/+74
At present flags are stored as part of the device. In preparation for storing them separately, change the access to go through inline functions. Signed-off-by: Simon Glass <sjg@chromium.org>
2021-01-05dm: core: Rename sqq to seq_Simon Glass6-17/+18
Now that the sequence-numbering migration is complete, rename this member back to seq_, adding an underscore to indicate it is internal to driver model. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2021-01-05dm: core: Split out alloc code into a new functionSimon Glass1-37/+52
Add a new function to handle the allocation of private/platform data for a device. This will make it easier to skip this feature when using the new of-platdata. Signed-off-by: Simon Glass <sjg@chromium.org>
2021-01-05x86: Drop rtc from SPLSimon Glass1-1/+1
The RTC is not currently used in SPL. Drop it so that it does not take up space. Signed-off-by: Simon Glass <sjg@chromium.org>
2021-01-05x86: coral: Remove unwanted nodes from SPL/TPLSimon Glass1-6/+11
Some devices are not needed in SPL/TPL. For TPL this causes the generation of unnecessary of-platadata structs. Make some adjustments to fix this. Signed-off-by: Simon Glass <sjg@chromium.org>
2021-01-05x86: apl: Adjust how the UART gets its platform dataSimon Glass2-20/+42
At present this driver calls malloc() to start a new platform data structure, fills it in and tells driver model to use it. We want to avoid malloc, particularly with the new version of of-platdata. Create a new struct which encompasses both the dtd struct and the ns16550 one, to avoid this. Unfortunately we must copy the data into the right place for the ns16550 driver. Add some comments about this. Signed-off-by: Simon Glass <sjg@chromium.org>
2021-01-05x86: sysreset: Move priv/plat structs to headersSimon Glass2-4/+19
With the new of-platdata, these need to be available to dt_platdata.c so must be in header files. Move them and add the dtd struct too. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2021-01-05dm: core: Move priv/plat structs for simple_bus to headersSimon Glass2-6/+16
With the new of-platdata, these need to be available to dt_platdata.c so must be in header files. Move them. Signed-off-by: Simon Glass <sjg@chromium.org>
2021-01-05x86: apl: Use struct spi_nor instead of struct spi_flashSimon Glass1-1/+1
This construct effectively uses struct spi_nor due to a #define in spi-nor.h so we may as well use that struct here. This allows dtoc to parse it correctly. Signed-off-by: Simon Glass <sjg@chromium.org>
2021-01-05spi: Tweak a few strange SPI NOR features for of-platdataSimon Glass3-3/+5
The #define of one struct to another has been around for a while. It confuses dtoc and makes it think that struct spi_flash does not exist. Make a few changes to improve things while we wait for migration to be completed: - Move the 'struct spi_flash' to column 1 so dtoc scans it - Remove the #define when compiling dt-platdata.c - Update the strange mtd_get/set_of_node() functions - Use struct spi_nor in the drivers, so dtoc sees the correct struct Signed-off-by: Simon Glass <sjg@chromium.org>
2021-01-05spi: Tidy up get/set of device nodeSimon Glass5-6/+36
This code is a bit odd in that it only reads and updates the livetree version of the device ofnode. This means it won't work with flattree. Update the code to work as it was presumably intended. Signed-off-by: Simon Glass <sjg@chromium.org>
2021-01-05x86: spl: Move priv/plat structs to headersSimon Glass2-11/+11
With the new of-platdata, these need to be available to dt_platdata.c so must be in header files. Move them. Signed-off-by: Simon Glass <sjg@chromium.org>
2021-01-05x86: Move priv/plat structs for intel_common to headersSimon Glass4-27/+40
With the new of-platdata, these need to be available to dt_platdata.c so must be in header files. Move them. Signed-off-by: Simon Glass <sjg@chromium.org>
2021-01-05x86: apl: Move priv/plat structs to headersSimon Glass6-38/+64
With the new of-platdata, these need to be available to dt_platdata.c so must be in header files. Move them. Signed-off-by: Simon Glass <sjg@chromium.org>
2021-01-05sandbox: Update dts files to reduce SPL sizeSimon Glass2-8/+7
At present there are require a few devices in the devicetree which are not actually used in SPL. This will cause problems with the new of-platdata, since it will try to instantiate devices which are not compiled into U-Boot. Update the devicetree to remove these devices from SPL. Signed-off-by: Simon Glass <sjg@chromium.org>
2021-01-05sandbox: Add a compatible string for spltestSimon Glass1-0/+6
At present this driver does not have a compatible string. For it to be used with the coming of-platadata, it must have one. Update it accordingly. Signed-off-by: Simon Glass <sjg@chromium.org>
2021-01-05sandbox: i2c: Move priv into a header fileSimon Glass2-4/+15
Move this struct into a header file so that dtoc can include it in its dt-platdata.c file. Signed-off-by: Simon Glass <sjg@chromium.org>
2021-01-05sandbox: serial: Move priv into a header fileSimon Glass2-15/+31
Move this struct into a header file so that dtoc can include it in its dt-platdata.c file. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2021-01-05sandbox: remove ram buffer file when U-Boot is loaded by SPLPatrick Delaunay3-4/+12
Update management of "--rm_memory" sandbox's option and force this option when U-Boot is loaded by SPL in os_spl_to_uboot() and remove the ram file after reading in main() as described in option help message: "Remove memory file after reading". This patch avoids that the file "/tmp/u-boot.mem.XXXXXX" [created in os_jump_to_file() when U-Boot is loaded by SPL] is never deleted because state_uninit() is not called after U-Boot execution (CtrlC or with running pytest for example). This issue is reproduced by > build-sandbox_spl/spl/u-boot-spl and CtrlC in U-Bot console > make qcheck One temp file is created after each SPL and U-Boot execution (7 tims in qcheck after test_handoff.py, test_ofplatdata.py, test_spl.py execution). Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2021-01-05x86: Fix header guard in asm/pmu.hSimon Glass1-3/+3
This has the wrong name. Fix it. Signed-off-by: Simon Glass <sjg@chromium.org>
2021-01-05x86: tpl: Remove unwanted devicetree stringSimon Glass1-1/+3
Update this driver to use of_match_ptr(). This reduces the TPL binary size by about 32 bytes. Signed-off-by: Simon Glass <sjg@chromium.org>
2021-01-05x86: pinctrl: Drop unlikely error messages from TPLSimon Glass1-3/+8
These errors are only really for development purposes. Drop them to reduce the size of TPL. The error numbers are still reported. This reduces the TPL binary size on coral by about 160 bytes. Signed-off-by: Simon Glass <sjg@chromium.org>
2021-01-05x86: apl: Reduce size for TPLSimon Glass13-16/+44
Update various drivers to use of_match_ptr() and to avoid including debug strings in TPL. Omit the WiFi driver entirely, since it is not used in TPL. This reduces the TPL binary size by about 608 bytes. Signed-off-by: Simon Glass <sjg@chromium.org>
2021-01-05x86: apl: Update hostbridge to remove unwanted TPL codeSimon Glass1-5/+9
At present several strings from this file appear in the TPL binary. Add preprocessor checks to drop them. This reduces the TPL binary size by about 128 bytes. Signed-off-by: Simon Glass <sjg@chromium.org>
2021-01-05x86: coral: Move fsp-m settings to a subnodeSimon Glass2-1/+9
At present these settings are in the node for host-bridge and so are visible in TPL as well as SPL. But they are only used for SPL. Move them to a subnode so that TPL does not included them. Signed-off-by: Simon Glass <sjg@chromium.org>
2021-01-05x86: Move call64 into its own sectionSimon Glass1-0/+1
When this code is not used (e.g. by TPL) we want it to be excluded from the image. Put it in its own section so that this happens. Signed-off-by: Simon Glass <sjg@chromium.org>
2021-01-05x86: apl: Use const for driver operationsSimon Glass2-2/+2
Update these declarations to const to ensure that the data ends up in the rodata section. Signed-off-by: Simon Glass <sjg@chromium.org>
2021-01-05dtoc: Convert _drivers to a dictSimon Glass2-4/+32
At present this member holds a simple list of driver names. Update it to be a dict of DriverInfo, with the name being the key. This will allow more information to be added about each driver, in future patches. Signed-off-by: Simon Glass <sjg@chromium.org>
2021-01-05dtoc: Output the struct values in a separate functionSimon Glass1-16/+34
Reduce the length of output_node() futher by moving the struct-output functionality into a two separate functions. Signed-off-by: Simon Glass <sjg@chromium.org>
2021-01-05dtoc: Output the device in a separate functionSimon Glass1-11/+22
Reduce the length of output_node() by moving the device-output functionality into a separate function. Signed-off-by: Simon Glass <sjg@chromium.org>
2021-01-05dtoc: Make _output_list a top-level functionSimon Glass1-40/+40
It is annoying to have this function inside its parent since it makes the parent longer and hard to read. Move it to the top level. Signed-off-by: Simon Glass <sjg@chromium.org>
2021-01-05dtoc: Fix a few pylint warnings in dtb_platdataSimon Glass1-15/+16
These have crept in again. Update the file to fix all but these ones: dtb_platdata.py:143:0: R0902: Too many instance attributes (10/7) (too-many-instance-attributes) dtb_platdata.py:713:0: R0913: Too many arguments (6/5) (too-many-arguments) Signed-off-by: Simon Glass <sjg@chromium.org>
2021-01-05test: Move some test drivers into their own fileSimon Glass7-221/+263
At present several test drivers are part of the test file itself. Some of these are useful for of-platdata tests. Separate them out so we can use them for other things also. A few adjustments are needed so this driver can build for sandbox_spl as well. Signed-off-by: Simon Glass <sjg@chromium.org>
2021-01-05test: Use a simple variable to record removed deviceSimon Glass2-10/+6
At present the entire test state is effective passed into a test driver just to record which device was removed. This is unnecessary and makes it harder to track what is going on. Use a simple boolean instead. Also drop the unused 'removed' member while we are here. Signed-off-by: Simon Glass <sjg@chromium.org>
2021-01-05timer: Use a shorter error in TPLSimon Glass1-2/+8
This error should not happen in normal use. Reduce the length of it to save space in the image. Add an empty spl.h file to sh since it appears to lack this. Signed-off-by: Simon Glass <sjg@chromium.org>
2021-01-05arc: m68k: nds32: nios2: sh: xtensa: Add empty spl.h headerSimon Glass6-0/+0
At present it is not possible to include spl.h in on these architectures since the asm/spl.h file is not present. We want to be able to use the spl_phase() function, so add empty headers to make things build. Signed-off-by: Simon Glass <sjg@chromium.org>
2021-01-05sysreset: Use a shorter error with SPLSimon Glass1-4/+8
Use a minimal error message to save space. Sort the header files while we are here. Signed-off-by: Simon Glass <sjg@chromium.org>
2021-01-05pinctrl: Drop post_bind() method when not neededSimon Glass1-1/+3
This is not used with of-platdata, so remove it in that case. Signed-off-by: Simon Glass <sjg@chromium.org>
2021-01-05dm: core: Rename the priv/plat membersSimon Glass4-28/+33
These are supposed to be private to driver model, not accessed by any code outside. Add a trailing underscore to indicate this. Signed-off-by: Simon Glass <sjg@chromium.org>
2021-01-05dm: core: Use access methods for dev/uclass private dataSimon Glass3-37/+45
Use these functions in the core code as much as possible. With this, there are only two places where each priv/plat pointer is accessed, one for read and one for write. Signed-off-by: Simon Glass <sjg@chromium.org>
2021-01-05dm: Use access methods for dev/uclass private dataSimon Glass113-278/+372
Most drivers use these access methods but a few do not. Update them. In some cases the access is not permitted, so mark those with a FIXME tag for the maintainer to check. Signed-off-by: Simon Glass <sjg@chromium.org> Acked-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Acked-by: Pratyush Yadav <p.yadav@ti.com>