Merge git://git.denx.de/u-boot-dm
For odroid-c2 (arch-meson) for now disable designware eth as meson now needs to do some harder GPIO work. Signed-off-by: Tom Rini <trini@konsulko.com> Conflicts: lib/efi_loader/efi_disk.c Modified: configs/odroid-c2_defconfig
This commit is contained in:
@@ -21,12 +21,13 @@ obj-$(CONFIG_DM_ETH) += eth.o
|
||||
obj-$(CONFIG_DM_GPIO) += gpio.o
|
||||
obj-$(CONFIG_DM_I2C) += i2c.o
|
||||
obj-$(CONFIG_LED) += led.o
|
||||
obj-$(CONFIG_DM_MAILBOX) += mailbox.o
|
||||
obj-$(CONFIG_DM_MMC) += mmc.o
|
||||
obj-$(CONFIG_DM_PCI) += pci.o
|
||||
obj-$(CONFIG_RAM) += ram.o
|
||||
obj-y += regmap.o
|
||||
obj-$(CONFIG_REMOTEPROC) += remoteproc.o
|
||||
obj-$(CONFIG_RESET) += reset.o
|
||||
obj-$(CONFIG_SYSRESET) += sysreset.o
|
||||
obj-$(CONFIG_DM_RTC) += rtc.o
|
||||
obj-$(CONFIG_DM_SPI_FLASH) += sf.o
|
||||
obj-$(CONFIG_DM_SPI) += spi.o
|
||||
|
||||
31
test/dm/mailbox.c
Normal file
31
test/dm/mailbox.c
Normal file
@@ -0,0 +1,31 @@
|
||||
/*
|
||||
* Copyright (c) 2016, NVIDIA CORPORATION.
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
#include <dm.h>
|
||||
#include <dm/test.h>
|
||||
#include <asm/mbox.h>
|
||||
#include <test/ut.h>
|
||||
|
||||
static int dm_test_mailbox(struct unit_test_state *uts)
|
||||
{
|
||||
struct udevice *dev;
|
||||
uint32_t msg;
|
||||
|
||||
ut_assertok(uclass_get_device_by_name(UCLASS_MISC, "mbox-test", &dev));
|
||||
ut_assertok(sandbox_mbox_test_get(dev));
|
||||
|
||||
ut_asserteq(-ETIMEDOUT, sandbox_mbox_test_recv(dev, &msg));
|
||||
ut_assertok(sandbox_mbox_test_send(dev, 0xaaff9955UL));
|
||||
ut_assertok(sandbox_mbox_test_recv(dev, &msg));
|
||||
ut_asserteq(msg, 0xaaff9955UL ^ SANDBOX_MBOX_PING_XOR);
|
||||
ut_asserteq(-ETIMEDOUT, sandbox_mbox_test_recv(dev, &msg));
|
||||
|
||||
ut_assertok(sandbox_mbox_test_free(dev));
|
||||
|
||||
return 0;
|
||||
}
|
||||
DM_TEST(dm_test_mailbox, DM_TESTF_SCAN_FDT);
|
||||
@@ -1,74 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2015 Google, Inc
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
#include <dm.h>
|
||||
#include <reset.h>
|
||||
#include <asm/state.h>
|
||||
#include <asm/test.h>
|
||||
#include <dm/test.h>
|
||||
#include <test/ut.h>
|
||||
|
||||
/* Test that we can use particular reset devices */
|
||||
static int dm_test_reset_base(struct unit_test_state *uts)
|
||||
{
|
||||
struct sandbox_state *state = state_get_current();
|
||||
struct udevice *dev;
|
||||
|
||||
/* Device 0 is the platform data device - it should never respond */
|
||||
ut_assertok(uclass_get_device(UCLASS_RESET, 0, &dev));
|
||||
ut_asserteq(-ENODEV, reset_request(dev, RESET_WARM));
|
||||
ut_asserteq(-ENODEV, reset_request(dev, RESET_COLD));
|
||||
ut_asserteq(-ENODEV, reset_request(dev, RESET_POWER));
|
||||
|
||||
/* Device 1 is the warm reset device */
|
||||
ut_assertok(uclass_get_device(UCLASS_RESET, 1, &dev));
|
||||
ut_asserteq(-EACCES, reset_request(dev, RESET_WARM));
|
||||
ut_asserteq(-ENOSYS, reset_request(dev, RESET_COLD));
|
||||
ut_asserteq(-ENOSYS, reset_request(dev, RESET_POWER));
|
||||
|
||||
state->reset_allowed[RESET_WARM] = true;
|
||||
ut_asserteq(-EINPROGRESS, reset_request(dev, RESET_WARM));
|
||||
state->reset_allowed[RESET_WARM] = false;
|
||||
|
||||
/* Device 2 is the cold reset device */
|
||||
ut_assertok(uclass_get_device(UCLASS_RESET, 2, &dev));
|
||||
ut_asserteq(-ENOSYS, reset_request(dev, RESET_WARM));
|
||||
ut_asserteq(-EACCES, reset_request(dev, RESET_COLD));
|
||||
state->reset_allowed[RESET_POWER] = false;
|
||||
ut_asserteq(-EACCES, reset_request(dev, RESET_POWER));
|
||||
state->reset_allowed[RESET_POWER] = true;
|
||||
|
||||
return 0;
|
||||
}
|
||||
DM_TEST(dm_test_reset_base, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT);
|
||||
|
||||
/* Test that we can walk through the reset devices */
|
||||
static int dm_test_reset_walk(struct unit_test_state *uts)
|
||||
{
|
||||
struct sandbox_state *state = state_get_current();
|
||||
|
||||
/* If we generate a power reset, we will exit sandbox! */
|
||||
state->reset_allowed[RESET_POWER] = false;
|
||||
ut_asserteq(-EACCES, reset_walk(RESET_WARM));
|
||||
ut_asserteq(-EACCES, reset_walk(RESET_COLD));
|
||||
ut_asserteq(-EACCES, reset_walk(RESET_POWER));
|
||||
|
||||
/*
|
||||
* Enable cold reset - this should make cold reset work, plus a warm
|
||||
* reset should be promoted to cold, since this is the next step
|
||||
* along.
|
||||
*/
|
||||
state->reset_allowed[RESET_COLD] = true;
|
||||
ut_asserteq(-EINPROGRESS, reset_walk(RESET_WARM));
|
||||
ut_asserteq(-EINPROGRESS, reset_walk(RESET_COLD));
|
||||
ut_asserteq(-EACCES, reset_walk(RESET_POWER));
|
||||
state->reset_allowed[RESET_COLD] = false;
|
||||
state->reset_allowed[RESET_POWER] = true;
|
||||
|
||||
return 0;
|
||||
}
|
||||
DM_TEST(dm_test_reset_walk, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT);
|
||||
74
test/dm/sysreset.c
Normal file
74
test/dm/sysreset.c
Normal file
@@ -0,0 +1,74 @@
|
||||
/*
|
||||
* Copyright (C) 2015 Google, Inc
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
#include <dm.h>
|
||||
#include <sysreset.h>
|
||||
#include <asm/state.h>
|
||||
#include <asm/test.h>
|
||||
#include <dm/test.h>
|
||||
#include <test/ut.h>
|
||||
|
||||
/* Test that we can use particular sysreset devices */
|
||||
static int dm_test_sysreset_base(struct unit_test_state *uts)
|
||||
{
|
||||
struct sandbox_state *state = state_get_current();
|
||||
struct udevice *dev;
|
||||
|
||||
/* Device 0 is the platform data device - it should never respond */
|
||||
ut_assertok(uclass_get_device(UCLASS_SYSRESET, 0, &dev));
|
||||
ut_asserteq(-ENODEV, sysreset_request(dev, SYSRESET_WARM));
|
||||
ut_asserteq(-ENODEV, sysreset_request(dev, SYSRESET_COLD));
|
||||
ut_asserteq(-ENODEV, sysreset_request(dev, SYSRESET_POWER));
|
||||
|
||||
/* Device 1 is the warm sysreset device */
|
||||
ut_assertok(uclass_get_device(UCLASS_SYSRESET, 1, &dev));
|
||||
ut_asserteq(-EACCES, sysreset_request(dev, SYSRESET_WARM));
|
||||
ut_asserteq(-ENOSYS, sysreset_request(dev, SYSRESET_COLD));
|
||||
ut_asserteq(-ENOSYS, sysreset_request(dev, SYSRESET_POWER));
|
||||
|
||||
state->sysreset_allowed[SYSRESET_WARM] = true;
|
||||
ut_asserteq(-EINPROGRESS, sysreset_request(dev, SYSRESET_WARM));
|
||||
state->sysreset_allowed[SYSRESET_WARM] = false;
|
||||
|
||||
/* Device 2 is the cold sysreset device */
|
||||
ut_assertok(uclass_get_device(UCLASS_SYSRESET, 2, &dev));
|
||||
ut_asserteq(-ENOSYS, sysreset_request(dev, SYSRESET_WARM));
|
||||
ut_asserteq(-EACCES, sysreset_request(dev, SYSRESET_COLD));
|
||||
state->sysreset_allowed[SYSRESET_POWER] = false;
|
||||
ut_asserteq(-EACCES, sysreset_request(dev, SYSRESET_POWER));
|
||||
state->sysreset_allowed[SYSRESET_POWER] = true;
|
||||
|
||||
return 0;
|
||||
}
|
||||
DM_TEST(dm_test_sysreset_base, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT);
|
||||
|
||||
/* Test that we can walk through the sysreset devices */
|
||||
static int dm_test_sysreset_walk(struct unit_test_state *uts)
|
||||
{
|
||||
struct sandbox_state *state = state_get_current();
|
||||
|
||||
/* If we generate a power sysreset, we will exit sandbox! */
|
||||
state->sysreset_allowed[SYSRESET_POWER] = false;
|
||||
ut_asserteq(-EACCES, sysreset_walk(SYSRESET_WARM));
|
||||
ut_asserteq(-EACCES, sysreset_walk(SYSRESET_COLD));
|
||||
ut_asserteq(-EACCES, sysreset_walk(SYSRESET_POWER));
|
||||
|
||||
/*
|
||||
* Enable cold system reset - this should make cold system reset work,
|
||||
* plus a warm system reset should be promoted to cold, since this is
|
||||
* the next step along.
|
||||
*/
|
||||
state->sysreset_allowed[SYSRESET_COLD] = true;
|
||||
ut_asserteq(-EINPROGRESS, sysreset_walk(SYSRESET_WARM));
|
||||
ut_asserteq(-EINPROGRESS, sysreset_walk(SYSRESET_COLD));
|
||||
ut_asserteq(-EACCES, sysreset_walk(SYSRESET_POWER));
|
||||
state->sysreset_allowed[SYSRESET_COLD] = false;
|
||||
state->sysreset_allowed[SYSRESET_POWER] = true;
|
||||
|
||||
return 0;
|
||||
}
|
||||
DM_TEST(dm_test_sysreset_walk, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT);
|
||||
Reference in New Issue
Block a user