Commit Graph

431 Commits

Author SHA1 Message Date
Simon Xue 8cd358cbe2 test: rockchip: power: fix do_test_wdt
Change-Id: I9c1add612aefdaadaa2c065b7b6ab4ce6fd1f4e3
Signed-off-by: Simon Xue <xxm@rock-chips.com>
2020-12-28 16:19:25 +08:00
Masahiro Yamada daae0a01d6 UPSTREAM: host-tools: use python2 explicitly for shebang
All of these host tools are apparently written for Python2,
not Python3.

Use 'python2' in the shebang line according to PEP 394
(https://www.python.org/dev/peps/pep-0394/).

Change-Id: Ie56e538b0f4a234fccb460adbfd863db0712a1b0
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
(cherry picked from commit 94b13bbae90bfb94204b8fe9c531bc163e746a9f)
2020-11-02 21:26:47 +08:00
Joseph Chen cd1c982e9a test: rockchip: power: call do_test_charge()
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I4784b5f21ff4f39b0112d5cc5626c26b853a0246
2020-06-23 10:38:21 +08:00
Fabrice Gasnier 827e2ae92e UPSTREAM: clk: add clk_valid()
Add clk_valid() to check for optional clocks are valid.
Call clk_valid() in test/dm/clk.c and add relevant test routine to
sandbox clk tests.

Signed-off-by: Fabrice Gasnier <fabrice.gasnier@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: David Wu <david.wu@rock-chips.com>
Change-Id: I78b1edea1f8ef54d3aa3f7610d39d79dd994d1bf
2020-06-02 16:07:42 +08:00
Jean-Jacques Hiblot 94fbbf0f6d UPSTREAM: dm: Add a No-op uclass
This uclass is intended for devices that do not need any features from the
uclass, including binding children.
This will typically be used by devices that are used to bind child devices
but do not use dm_scan_fdt_dev() to do it. That is for example the case of
several USB wrappers that have 2 child devices (1 for device and 1 for
host) but bind only one at a any given time.

Change-Id: Iad9ba5f368bd2de9940cf069baf9bec9d668920c
Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
(cherry picked from commit 07e33711fec4f1106f36805b5dc830da07c783c5)
2020-02-27 17:51:21 +08:00
Joseph Chen 3a5e7a93e8 test: rockchip: fix typo
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I5e22ffaa2fc1a07ca05a793f26e94dc06dad3fc4
2020-01-16 11:12:16 +08:00
Neil Armstrong 0afa4b6c53 UPSTREAM: clk: add sandbox test for bulk API
This patch adds the bulk clock API tests for the sandbox test suite.

It's very similar to the main test but only uses the _bulk() API and
checks if the clocks are correctly enabled/disabled.

Change-Id: Ibfd7ea033e9a1c2ca76d88be8ca562a660f30448
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
(cherry picked from commit 65388d0dc5a36fc86718ffcdf08ac5671ae27b5d)
2020-01-07 17:24:50 +08:00
Neil Armstrong f7a4178d8b UPSTREAM: reset: add sandbox test for bulk API
This patch adds the bulk reset API tests for the sandbox test suite.

Unlike the main test, it also check the "other" reset signal using the bulk API
and checks if the resets are correctly asserted/deasserted.

To allow the bulk API to work, and avoid changing the DT, the number of resets
of the sandbox reset controller has been bumped to 101 for the "other" reset
line to be valid.

Change-Id: Iac62a1c6ee5637695f7d0dd77b35f047eca641a9
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
(cherry picked from commit 91f5f8b73ccba5bf591912fe6e8c500a7d51eb93)
2020-01-07 17:24:50 +08:00
Jon Lin 9cde1b1d03 test: storage: support rkflash
1.Support RKNANDC_NAND, RKSFC_NAND and RKSFC_NOR;
2.Adjust Userdata part size to reasonable value.

Change-Id: I20a4264848ba4ccd8385e9dee36cd16391cd517e
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
2020-01-07 11:08:20 +08:00
Joseph Chen 028a3c0879 dm: cmd: add "dm aliases" support
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I46d44a31a6fe82627bde5ff655b125e44add7a8a
2019-12-16 21:01:05 +08:00
Kever Yang 9c7862b8bf test: storage: Fix board may not have devnum env
If the board do not have the 'devnum', the env_get() returns NULL
and strcmp will lead to "data abort".

Change-Id: I329237b61fc96bc90e7a07653b665192d6a9d7b8
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
2019-09-24 14:27:38 +08:00
Kever Yang d0ff3d4548 rockchip: test: set argc to 1 for rktest all cmd
The 'rktest all v2/3' do not really pass arg to sub cmd, always set argc
for 'rktest all *' cmd to 1 for sub commands.

Change-Id: I2d69ad25aaca074f52bfd2e69be4c33bc41186df
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
2019-09-24 14:27:38 +08:00
Kever Yang fb09b07158 test: rockchip: fix pointer for free()
free() is using pointer while sysmem_free() is not using pointer,
so they can not use the same parameter.

Change-Id: Ib68319bda2ba1a400f2436e21d5864a0e2511fad
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
2019-08-21 09:55:21 +08:00
Kever Yang 21a92a158b rockchip: test: net: enable dhcp test with default value
1. add default dhcp cmd for test
2. fix the argc(has -1 in test-rockchip)
3. fix return value for FAIL case(return value is '1').

Change-Id: If55a3a8d29240be98febbf4649a23964a74452b6
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
2019-08-20 20:45:34 +08:00
Kever Yang 54108d04ce rockchip: test: adapt for upstream U-Boot
Not test display and misc for upstream U-Boot, replace local APIs with
upstream APIs.
Use CONFIG_RKIMG_BOOTLOADER to identify the rockchip local U-Boot.

Change-Id: I65b69eca8262d8aa0cb621c90d4ff1f2756368ba
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
2019-08-20 20:45:34 +08:00
Kever Yang bc18ede005 rockchip: test: use MACRO for module codes
Use module Macro for APIs from different module.

Change-Id: I765150f21bc9118e5ad0e661bb2b4ae12af77342
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
2019-08-20 17:35:39 +08:00
Kever Yang e80ec83d32 rockchip: test: add usb disk test
Add support to test usb disk like other blk device,
update api to get correct blk_desc.

Change-Id: I6b9cbce42ef16f207ad9d41ca55fa0e58f273ec7
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
2019-08-13 10:33:44 +08:00
Joseph Chen 443feaabc1 rockchip: test: add failed message for all cases
Failed message with prefix: "[UT-ERROR]: ..."

Change-Id: If44c174fc5e929d154851b4e2bf003c8a666f8b2
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-08-09 14:57:09 +08:00
Joseph Chen 474718ff26 rockchip: test: storage: do not support user param
Default test case is enough.

Change-Id: Ic3627efc7b1cacd8b86d8303daa26af1f7fd32e7
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-08-09 14:57:09 +08:00
Kever Yang 2a77afce30 rockchip: test: add log message need by LAVA
The LAVA system need message from log to show the test result.
"<LAVA_SIGNAL_*>" for start, end, test case result key;
"<LAVA_TEST_RUNNER>: exiting" for test complete key

Change-Id: I13522bf82da69f105f439853fa5c4b32c9f3d1ff
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
2019-08-06 10:45:05 +08:00
Joseph Chen 99d14b019e test: rockchip: refactor framework and update test case
Change-Id: I8406aaa6c4eacf2b2eb0fa6d787e2a46f45c8049
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-08-06 10:23:50 +08:00
Simon Glass b6e92505d5 UPSTREAM: sf: Add a method to obtain the block-protect setting
It is useful to obtain the block-protect setting of the SPI flash, so we
know whether it is fully open or (perhaps partially) write-protected. Add
a method for this. Update the sandbox driver to process this operation and
add a test.

Signed-off-by: Simon Glass <sjg@chromium.org
Change-Id: I8e8abe197ab483a26622f02666cc234a1544e642
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
(cherry picked from commit a58986ca8b53d8c7a441397082f84edc7f47d19f)
2019-07-05 19:33:46 +08:00
Simon Glass 4d9cacbffa UPSTREAM: dm: spi: Update sandbox SPI emulation driver to use ofnode
Update the parameters sandbox_sf_bind_emul to support livetree.

Change-Id: Iec83b813c8cddd750f7061d697304fa05556c5fb
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
(cherry picked from commit 008dcddf9937bd2576f98b48eb5bf0f60ad36014)
2019-07-05 19:33:39 +08:00
Jason Zhu cb0376d1ac rockchip: test: emmc: add read/write count for emmc test
Usually, we test the eMMC speed by reading and writing several times
and then taking the average. So add parameter count.

Change-Id: I0a01804b4b35b4a6d9dc8c96ac2bce6a4607301b
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2019-06-06 15:07:39 +08:00
Joseph Chen f26f96c587 test: rockchip: add rockusb and fastboot cmd
Change-Id: I23072323c2f2ee655a57af0150c2cb90135d3227
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2018-09-04 18:07:56 +08:00
Joseph Chen 1e7c429d5d test: rockchip: add command description
=> rktest
Command: rktest [module] [args...]
  - module: timer|key|emmc|rknand|regulator|eth|ir|brom|vendor
  - args: depends on module, try 'rktest [module]' for test or more help

  - Enabled modules:
     -      timer: test timer and interrupt
     -       brom: enter bootrom download mode
     -        key: test board keys
     -       emmc: test emmc read/write speed
     -     rknand: test rknand read/write speed
     -  regulator: test regulator volatge set and show regulator status
     -     vendor: test vendor storage partition read/write

Change-Id: I1f58dd65f7ffb229970cb86cb2f568cbca933336
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2018-09-04 17:35:21 +08:00
Joseph Chen 0c653b7e3f test: rockchip: emmc/rknand: remove unused head file
Change-Id: I7d38b27d0e61df979facb1c17907ef18e882b1ad
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2018-08-30 16:11:25 +08:00
Joseph Chen dbe1e39c43 test: rockchip: timer: compile depends on CONFIG_IRQ
Change-Id: Ibe626355a882af3e879a604820b7c685c8bd533d
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2018-08-30 16:11:03 +08:00
Joseph Chen b40c07fc2e test: rockchip: compile depends on dm config
Change-Id: I8e3a7a8dedaa4615426b3d059746d2c080b481c0
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2018-07-23 10:12:05 +08:00
Joseph Chen d240ec0518 test: rockchip: key: use key_read()
key_read() is a new dm key interface.

Change-Id: Idd950353749482a606085728bac2cac44e1bf58d
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2018-07-21 12:20:47 +08:00
Joseph Chen 0b4606ef44 test: rockchip: improve regulator test
1. dump all regulator fdt configure and current status;
2. only adjudst voltage for bucks;

Change-Id: Ib1b1730e0eb8157a9c979e3552932b2c80f40458
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2018-07-18 15:20:35 +08:00
Joseph Chen 336e1992eb test: rockchip: improve help guide
Change-Id: I321f9b5357a1ef0ad0617124a84bb4890b45be7e
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2018-07-14 17:40:01 +08:00
Joseph Chen 44e080753f test: rockchip: add vendor storage test
Change-Id: I3bfb884c32e44371fb01351af4b20587f7a1fa1f
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2018-07-14 17:40:01 +08:00
Kever Yang a14c50f0df rockchip: test: eth: fix build error
add header file for cli;
use simplg_strtoul() instead of strtoul();

Change-Id: I274710be24132fd9188be4b2283bea747bcfe667
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
2018-06-01 17:39:46 +08:00
Joseph Chen dc8812a0ee test: rockchip: timer: move out timer irq definition
Change-Id: Ia6322291a6ddb05f7971a0a51e161c046f9e91d2
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2018-03-19 09:25:49 +08:00
Joseph Chen 6ee123990a test: rockchip: timer: disable timer before configure
Change-Id: I0c1e8749069554f7aa7a63c416cd4691ad0e3761
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2018-03-15 15:53:11 +08:00
Joseph Chen b0635068cf test: rockchip: key: add more key event test
add KEY_HOME, KEY_MENU, KEY_ESC.

Change-Id: Ifbf43169973e0a2bbdb062713482ced1ceae7be3
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2018-03-15 15:53:11 +08:00
Kever Yang d5bbff804f rockchip: test-timer: support ARM64 px30
Add px30 timer 1 base;
Add support for read arm64 arch counter.

Change-Id: I8ea8b6835647d063d1c9a0fa579df0522b0f2c11
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
2018-02-25 16:40:42 +08:00
Kever Yang eb80c6bc09 rockchip: test: fix size warning in arm64
Fix warning in emmc and nand test case.

Change-Id: Id879e22b2f735d4d72be9a98dd7d9b074b8185ae
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
2018-02-25 15:11:39 +08:00
Simon Glass 440e24d771 UPSTREAM: dm: core: Add a function to look up a uclass by name
Each uclass has a driver name which we can use to look up the uclass. This
is useful for logging, where the uclass ID is used as the category.

Add a function to handle this, as well as a test.

Change-Id: Id221809d6f9f818b52a5bf88f4e12d409a070f05
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
(cherry picked from commit 6e43d1b19982b1756b7c607569d1778e556d6577)
2018-02-11 19:58:01 +08:00
Joseph Chen 105f3d76b6 rockchip: test-key: refactor code
use platform_key_read() interface.

Change-Id: I7d8add0a57e818eb73dc098c6f86b5967ad8b554
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2018-01-31 18:13:53 +08:00
Stephen Warren 8820f8d05b UPSTREAM: test/py: Setup variables based on HUSH selection
After adding our small zynq uboot which has hush parser off same
variable tests start to failed. Use quotes only when hush is enabled.

Change-Id: I9aee385346129dee480aa04aa68f420aa172aaa7
Reported-by: Michal Simek <michal.simek@xilinx.com>
Signed-off-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
(cherry picked from commit 3e229a83bd4190f99731992d3a56983f29313899)
2018-01-17 15:27:28 +08:00
Felix Brack 29b6917330 UPSTREAM: power: extend prefix match to regulator-name property
This patch extends pmic_bind_children prefix matching. In addition to
the node name the property regulator-name is used while trying to match
prefixes. This allows assigning different drivers to regulator nodes
named regulator@1 and regulator@10 for example.
I have discarded the idea of using other properties then regulator-name
as I do not see any benefit in using property compatible or even
regulator-compatible. Of course I am open to change this if there are
good reasons to do so.

Change-Id: Ifedf2c0a51cb725ddb290ee9dfd54a3fea45df70
Signed-off-by: Felix Brack <fb@ltec.ch>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
(cherry picked from commit bf802f5d544f85c03b4097ab23d078be43c61855)
2018-01-17 15:27:28 +08:00
Simon Glass c41d05c301 UPSTREAM: log: test: Add a pytest for logging
Add a test which tries out various filters and options to make sure that
logging works as expected.

Change-Id: Ibbaf607e128356e78769b9db9d6bda235c74ead2
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
(cherry picked from commit 20faa27c2bc32b1442970cfe98a3006cf8eac063)
2018-01-17 15:27:28 +08:00
Simon Glass 73991b074b log: Add a test command
Add a command which exercises the logging system.

Change-Id: I4eb139b69937c752d7f6fc42dde3f757260b832b
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
(cherry picked from commit ef11ed8239bf02b347e7fb9fc6d980aec0c7810a)
2018-01-17 15:27:28 +08:00
Stephen Warren 1151fbe648 UPSTREAM: test/py: add timestamps to log
It can be useful to record how long tests take; this can help debug slow
running test systems or track changes in performance over time. Enhance
the test system to record timestamps while running test:
- Whenever a new log file section is started.
- After U-Boot is started and communication has been established.
- After each host or U-Boot command is executed.

Change-Id: I1db02bfc1d69c8d6a4c390a778ae433bbd858a9d
Signed-off-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
(cherry picked from commit 9679d339ad2d4c495d734bad3a0fb7be6c4215eb)
2018-01-17 15:27:28 +08:00
Heinrich Schuchardt 70478c701f UPSTREAM: test/py: u_boot_console_base.py: fix typo
run_command does not have a parameter wait_for_each.

Change-Id: I5b6bb3ed1b732c3ebc307f0618282caea9190b83
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
(cherry picked from commit cd3e8a72a6fb1fe758c5f73b394527609afe26cc)
2018-01-16 18:16:48 +08:00
Pantelis Antoniou 6d7abe7419 UPSTREAM: test: overlay: Add unit test for stacked overlay
Verify that stacked overlays work.

Change-Id: Id5c578db630bb34e952ca5176bb5ca9815bb0c0f
Signed-off-by: Pantelis Antoniou <pantelis.antoniou@konsulko.com>
Acked-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
(cherry picked from commit ea28e488f743520f7f83b341f28818c32dae1ee3)
2018-01-16 18:16:48 +08:00
Pantelis Antoniou ea99241c37 UPSTREAM: ut: fix fdt_getprop_u32() change
fdt_getprop_u32 is not exported and it's different than what the
unit test uses. Rename u32 prop access methods to something that's
unit test specific.

Change-Id: I0256118c7ae7b6709c4ef0791c53093e3117f23e
Signed-off-by: Pantelis Antoniou <pantelis.antoniou@konsulko.com>
Acked-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
(cherry picked from commit 706708d3b2e7ade443836e7a14802a5a63b59713)
2018-01-16 18:16:48 +08:00
Alison Chaiken 135b53be98 UPSTREAM: add pytests for 'gpt rename' and 'gpt swap'
Add unit tests for the 'gpt rename' and 'gpt swap' commands that
rely on the block device created by test/py/make_test_disk.py.
Add CONFIG_CMD_GPT_RENAME to the sandbox_defconfig.  Remove the
testdisk.raw test device at the end of the tests.

Change-Id: I1c5b963a1f84168d4979ad1591f68a5f2a259935
Signed-off-by: Alison Chaiken <alison@peloton-tech.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
(cherry picked from commit c5772188ede914b0e67c2a58ae179039a582afe0)
2018-01-16 18:14:09 +08:00