From: Tom Rini Date: Tue, 11 Feb 2020 15:58:41 +0000 (-0500) Subject: Merge tag 'dm-pull-6feb20' of https://gitlab.denx.de/u-boot/custodians/u-boot-dm X-Git-Url: http://git.dujemihanovic.xyz/img/sics.gif?a=commitdiff_plain;h=9a8942b53d57149754e0dfc975e0d92d1afd4087;p=u-boot.git Merge tag 'dm-pull-6feb20' of https://gitlab.denx.de/u-boot/custodians/u-boot-dm sandbox conversion to SDL2 TPM TEE driver Various minor sandbox video enhancements New driver model core utility functions --- 9a8942b53d57149754e0dfc975e0d92d1afd4087 diff --cc drivers/tpm/Makefile index 4c866b37c5,b1be3feac8..8f075b9f45 --- a/drivers/tpm/Makefile +++ b/drivers/tpm/Makefile @@@ -10,6 -10,6 +10,7 @@@ obj-$(CONFIG_TPM_TIS_SANDBOX) += tpm_ti obj-$(CONFIG_TPM_ST33ZP24_I2C) += tpm_tis_st33zp24_i2c.o obj-$(CONFIG_TPM_ST33ZP24_SPI) += tpm_tis_st33zp24_spi.o +obj-$(CONFIG_TPM2_CR50_I2C) += cr50_i2c.o obj-$(CONFIG_TPM2_TIS_SANDBOX) += tpm2_tis_sandbox.o obj-$(CONFIG_TPM2_TIS_SPI) += tpm2_tis_spi.o + obj-$(CONFIG_TPM2_FTPM_TEE) += tpm2_ftpm_tee.o diff --cc test/dm/test-fdt.c index 698ca0e7cf,f54db759b6..75ae08081c --- a/test/dm/test-fdt.c +++ b/test/dm/test-fdt.c @@@ -893,24 -873,41 +894,62 @@@ static int dm_test_read_int(struct unit return 0; } DM_TEST(dm_test_read_int, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT); + +/* Test iteration through devices by drvdata */ +static int dm_test_uclass_drvdata(struct unit_test_state *uts) +{ + struct udevice *dev; + + ut_assertok(uclass_first_device_drvdata(UCLASS_TEST_FDT, + DM_TEST_TYPE_FIRST, &dev)); + ut_asserteq_str("a-test", dev->name); + + ut_assertok(uclass_first_device_drvdata(UCLASS_TEST_FDT, + DM_TEST_TYPE_SECOND, &dev)); + ut_asserteq_str("d-test", dev->name); + + ut_asserteq(-ENODEV, uclass_first_device_drvdata(UCLASS_TEST_FDT, + DM_TEST_TYPE_COUNT, + &dev)); + + return 0; +} +DM_TEST(dm_test_uclass_drvdata, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT); + + /* Test device_first_child_ofdata_err(), etc. */ + static int dm_test_child_ofdata(struct unit_test_state *uts) + { + struct udevice *bus, *dev; + int count; + + ut_assertok(uclass_first_device_err(UCLASS_TEST_BUS, &bus)); + count = 0; + device_foreach_child_ofdata_to_platdata(dev, bus) { + ut_assert(dev->flags & DM_FLAG_PLATDATA_VALID); + ut_assert(!(dev->flags & DM_FLAG_ACTIVATED)); + count++; + } + ut_asserteq(3, count); + + return 0; + } + DM_TEST(dm_test_child_ofdata, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT); + + /* Test device_first_child_err(), etc. */ + static int dm_test_first_child_probe(struct unit_test_state *uts) + { + struct udevice *bus, *dev; + int count; + + ut_assertok(uclass_first_device_err(UCLASS_TEST_BUS, &bus)); + count = 0; + device_foreach_child_probe(dev, bus) { + ut_assert(dev->flags & DM_FLAG_PLATDATA_VALID); + ut_assert(dev->flags & DM_FLAG_ACTIVATED); + count++; + } + ut_asserteq(3, count); + + return 0; + } + DM_TEST(dm_test_first_child_probe, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT);