- 13 4月, 2021 4 次提交
-
-
由 Asherah Connor 提交于
A sandbox driver and test are added for the qfw uclass, and a test in QEMU added for qfw functionality to confirm it doesn't break in real world use. Signed-off-by: NAsherah Connor <ashe@kivikakk.ee> Reviewed-by: NSimon Glass <sjg@chromium.org> Reviewed-by: NBin Meng <bmeng.cn@gmail.com>
-
由 Etienne Carriere 提交于
Add local variables agent0/agent1 to refer to SCMI sandbox context agent and ease readability of the test. For consistency, rename regul_dev to regul0_dev and remove sandbox_voltd in dm_test_scmi_voltage_domains(). Signed-off-by: NEtienne Carriere <etienne.carriere@linaro.org> Reviewed-by: NSimon Glass <sjg@chromium.org>
-
由 Etienne Carriere 提交于
Fix inline comments and empty line in scmi driver and test files. Remove test on IS_ENABLED(CONFIG_*_SCMI) in test/dm/scmi.c since these configuration are expected enabled when CONFIG_FIRMWARE_SCMI is enabled in sandbox configuration. Signed-off-by: NEtienne Carriere <etienne.carriere@linaro.org> Reviewed-by: NSimon Glass <sjg@chromium.org> Reviewed-by: NJaehoon Chung <jh80.chung@samsung.com>
-
由 Etienne Carriere 提交于
Implement sandbox regulator devices for SCMI voltage domains and test them in DM scmi tests. Signed-off-by: NEtienne Carriere <etienne.carriere@linaro.org> Reviewed-by: NSimon Glass <sjg@chromium.org> Reviewed-by: NJaehoon Chung <jh80.chung@samsung.com>
-
- 10 4月, 2021 1 次提交
-
-
由 Alper Nebi Yasak 提交于
The PWM device provided by Chrome OS EC doesn't really support anything other than setting a relative duty cycle. To support it as a backlight, this patch makes the PWM period optional in the device tree and pretends the valid brightness range is its period_ns. Also adds a sandbox test for a PWM channel that has a fixed period, checking that the resulting duty_cycle matches on a set_config() even if the requested period_ns can't be set. Signed-off-by: NAlper Nebi Yasak <alpernebiyasak@gmail.com> Reviewed-by: NSimon Glass <sjg@chromium.org>
-
- 27 3月, 2021 1 次提交
-
-
由 Simon Glass 提交于
This feature was dropped from U-Boot some time ago: f12f96cf (sf: Drop spl_flash_get_sw_write_prot") However, we do need a way to see if a flash device is write-protected, since if it is, it may not be possible to write to do (i.e. failing to write is expected). I am not sure of the correct layer to implement this, so this patch is a stab at it. If spi-flash makes sense then I will add to the 'sf' also. Re the points mentioned in the removal commit: 1) This kind of requirement can be achieved using existing flash operations and flash locking API calls instead of making a separate flash API. Which uclass is this? 2) Technically there is no real hardware user for this API to use in the source tree. I do want coral (at least) to support this. 3) Having a flash operations API for simple register read bits also make difficult to extend the flash operations. This new patch only mentions write-protect being on or off, rather than the actual mechanism. 4) Instead of touching generic code, it is possible to have this functionality inside spinor operations in the form of flash hooks or fixups for associated flash chips. That sounds to me like what drivers are for. But we still need some sort of API for it to be accessible. Signed-off-by: NSimon Glass <sjg@chromium.org>
-
- 26 3月, 2021 6 次提交
-
-
由 Simon Glass 提交于
At present when driver model needs to change a device it simply updates the struct udevice structure. But with of-platdata-inst most of the fields are not modified at runtime. In fact, typically only the flags need to change. For systems running SPL from read-only memory it is convenient to separate out the runtime information, so that the devices don't need to be copied before being used. Create a new udevice_rt table, similar to the existing driver_rt. For now it just holds the flags, although they are not used in this patch. Add a new Kconfig for the driver_rt data, since this is not needed when of-platdata-inst is used. Signed-off-by: NSimon Glass <sjg@chromium.org> Signed-off-by: NSimon Glass <sjg@chromium.org>
-
由 Simon Glass 提交于
Move sandbox_spl over to use OF_PLATDATA_INST. Create a new board to test the case when this is not enabled, since we will be keeping that code around for several months and want to avoid regressions. Skip the dm_test_of_plat_dev() test since driver info is not available for OF_PLATDATA_INST. Signed-off-by: NSimon Glass <sjg@chromium.org> Signed-off-by: NSimon Glass <sjg@chromium.org>
-
由 Simon Glass 提交于
With recent changes this can be supported again. Add it back. This reverts commit d85f2c4f. Signed-off-by: NSimon Glass <sjg@chromium.org> Signed-off-by: NSimon Glass <sjg@chromium.org>
-
由 Simon Glass 提交于
This function finds a device by its driver_info index. With of-platdata-inst we do not use driver_info, but instead instantiate udevice records at build-time. However the semantics of using the function are the same in each case: the caller provides an index and gets back a device. So rename the function to device_get_by_ofplat_idx(), so that it can be used for both situations. The caller does not really need to worry about the details. Signed-off-by: NSimon Glass <sjg@chromium.org> Signed-off-by: NSimon Glass <sjg@chromium.org>
-
由 Simon Glass 提交于
This function is now only used in a test. Drop it. Also drop DM_DRVINFO_GET() which was the only purpose for having the function. Signed-off-by: NSimon Glass <sjg@chromium.org> Signed-off-by: NSimon Glass <sjg@chromium.org>
-
由 Simon Glass 提交于
Create a version of this driver for sandbox so that it can use the of-platdata struct. Signed-off-by: NSimon Glass <sjg@chromium.org> Signed-off-by: NSimon Glass <sjg@chromium.org>
-
- 22 3月, 2021 1 次提交
-
-
由 Simon Glass 提交于
Now that we have the alias information we can assign a sequence number to each device in the uclass. Store this in the node associated with each device. This requires renaming the sandbox test drivers to have the right name. Note that test coverage is broken with this patch, but fixed in the next one. Signed-off-by: NSimon Glass <sjg@chromium.org>
-
- 14 3月, 2021 1 次提交
-
-
由 Simon Glass 提交于
Some format strings use the wrong type. Fix them. Example warnings: In file included from test/dm/acpi.c:22: test/dm/acpi.c: In function ‘dm_test_acpi_cmd_list’: test/dm/acpi.c:362:21: warning: format ‘%lx’ expects argument of type ‘long unsigned int’, but argument 4 has type ‘unsigned int’ [-Wformat=] ut_assert_nextline("RSDP %08lx %06lx (v02 U-BOOT)", addr, ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ sizeof(struct acpi_rsdp)); ~~~~~~~~~~~~~~~~~~~~~~~~ include/test/ut.h:282:33: note: in definition of macro ‘ut_assert_nextline’ if (ut_check_console_line(uts, fmt, ##args)) { \ ^~~ Signed-off-by: NSimon Glass <sjg@chromium.org>
-
- 12 3月, 2021 22 次提交
-
-
由 Simon Glass 提交于
At present SPL only runs driver model tests. Update it to run all available tests, i.e. in any test suite. Signed-off-by: NSimon Glass <sjg@chromium.org>
-
由 Simon Glass 提交于
At present we use the linker list directly. This is not very friendly, so add a helpful macro instead. This will also allow us to change the naming later without updating this code. Signed-off-by: NSimon Glass <sjg@chromium.org>
-
由 Simon Glass 提交于
Add this functionality to ut_run_list() so it can be removed from dm_test_run(). At this point all tests are run through ut_run_list(). Signed-off-by: NSimon Glass <sjg@chromium.org>
-
由 Simon Glass 提交于
Add a check to ut_run_list() as to whether a list has driver model tests. Move the logic for the test devicetree into that function, in an effort to eventually remove all logic from dm_test_run(). Signed-off-by: NSimon Glass <sjg@chromium.org>
-
由 Simon Glass 提交于
Update this function to use the return value of ut_run_list() to check for success/failure, so that they are in sync. Also return a command success code so that the caller gets what it expects. Signed-off-by: NSimon Glass <sjg@chromium.org>
-
由 Simon Glass 提交于
Use this function instead of implementing it separately for driver model. Make ut_run_tests() private since it is only used in test-main.c Signed-off-by: NSimon Glass <sjg@chromium.org>
-
由 Simon Glass 提交于
At present we use a global test state for all driver-model tests. Make use of a local struct like we do with the other tests. To make this work, add functions to get and set this state. When a test starts, the state is set (so it can be used in the test). When a test finishes, the state is unset, so it cannot be used by mistake. Signed-off-by: NSimon Glass <sjg@chromium.org>
-
由 Simon Glass 提交于
Driver model tests are generally run twice, once with livetree enable and again with it disabled. Add a function to handle this and call it from the driver model test runner. Make ut_run_test() private since it is not used outside test-main.c now. Signed-off-by: NSimon Glass <sjg@chromium.org>
-
由 Simon Glass 提交于
In an effort to make use of a common test runner, use ut_run_test() directly to run driver model tests. Signed-off-by: NSimon Glass <sjg@chromium.org>
-
由 Simon Glass 提交于
Instead of having a separate function for running driver model tests, use the common one. Make the pre/post-run functions private since we don't need these outside of test-main.c Signed-off-by: NSimon Glass <sjg@chromium.org>
-
由 Simon Glass 提交于
Move this function into the common test runner and rename it to dm_test_post_run() so that its purpose is clear. Signed-off-by: NSimon Glass <sjg@chromium.org>
-
由 Simon Glass 提交于
Move this function into test-main so that all the init is in one place. Rename it so that its purpose is clearer. Signed-off-by: NSimon Glass <sjg@chromium.org>
-
由 Simon Glass 提交于
Driver model is a core part of U-Boot. We don't really need to have a separate test structure for the driver model tests and it makes it harder to write a test if you have to think about which type of test it is. Subsume the fields from struct dm_test_state into struct unit_test_state and delete the former. Signed-off-by: NSimon Glass <sjg@chromium.org>
-
由 Simon Glass 提交于
For driver model tests we want to reinit the data structures so that everything is in a known state before the test runs. This avoids one test changing something that breaks a subsequent tests. Move the call for this into test_pre_run(). Signed-off-by: NSimon Glass <sjg@chromium.org>
-
由 Simon Glass 提交于
This allows delays to be skipped in sandbox tests. Move it to the common pre-init function. Signed-off-by: NSimon Glass <sjg@chromium.org>
-
由 Simon Glass 提交于
We already have a function for silencing the console during tests. Use this from test_pre_run() and drop this code from the driver model tests. Signed-off-by: NSimon Glass <sjg@chromium.org>
-
由 Simon Glass 提交于
This is not needed now. Drop it. Signed-off-by: NSimon Glass <sjg@chromium.org>
-
由 Simon Glass 提交于
Move this step over to the pre-run function. Signed-off-by: NSimon Glass <sjg@chromium.org>
-
由 Simon Glass 提交于
Move this step over to the pre-run function. Signed-off-by: NSimon Glass <sjg@chromium.org>
-
由 Simon Glass 提交于
Move this step over to the pre-run function. Signed-off-by: NSimon Glass <sjg@chromium.org>
-
由 Simon Glass 提交于
Ultimately we want to get rid of the special driver model test init and use test_pre_run() and test_post_run() for all tests. As a first step, use those function to handle console recording. For now we need a special case for setting uts->start, but that wil go away once all init is in one place. Signed-off-by: NSimon Glass <sjg@chromium.org>
-
由 Simon Glass 提交于
This is the main test function for driver model but not for other tests. Rename the file and the function so this is clear. Signed-off-by: NSimon Glass <sjg@chromium.org>
-
- 04 3月, 2021 4 次提交
-
-
由 Simon Glass 提交于
Using the internal vs. external pull resistors it is possible to get 27 different combinations from 3 strapping pins. Add an implementation of this. This involves updating the sandbox GPIO driver to model external and (weaker) internal pull resistors. The get_value() method now takes account of what is driving a pin: sandbox: GPIOD_EXT_DRIVEN - in which case GPIO_EXT_HIGH provides the value outside source - in which case GPIO_EXT_PULL_UP/DOWN indicates the external state and we work the final state using those flags and the internal GPIOD_PULL_UP/DOWN flags Of course the outside source does not really exist in sandbox. We are just modelling it for test purpose. Signed-off-by: NSimon Glass <sjg@chromium.org>
-
由 Simon Glass 提交于
It is convenient to be able to adjust some of the flags for a GPIO while leaving others alone. Add a function for this. Update dm_gpio_set_dir_flags() to make use of this. Also update dm_gpio_set_value() to use this also, since this allows the open-drain / open-source features to be implemented directly in the driver, rather than using the uclass workaround. Update the sandbox tests accordingly. This involves a lot of changes to dm_test_gpio_opendrain_opensource() since we no-longer have the direciion being reported differently depending on the open drain/open source flags. Also update the STM32 drivers to let the uclass handle the active low/high logic. Drop the GPIOD_FLAGS_OUTPUT() macro which is no-longer used. Signed-off-by: NSimon Glass <sjg@chromium.org> Tested-by: NKory Maincent <kory.maincent@bootlin.com> Reviewed-by: NPatrick Delaunay <patrick.delaunay@foss.st.com> Tested-by: NPatrick Delaunay <patrick.delaunay@foss.st.com> Reviewed-by: NPatrick Delaunay <patrick.delaunay@foss.st.com> Tested-by: NPatrick Delaunay <patrick.delaunay@foss.st.com>
-
由 Simon Glass 提交于
Adjust the terminology in this driver to reflect that fact that all flags are handled, not just direction flags. Create a new access function to get the full GPIO state, not just the direction flags. Drop the static invalid_dir_flags since we can rely on a segfault if something is wrong. Signed-off-by: NSimon Glass <sjg@chromium.org> Reviewed-by: NPatrick Delaunay <patrick.delaunay@foss.st.com>
-
由 Simon Glass 提交于
This function can be used to get any flags, not just direction flags. Rename it to avoid confusion. Signed-off-by: NSimon Glass <sjg@chromium.org> Reviewed-by: NPatrick Delaunay <patrick.delaunay@foss.st.com> Reviewed-by: NPratyush Yadav <p.yadav@ti.com>
-