All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3] test/py: reset: Add a test for reset command
@ 2024-02-20  7:41 Love Kumar
  2024-02-20 20:04 ` Tom Rini
  2024-03-02 15:18 ` Tom Rini
  0 siblings, 2 replies; 18+ messages in thread
From: Love Kumar @ 2024-02-20  7:41 UTC (permalink / raw)
  To: u-boot; +Cc: michal.simek, git

Add a test for reset commands which performs resetting of CPU, It does
COLD reset by default and WARM reset with -w option.

Signed-off-by: Love Kumar <love.kumar@amd.com>
---
Changes in v2:
 - Set bootmode through boardenv if modeboot is not defined
Changes in v3:
 - Fix the issue with bad pattern found on console
---
 test/py/tests/test_reset.py | 61 +++++++++++++++++++++++++++++++++++++
 1 file changed, 61 insertions(+)
 create mode 100644 test/py/tests/test_reset.py

diff --git a/test/py/tests/test_reset.py b/test/py/tests/test_reset.py
new file mode 100644
index 000000000000..0178b1dc40a3
--- /dev/null
+++ b/test/py/tests/test_reset.py
@@ -0,0 +1,61 @@
+# SPDX-License-Identifier: GPL-2.0
+# (C) Copyright 2023, Advanced Micro Devices, Inc.
+
+"""
+Note: This test doesn't rely on boardenv_* configuration value but they can
+change test behavior.
+
+For example:
+
+# Setup env__reset_test_skip to True if reset test is not possible or desired
+# and should be skipped.
+env__reset_test_skip = True
+
+# Setup env__reset_test to set the bootmode if 'modeboot' u-boot environment
+# variable is not set. Test will be skipped if bootmode is not set in both
+# places i.e, boardenv and modeboot u-boot environment variable
+env__reset_test = {
+    'bootmode': 'qspiboot',
+}
+
+# This test will be also skipped if the bootmode is detected to JTAG.
+"""
+
+import pytest
+import test_000_version
+
+def setup_reset_env(u_boot_console):
+    if u_boot_console.config.env.get('env__reset_test_skip', False):
+        pytest.skip('reset test is not enabled')
+
+    output = u_boot_console.run_command('echo $modeboot')
+    if output:
+        bootmode = output
+    else:
+        f = u_boot_console.config.env.get('env__reset_test', None)
+        if not f:
+            pytest.skip('bootmode cannot be determined')
+        bootmode = f.get('bootmode', 'jtagboot')
+
+    if 'jtag' in bootmode:
+        pytest.skip('skipping reset test due to jtag bootmode')
+
+def test_reset(u_boot_console):
+    """Test the reset command in non-JTAG bootmode.
+    It does COLD reset, which resets CPU, DDR and peripherals
+    """
+    setup_reset_env(u_boot_console)
+    u_boot_console.run_command('reset', wait_for_reboot=True)
+
+    # Checks the u-boot command prompt's functionality after reset
+    test_000_version.test_version(u_boot_console)
+
+def test_reset_w(u_boot_console):
+    """Test the reset -w command in non-JTAG bootmode.
+    It does WARM reset, which resets CPU but keep DDR/peripherals active.
+    """
+    setup_reset_env(u_boot_console)
+    u_boot_console.run_command('reset -w', wait_for_reboot=True)
+
+    # Checks the u-boot command prompt's functionality after reset
+    test_000_version.test_version(u_boot_console)
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 18+ messages in thread

* Re: [PATCH v3] test/py: reset: Add a test for reset command
  2024-02-20  7:41 [PATCH v3] test/py: reset: Add a test for reset command Love Kumar
@ 2024-02-20 20:04 ` Tom Rini
  2024-03-02 15:18 ` Tom Rini
  1 sibling, 0 replies; 18+ messages in thread
From: Tom Rini @ 2024-02-20 20:04 UTC (permalink / raw)
  To: Love Kumar; +Cc: u-boot, michal.simek, git

[-- Attachment #1: Type: text/plain, Size: 305 bytes --]

On Tue, Feb 20, 2024 at 01:11:38PM +0530, Love Kumar wrote:

> Add a test for reset commands which performs resetting of CPU, It does
> COLD reset by default and WARM reset with -w option.
> 
> Signed-off-by: Love Kumar <love.kumar@amd.com>

Reviewed-by: Tom Rini <trini@konsulko.com>

-- 
Tom

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH v3] test/py: reset: Add a test for reset command
  2024-02-20  7:41 [PATCH v3] test/py: reset: Add a test for reset command Love Kumar
  2024-02-20 20:04 ` Tom Rini
@ 2024-03-02 15:18 ` Tom Rini
  2024-03-03 21:58   ` Angelo Dureghello
  1 sibling, 1 reply; 18+ messages in thread
From: Tom Rini @ 2024-03-02 15:18 UTC (permalink / raw)
  To: Love Kumar; +Cc: u-boot, michal.simek, git, Angelo Dureghello, Marek Vasut

[-- Attachment #1: Type: text/plain, Size: 802 bytes --]

On Tue, Feb 20, 2024 at 01:11:38PM +0530, Love Kumar wrote:

> Add a test for reset commands which performs resetting of CPU, It does
> COLD reset by default and WARM reset with -w option.
> 
> Signed-off-by: Love Kumar <love.kumar@amd.com>
> Reviewed-by: Tom Rini <trini@konsulko.com>
> ---
> Changes in v2:
>  - Set bootmode through boardenv if modeboot is not defined
> Changes in v3:
>  - Fix the issue with bad pattern found on console
> ---
>  test/py/tests/test_reset.py | 61 +++++++++++++++++++++++++++++++++++++
>  1 file changed, 61 insertions(+)
>  create mode 100644 test/py/tests/test_reset.py

I had hoped this was all sorted out now, but both this and the saveenv
test cause qemu_m68k to fail now.  See:
https://source.denx.de/u-boot/u-boot/-/jobs/791635

-- 
Tom

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH v3] test/py: reset: Add a test for reset command
  2024-03-02 15:18 ` Tom Rini
@ 2024-03-03 21:58   ` Angelo Dureghello
  2024-03-05 12:34     ` Michal Simek
  0 siblings, 1 reply; 18+ messages in thread
From: Angelo Dureghello @ 2024-03-03 21:58 UTC (permalink / raw)
  To: Tom Rini, Love Kumar; +Cc: u-boot, michal.simek, git, Marek Vasut

Hi Tom,
> On Tue, Feb 20, 2024 at 01:11:38PM +0530, Love Kumar wrote:
>> Add a test for reset commands which performs resetting of CPU, It 
>> does COLD reset by default and WARM reset with -w option. 
>> Signed-off-by: Love Kumar <love.kumar@amd.com> Reviewed-by: Tom Rini 
>> <trini@konsulko.com> --- Changes in v2: - Set bootmode through 
>> boardenv if modeboot is not defined Changes in v3: - Fix the issue 
>> with bad pattern found on console --- test/py/tests/test_reset.py | 
>> 61 +++++++++++++++++++++++++++++++++++++ 1 file changed, 61 
>> insertions(+) create mode 100644 test/py/tests/test_reset.py 
> I had hoped this was all sorted out now, but both this and the saveenv 
> test cause qemu_m68k to fail now. See: 
> https://source.denx.de/u-boot/u-boot/-/jobs/791635 
looking into this.

Regards,
angelo


On 02/03/24 4:18 PM, Tom Rini wrote:

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH v3] test/py: reset: Add a test for reset command
  2024-03-03 21:58   ` Angelo Dureghello
@ 2024-03-05 12:34     ` Michal Simek
  2024-03-06 23:36       ` Angelo Dureghello
  0 siblings, 1 reply; 18+ messages in thread
From: Michal Simek @ 2024-03-05 12:34 UTC (permalink / raw)
  To: Angelo Dureghello, Tom Rini, Love Kumar; +Cc: u-boot, git, Marek Vasut



On 3/3/24 22:58, Angelo Dureghello wrote:
> Hi Tom,
>> On Tue, Feb 20, 2024 at 01:11:38PM +0530, Love Kumar wrote:
>>> Add a test for reset commands which performs resetting of CPU, It does COLD 
>>> reset by default and WARM reset with -w option. Signed-off-by: Love Kumar 
>>> <love.kumar@amd.com> Reviewed-by: Tom Rini <trini@konsulko.com> --- Changes 
>>> in v2: - Set bootmode through boardenv if modeboot is not defined Changes in 
>>> v3: - Fix the issue with bad pattern found on console --- 
>>> test/py/tests/test_reset.py | 61 +++++++++++++++++++++++++++++++++++++ 1 file 
>>> changed, 61 insertions(+) create mode 100644 test/py/tests/test_reset.py 
>> I had hoped this was all sorted out now, but both this and the saveenv test 
>> cause qemu_m68k to fail now. See: 
>> https://source.denx.de/u-boot/u-boot/-/jobs/791635 
> looking into this.

Is reset implemented in qemu? It should be skipped if it is not.

Thanks,
Michal

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH v3] test/py: reset: Add a test for reset command
  2024-03-05 12:34     ` Michal Simek
@ 2024-03-06 23:36       ` Angelo Dureghello
  2024-03-07  0:10         ` Tom Rini
  0 siblings, 1 reply; 18+ messages in thread
From: Angelo Dureghello @ 2024-03-06 23:36 UTC (permalink / raw)
  To: Michal Simek, Tom Rini, Love Kumar; +Cc: u-boot, git, Marek Vasut

Hi,

On 05/03/24 1:34 PM, Michal Simek wrote:
>
>
> On 3/3/24 22:58, Angelo Dureghello wrote:
>> Hi Tom,
>>> On Tue, Feb 20, 2024 at 01:11:38PM +0530, Love Kumar wrote:
>>>> Add a test for reset commands which performs resetting of CPU, It 
>>>> does COLD reset by default and WARM reset with -w option. 
>>>> Signed-off-by: Love Kumar <love.kumar@amd.com> Reviewed-by: Tom 
>>>> Rini <trini@konsulko.com> --- Changes in v2: - Set bootmode through 
>>>> boardenv if modeboot is not defined Changes in v3: - Fix the issue 
>>>> with bad pattern found on console --- test/py/tests/test_reset.py | 
>>>> 61 +++++++++++++++++++++++++++++++++++++ 1 file changed, 61 
>>>> insertions(+) create mode 100644 test/py/tests/test_reset.py 
>>> I had hoped this was all sorted out now, but both this and the 
>>> saveenv test cause qemu_m68k to fail now. See: 
>>> https://source.denx.de/u-boot/u-boot/-/jobs/791635 
>> looking into this.
>
> Is reset implemented in qemu? It should be skipped if it is not.
>
yes, seems not implemented

=> reset
=> reset -w
=>
=>

Not finding any trace in the qemu code related to

out_8(&rcm->rcr, RCM_RCR_SOFTRST);

Regards,
angelo


> Thanks,
> Michal

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH v3] test/py: reset: Add a test for reset command
  2024-03-06 23:36       ` Angelo Dureghello
@ 2024-03-07  0:10         ` Tom Rini
  2024-03-07  7:56           ` Angelo Dureghello
  0 siblings, 1 reply; 18+ messages in thread
From: Tom Rini @ 2024-03-07  0:10 UTC (permalink / raw)
  To: Angelo Dureghello; +Cc: Michal Simek, Love Kumar, u-boot, git, Marek Vasut

[-- Attachment #1: Type: text/plain, Size: 1552 bytes --]

On Thu, Mar 07, 2024 at 12:36:42AM +0100, Angelo Dureghello wrote:
> Hi,
> 
> On 05/03/24 1:34 PM, Michal Simek wrote:
> > 
> > 
> > On 3/3/24 22:58, Angelo Dureghello wrote:
> > > Hi Tom,
> > > > On Tue, Feb 20, 2024 at 01:11:38PM +0530, Love Kumar wrote:
> > > > > Add a test for reset commands which performs resetting of
> > > > > CPU, It does COLD reset by default and WARM reset with -w
> > > > > option. Signed-off-by: Love Kumar <love.kumar@amd.com>
> > > > > Reviewed-by: Tom Rini <trini@konsulko.com> --- Changes in
> > > > > v2: - Set bootmode through boardenv if modeboot is not
> > > > > defined Changes in v3: - Fix the issue with bad pattern
> > > > > found on console --- test/py/tests/test_reset.py | 61
> > > > > +++++++++++++++++++++++++++++++++++++ 1 file changed, 61
> > > > > insertions(+) create mode 100644 test/py/tests/test_reset.py
> > > > I had hoped this was all sorted out now, but both this and the
> > > > saveenv test cause qemu_m68k to fail now. See:
> > > > https://source.denx.de/u-boot/u-boot/-/jobs/791635
> > > looking into this.
> > 
> > Is reset implemented in qemu? It should be skipped if it is not.
> > 
> yes, seems not implemented
> 
> => reset
> => reset -w
> =>
> =>
> 
> Not finding any trace in the qemu code related to
> 
> out_8(&rcm->rcr, RCM_RCR_SOFTRST);

Does reset work on the real HW, or can you not test? What I'm wondering
is if we have a missing feature on the board/arch code (and should
disable the reset command) or a problem with QEMU.

-- 
Tom

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH v3] test/py: reset: Add a test for reset command
  2024-03-07  0:10         ` Tom Rini
@ 2024-03-07  7:56           ` Angelo Dureghello
  2024-03-07  8:26             ` Michal Simek
  0 siblings, 1 reply; 18+ messages in thread
From: Angelo Dureghello @ 2024-03-07  7:56 UTC (permalink / raw)
  To: Tom Rini; +Cc: Michal Simek, Love Kumar, u-boot, git, Marek Vasut

Hi Tom,

On 07/03/24 1:10 AM, Tom Rini wrote:
> On Thu, Mar 07, 2024 at 12:36:42AM +0100, Angelo Dureghello wrote:
>> Hi,
>>
>> On 05/03/24 1:34 PM, Michal Simek wrote:
>>>
>>>
>>> On 3/3/24 22:58, Angelo Dureghello wrote:
>>>> Hi Tom,
>>>>> On Tue, Feb 20, 2024 at 01:11:38PM +0530, Love Kumar wrote:
>>>>>> Add a test for reset commands which performs resetting of
>>>>>> CPU, It does COLD reset by default and WARM reset with -w
>>>>>> option. Signed-off-by: Love Kumar <love.kumar@amd.com>
>>>>>> Reviewed-by: Tom Rini <trini@konsulko.com> --- Changes in
>>>>>> v2: - Set bootmode through boardenv if modeboot is not
>>>>>> defined Changes in v3: - Fix the issue with bad pattern
>>>>>> found on console --- test/py/tests/test_reset.py | 61
>>>>>> +++++++++++++++++++++++++++++++++++++ 1 file changed, 61
>>>>>> insertions(+) create mode 100644 test/py/tests/test_reset.py
>>>>> I had hoped this was all sorted out now, but both this and the
>>>>> saveenv test cause qemu_m68k to fail now. See:
>>>>> https://source.denx.de/u-boot/u-boot/-/jobs/791635
>>>> looking into this.
>>>
>>> Is reset implemented in qemu? It should be skipped if it is not.
>>>
>> yes, seems not implemented
>>
>> => reset
>> => reset -w
>> =>
>> =>
>>
>> Not finding any trace in the qemu code related to
>>
>> out_8(&rcm->rcr, RCM_RCR_SOFTRST);
> 
> Does reset work on the real HW, or can you not test? What I'm wondering
> is if we have a missing feature on the board/arch code (and should
> disable the reset command) or a problem with QEMU.
> 
I don't have the exact hardware (m5208evb) but:

1) i checked by tracing that on qemu the reset function is properly called

=> reset
resetting, RCR fc0a0000

2) reset register address is correct. I checked also that writing 
directly to it by mw.b does now produce the reset,

=> reset
resetting, RCR fc0a0000

=> mw.b 0xfc0a0000 80
=>

So looks not implemented in qemu.

3) testing reset on similar mcf5282, real hardware, it works

Regards,
angelo


^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH v3] test/py: reset: Add a test for reset command
  2024-03-07  7:56           ` Angelo Dureghello
@ 2024-03-07  8:26             ` Michal Simek
  2024-03-07 12:55               ` Tom Rini
  0 siblings, 1 reply; 18+ messages in thread
From: Michal Simek @ 2024-03-07  8:26 UTC (permalink / raw)
  To: Angelo Dureghello, Tom Rini; +Cc: Love Kumar, u-boot, git, Marek Vasut



On 3/7/24 08:56, Angelo Dureghello wrote:
> Hi Tom,
> 
> On 07/03/24 1:10 AM, Tom Rini wrote:
>> On Thu, Mar 07, 2024 at 12:36:42AM +0100, Angelo Dureghello wrote:
>>> Hi,
>>>
>>> On 05/03/24 1:34 PM, Michal Simek wrote:
>>>>
>>>>
>>>> On 3/3/24 22:58, Angelo Dureghello wrote:
>>>>> Hi Tom,
>>>>>> On Tue, Feb 20, 2024 at 01:11:38PM +0530, Love Kumar wrote:
>>>>>>> Add a test for reset commands which performs resetting of
>>>>>>> CPU, It does COLD reset by default and WARM reset with -w
>>>>>>> option. Signed-off-by: Love Kumar <love.kumar@amd.com>
>>>>>>> Reviewed-by: Tom Rini <trini@konsulko.com> --- Changes in
>>>>>>> v2: - Set bootmode through boardenv if modeboot is not
>>>>>>> defined Changes in v3: - Fix the issue with bad pattern
>>>>>>> found on console --- test/py/tests/test_reset.py | 61
>>>>>>> +++++++++++++++++++++++++++++++++++++ 1 file changed, 61
>>>>>>> insertions(+) create mode 100644 test/py/tests/test_reset.py
>>>>>> I had hoped this was all sorted out now, but both this and the
>>>>>> saveenv test cause qemu_m68k to fail now. See:
>>>>>> https://source.denx.de/u-boot/u-boot/-/jobs/791635
>>>>> looking into this.
>>>>
>>>> Is reset implemented in qemu? It should be skipped if it is not.
>>>>
>>> yes, seems not implemented
>>>
>>> => reset
>>> => reset -w
>>> =>
>>> =>
>>>
>>> Not finding any trace in the qemu code related to
>>>
>>> out_8(&rcm->rcr, RCM_RCR_SOFTRST);
>>
>> Does reset work on the real HW, or can you not test? What I'm wondering
>> is if we have a missing feature on the board/arch code (and should
>> disable the reset command) or a problem with QEMU.
>>
> I don't have the exact hardware (m5208evb) but:
> 
> 1) i checked by tracing that on qemu the reset function is properly called
> 
> => reset
> resetting, RCR fc0a0000
> 
> 2) reset register address is correct. I checked also that writing directly to it 
> by mw.b does now produce the reset,
> 
> => reset
> resetting, RCR fc0a0000
> 
> => mw.b 0xfc0a0000 80
> =>
> 
> So looks not implemented in qemu.

ok. That means that we shouldn't run reset test inside CI loop for this platform.

Thanks,
Michal

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH v3] test/py: reset: Add a test for reset command
  2024-03-07  8:26             ` Michal Simek
@ 2024-03-07 12:55               ` Tom Rini
  2024-03-08  6:40                 ` Angelo Dureghello
  2024-03-11  8:41                 ` Angelo Dureghello
  0 siblings, 2 replies; 18+ messages in thread
From: Tom Rini @ 2024-03-07 12:55 UTC (permalink / raw)
  To: Michal Simek; +Cc: Angelo Dureghello, Love Kumar, u-boot, git, Marek Vasut

[-- Attachment #1: Type: text/plain, Size: 2759 bytes --]

On Thu, Mar 07, 2024 at 09:26:42AM +0100, Michal Simek wrote:
> 
> 
> On 3/7/24 08:56, Angelo Dureghello wrote:
> > Hi Tom,
> > 
> > On 07/03/24 1:10 AM, Tom Rini wrote:
> > > On Thu, Mar 07, 2024 at 12:36:42AM +0100, Angelo Dureghello wrote:
> > > > Hi,
> > > > 
> > > > On 05/03/24 1:34 PM, Michal Simek wrote:
> > > > > 
> > > > > 
> > > > > On 3/3/24 22:58, Angelo Dureghello wrote:
> > > > > > Hi Tom,
> > > > > > > On Tue, Feb 20, 2024 at 01:11:38PM +0530, Love Kumar wrote:
> > > > > > > > Add a test for reset commands which performs resetting of
> > > > > > > > CPU, It does COLD reset by default and WARM reset with -w
> > > > > > > > option. Signed-off-by: Love Kumar <love.kumar@amd.com>
> > > > > > > > Reviewed-by: Tom Rini <trini@konsulko.com> --- Changes in
> > > > > > > > v2: - Set bootmode through boardenv if modeboot is not
> > > > > > > > defined Changes in v3: - Fix the issue with bad pattern
> > > > > > > > found on console --- test/py/tests/test_reset.py | 61
> > > > > > > > +++++++++++++++++++++++++++++++++++++ 1 file changed, 61
> > > > > > > > insertions(+) create mode 100644 test/py/tests/test_reset.py
> > > > > > > I had hoped this was all sorted out now, but both this and the
> > > > > > > saveenv test cause qemu_m68k to fail now. See:
> > > > > > > https://source.denx.de/u-boot/u-boot/-/jobs/791635
> > > > > > looking into this.
> > > > > 
> > > > > Is reset implemented in qemu? It should be skipped if it is not.
> > > > > 
> > > > yes, seems not implemented
> > > > 
> > > > => reset
> > > > => reset -w
> > > > =>
> > > > =>
> > > > 
> > > > Not finding any trace in the qemu code related to
> > > > 
> > > > out_8(&rcm->rcr, RCM_RCR_SOFTRST);
> > > 
> > > Does reset work on the real HW, or can you not test? What I'm wondering
> > > is if we have a missing feature on the board/arch code (and should
> > > disable the reset command) or a problem with QEMU.
> > > 
> > I don't have the exact hardware (m5208evb) but:
> > 
> > 1) i checked by tracing that on qemu the reset function is properly called
> > 
> > => reset
> > resetting, RCR fc0a0000
> > 
> > 2) reset register address is correct. I checked also that writing
> > directly to it by mw.b does now produce the reset,
> > 
> > => reset
> > resetting, RCR fc0a0000
> > 
> > => mw.b 0xfc0a0000 80
> > =>
> > 
> > So looks not implemented in qemu.
> 
> ok. That means that we shouldn't run reset test inside CI loop for this platform.

Agreed.  The TEST_PY_TEST_SPEC variable in both of the pipelines can be
used to say "not reset" for this platform in the next rev. It would also
be nice to file a bug report with QEMU too I think. Thanks for digging
in to this everyone.

-- 
Tom

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH v3] test/py: reset: Add a test for reset command
  2024-03-07 12:55               ` Tom Rini
@ 2024-03-08  6:40                 ` Angelo Dureghello
  2024-03-11  8:41                 ` Angelo Dureghello
  1 sibling, 0 replies; 18+ messages in thread
From: Angelo Dureghello @ 2024-03-08  6:40 UTC (permalink / raw)
  To: Tom Rini, Michal Simek; +Cc: Love Kumar, u-boot, git, Marek Vasut

Hi,

On 07/03/24 1:55 PM, Tom Rini wrote:
> On Thu, Mar 07, 2024 at 09:26:42AM +0100, Michal Simek wrote:
>>
>>
>> On 3/7/24 08:56, Angelo Dureghello wrote:
>>> Hi Tom,
>>>
>>> On 07/03/24 1:10 AM, Tom Rini wrote:
>>>> On Thu, Mar 07, 2024 at 12:36:42AM +0100, Angelo Dureghello wrote:
>>>>> Hi,
>>>>>
>>>>> On 05/03/24 1:34 PM, Michal Simek wrote:
>>>>>>
>>>>>>
>>>>>> On 3/3/24 22:58, Angelo Dureghello wrote:
>>>>>>> Hi Tom,
>>>>>>>> On Tue, Feb 20, 2024 at 01:11:38PM +0530, Love Kumar wrote:
>>>>>>>>> Add a test for reset commands which performs resetting of
>>>>>>>>> CPU, It does COLD reset by default and WARM reset with -w
>>>>>>>>> option. Signed-off-by: Love Kumar <love.kumar@amd.com>
>>>>>>>>> Reviewed-by: Tom Rini <trini@konsulko.com> --- Changes in
>>>>>>>>> v2: - Set bootmode through boardenv if modeboot is not
>>>>>>>>> defined Changes in v3: - Fix the issue with bad pattern
>>>>>>>>> found on console --- test/py/tests/test_reset.py | 61
>>>>>>>>> +++++++++++++++++++++++++++++++++++++ 1 file changed, 61
>>>>>>>>> insertions(+) create mode 100644 test/py/tests/test_reset.py
>>>>>>>> I had hoped this was all sorted out now, but both this and the
>>>>>>>> saveenv test cause qemu_m68k to fail now. See:
>>>>>>>> https://source.denx.de/u-boot/u-boot/-/jobs/791635
>>>>>>> looking into this.
>>>>>>
>>>>>> Is reset implemented in qemu? It should be skipped if it is not.
>>>>>>
>>>>> yes, seems not implemented
>>>>>
>>>>> => reset
>>>>> => reset -w
>>>>> =>
>>>>> =>
>>>>>
>>>>> Not finding any trace in the qemu code related to
>>>>>
>>>>> out_8(&rcm->rcr, RCM_RCR_SOFTRST);
>>>>
>>>> Does reset work on the real HW, or can you not test? What I'm wondering
>>>> is if we have a missing feature on the board/arch code (and should
>>>> disable the reset command) or a problem with QEMU.
>>>>
>>> I don't have the exact hardware (m5208evb) but:
>>>
>>> 1) i checked by tracing that on qemu the reset function is properly called
>>>
>>> => reset
>>> resetting, RCR fc0a0000
>>>
>>> 2) reset register address is correct. I checked also that writing
>>> directly to it by mw.b does now produce the reset,
>>>
>>> => reset
>>> resetting, RCR fc0a0000
>>>
>>> => mw.b 0xfc0a0000 80
>>> =>
>>>
>>> So looks not implemented in qemu.
>>
>> ok. That means that we shouldn't run reset test inside CI loop for this platform.
> 
> Agreed.  The TEST_PY_TEST_SPEC variable in both of the pipelines can be
> used to say "not reset" for this platform in the next rev. It would also
> be nice to file a bug report with QEMU too I think. Thanks for digging
> in to this everyone.
> 

good.
I also sent a patch to qemu, lets see

https://lists.gnu.org/archive/html/qemu-devel/2024-03/msg01899.html

Regards,
angelo

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH v3] test/py: reset: Add a test for reset command
  2024-03-07 12:55               ` Tom Rini
  2024-03-08  6:40                 ` Angelo Dureghello
@ 2024-03-11  8:41                 ` Angelo Dureghello
  2024-03-11  9:10                   ` Love Kumar
  1 sibling, 1 reply; 18+ messages in thread
From: Angelo Dureghello @ 2024-03-11  8:41 UTC (permalink / raw)
  To: Tom Rini, Michal Simek; +Cc: Love Kumar, u-boot, git, Marek Vasut

Hi,

jfyi,

reset support added in qemu
merged as commit d3c79c3974.

Regards,
angelo

On 07/03/24 1:55 PM, Tom Rini wrote:
> On Thu, Mar 07, 2024 at 09:26:42AM +0100, Michal Simek wrote:
>>
>>
>> On 3/7/24 08:56, Angelo Dureghello wrote:
>>> Hi Tom,
>>>
>>> On 07/03/24 1:10 AM, Tom Rini wrote:
>>>> On Thu, Mar 07, 2024 at 12:36:42AM +0100, Angelo Dureghello wrote:
>>>>> Hi,
>>>>>
>>>>> On 05/03/24 1:34 PM, Michal Simek wrote:
>>>>>>
>>>>>>
>>>>>> On 3/3/24 22:58, Angelo Dureghello wrote:
>>>>>>> Hi Tom,
>>>>>>>> On Tue, Feb 20, 2024 at 01:11:38PM +0530, Love Kumar wrote:
>>>>>>>>> Add a test for reset commands which performs resetting of
>>>>>>>>> CPU, It does COLD reset by default and WARM reset with -w
>>>>>>>>> option. Signed-off-by: Love Kumar <love.kumar@amd.com>
>>>>>>>>> Reviewed-by: Tom Rini <trini@konsulko.com> --- Changes in
>>>>>>>>> v2: - Set bootmode through boardenv if modeboot is not
>>>>>>>>> defined Changes in v3: - Fix the issue with bad pattern
>>>>>>>>> found on console --- test/py/tests/test_reset.py | 61
>>>>>>>>> +++++++++++++++++++++++++++++++++++++ 1 file changed, 61
>>>>>>>>> insertions(+) create mode 100644 test/py/tests/test_reset.py
>>>>>>>> I had hoped this was all sorted out now, but both this and the
>>>>>>>> saveenv test cause qemu_m68k to fail now. See:
>>>>>>>> https://source.denx.de/u-boot/u-boot/-/jobs/791635
>>>>>>> looking into this.
>>>>>>
>>>>>> Is reset implemented in qemu? It should be skipped if it is not.
>>>>>>
>>>>> yes, seems not implemented
>>>>>
>>>>> => reset
>>>>> => reset -w
>>>>> =>
>>>>> =>
>>>>>
>>>>> Not finding any trace in the qemu code related to
>>>>>
>>>>> out_8(&rcm->rcr, RCM_RCR_SOFTRST);
>>>>
>>>> Does reset work on the real HW, or can you not test? What I'm wondering
>>>> is if we have a missing feature on the board/arch code (and should
>>>> disable the reset command) or a problem with QEMU.
>>>>
>>> I don't have the exact hardware (m5208evb) but:
>>>
>>> 1) i checked by tracing that on qemu the reset function is properly called
>>>
>>> => reset
>>> resetting, RCR fc0a0000
>>>
>>> 2) reset register address is correct. I checked also that writing
>>> directly to it by mw.b does now produce the reset,
>>>
>>> => reset
>>> resetting, RCR fc0a0000
>>>
>>> => mw.b 0xfc0a0000 80
>>> =>
>>>
>>> So looks not implemented in qemu.
>>
>> ok. That means that we shouldn't run reset test inside CI loop for this platform.
> 
> Agreed.  The TEST_PY_TEST_SPEC variable in both of the pipelines can be
> used to say "not reset" for this platform in the next rev. It would also
> be nice to file a bug report with QEMU too I think. Thanks for digging
> in to this everyone.
> 

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH v3] test/py: reset: Add a test for reset command
  2024-03-11  8:41                 ` Angelo Dureghello
@ 2024-03-11  9:10                   ` Love Kumar
  2024-03-11 14:39                     ` Tom Rini
  0 siblings, 1 reply; 18+ messages in thread
From: Love Kumar @ 2024-03-11  9:10 UTC (permalink / raw)
  To: Angelo Dureghello, Tom Rini, Michal Simek; +Cc: u-boot, git, Marek Vasut

Hi,

On 11/03/24 2:11 pm, Angelo Dureghello wrote:
> Hi,
> 
> jfyi,
> 
> reset support added in qemu
> merged as commit d3c79c3974.
> 
> Regards,
> angelo
> 
The other issue was with echo commands:
=> echo $modeboot
$modeboot

=> echo $?
$?

Does HUSH shell is enabled by default for this?

Regards,
Love Kumar

> On 07/03/24 1:55 PM, Tom Rini wrote:
>> On Thu, Mar 07, 2024 at 09:26:42AM +0100, Michal Simek wrote:
>>>
>>>
>>> On 3/7/24 08:56, Angelo Dureghello wrote:
>>>> Hi Tom,
>>>>
>>>> On 07/03/24 1:10 AM, Tom Rini wrote:
>>>>> On Thu, Mar 07, 2024 at 12:36:42AM +0100, Angelo Dureghello wrote:
>>>>>> Hi,
>>>>>>
>>>>>> On 05/03/24 1:34 PM, Michal Simek wrote:
>>>>>>>
>>>>>>>
>>>>>>> On 3/3/24 22:58, Angelo Dureghello wrote:
>>>>>>>> Hi Tom,
>>>>>>>>> On Tue, Feb 20, 2024 at 01:11:38PM +0530, Love Kumar wrote:
>>>>>>>>>> Add a test for reset commands which performs resetting of
>>>>>>>>>> CPU, It does COLD reset by default and WARM reset with -w
>>>>>>>>>> option. Signed-off-by: Love Kumar <love.kumar@amd.com>
>>>>>>>>>> Reviewed-by: Tom Rini <trini@konsulko.com> --- Changes in
>>>>>>>>>> v2: - Set bootmode through boardenv if modeboot is not
>>>>>>>>>> defined Changes in v3: - Fix the issue with bad pattern
>>>>>>>>>> found on console --- test/py/tests/test_reset.py | 61
>>>>>>>>>> +++++++++++++++++++++++++++++++++++++ 1 file changed, 61
>>>>>>>>>> insertions(+) create mode 100644 test/py/tests/test_reset.py
>>>>>>>>> I had hoped this was all sorted out now, but both this and the
>>>>>>>>> saveenv test cause qemu_m68k to fail now. See:
>>>>>>>>> https://source.denx.de/u-boot/u-boot/-/jobs/791635
>>>>>>>> looking into this.
>>>>>>>
>>>>>>> Is reset implemented in qemu? It should be skipped if it is not.
>>>>>>>
>>>>>> yes, seems not implemented
>>>>>>
>>>>>> => reset
>>>>>> => reset -w
>>>>>> =>
>>>>>> =>
>>>>>>
>>>>>> Not finding any trace in the qemu code related to
>>>>>>
>>>>>> out_8(&rcm->rcr, RCM_RCR_SOFTRST);
>>>>>
>>>>> Does reset work on the real HW, or can you not test? What I'm 
>>>>> wondering
>>>>> is if we have a missing feature on the board/arch code (and should
>>>>> disable the reset command) or a problem with QEMU.
>>>>>
>>>> I don't have the exact hardware (m5208evb) but:
>>>>
>>>> 1) i checked by tracing that on qemu the reset function is properly 
>>>> called
>>>>
>>>> => reset
>>>> resetting, RCR fc0a0000
>>>>
>>>> 2) reset register address is correct. I checked also that writing
>>>> directly to it by mw.b does now produce the reset,
>>>>
>>>> => reset
>>>> resetting, RCR fc0a0000
>>>>
>>>> => mw.b 0xfc0a0000 80
>>>> =>
>>>>
>>>> So looks not implemented in qemu.
>>>
>>> ok. That means that we shouldn't run reset test inside CI loop for 
>>> this platform.
>>
>> Agreed.  The TEST_PY_TEST_SPEC variable in both of the pipelines can be
>> used to say "not reset" for this platform in the next rev. It would also
>> be nice to file a bug report with QEMU too I think. Thanks for digging
>> in to this everyone.
>>

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH v3] test/py: reset: Add a test for reset command
  2024-03-11  9:10                   ` Love Kumar
@ 2024-03-11 14:39                     ` Tom Rini
  2024-03-11 14:52                       ` Michal Simek
  0 siblings, 1 reply; 18+ messages in thread
From: Tom Rini @ 2024-03-11 14:39 UTC (permalink / raw)
  To: Love Kumar; +Cc: Angelo Dureghello, Michal Simek, u-boot, git, Marek Vasut

[-- Attachment #1: Type: text/plain, Size: 506 bytes --]

On Mon, Mar 11, 2024 at 02:40:59PM +0530, Love Kumar wrote:
> Hi,
> 
> On 11/03/24 2:11 pm, Angelo Dureghello wrote:
> > Hi,
> > 
> > jfyi,
> > 
> > reset support added in qemu
> > merged as commit d3c79c3974.
> > 
> > Regards,
> > angelo
> > 
> The other issue was with echo commands:
> => echo $modeboot
> $modeboot
> 
> => echo $?
> $?
> 
> Does HUSH shell is enabled by default for this?

It is not, so at least the saveenv test needs to depend on HUSH_PARSER
too.

-- 
Tom

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH v3] test/py: reset: Add a test for reset command
  2024-03-11 14:39                     ` Tom Rini
@ 2024-03-11 14:52                       ` Michal Simek
  2024-03-11 15:09                         ` Tom Rini
  0 siblings, 1 reply; 18+ messages in thread
From: Michal Simek @ 2024-03-11 14:52 UTC (permalink / raw)
  To: Tom Rini, Love Kumar; +Cc: Angelo Dureghello, u-boot, git, Marek Vasut



On 3/11/24 15:39, Tom Rini wrote:
> On Mon, Mar 11, 2024 at 02:40:59PM +0530, Love Kumar wrote:
>> Hi,
>>
>> On 11/03/24 2:11 pm, Angelo Dureghello wrote:
>>> Hi,
>>>
>>> jfyi,
>>>
>>> reset support added in qemu
>>> merged as commit d3c79c3974.
>>>
>>> Regards,
>>> angelo
>>>
>> The other issue was with echo commands:
>> => echo $modeboot
>> $modeboot
>>
>> => echo $?
>> $?
>>
>> Does HUSH shell is enabled by default for this?
> 
> It is not, so at least the saveenv test needs to depend on HUSH_PARSER
> too.

Based on logs on this platform echo $? doesn't return any value.
There is any config for it which is not enabled for this platform.
Do you know which Kconfig symbol it is?

Depending on HUSH is likely big hammer but I was not able to find that exact
Kconfig symbol just for $?

thanks,
Michal


^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH v3] test/py: reset: Add a test for reset command
  2024-03-11 14:52                       ` Michal Simek
@ 2024-03-11 15:09                         ` Tom Rini
  2024-03-11 15:14                           ` Michal Simek
  0 siblings, 1 reply; 18+ messages in thread
From: Tom Rini @ 2024-03-11 15:09 UTC (permalink / raw)
  To: Michal Simek; +Cc: Love Kumar, Angelo Dureghello, u-boot, git, Marek Vasut

[-- Attachment #1: Type: text/plain, Size: 1162 bytes --]

On Mon, Mar 11, 2024 at 03:52:57PM +0100, Michal Simek wrote:
> 
> 
> On 3/11/24 15:39, Tom Rini wrote:
> > On Mon, Mar 11, 2024 at 02:40:59PM +0530, Love Kumar wrote:
> > > Hi,
> > > 
> > > On 11/03/24 2:11 pm, Angelo Dureghello wrote:
> > > > Hi,
> > > > 
> > > > jfyi,
> > > > 
> > > > reset support added in qemu
> > > > merged as commit d3c79c3974.
> > > > 
> > > > Regards,
> > > > angelo
> > > > 
> > > The other issue was with echo commands:
> > > => echo $modeboot
> > > $modeboot
> > > 
> > > => echo $?
> > > $?
> > > 
> > > Does HUSH shell is enabled by default for this?
> > 
> > It is not, so at least the saveenv test needs to depend on HUSH_PARSER
> > too.
> 
> Based on logs on this platform echo $? doesn't return any value.
> There is any config for it which is not enabled for this platform.
> Do you know which Kconfig symbol it is?
> 
> Depending on HUSH is likely big hammer but I was not able to find that exact
> Kconfig symbol just for $?

Well, if we don't have the hush parser we have a much more limited
parser enabled and I bet that's why (I think there's no variable
expansion).

-- 
Tom

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH v3] test/py: reset: Add a test for reset command
  2024-03-11 15:09                         ` Tom Rini
@ 2024-03-11 15:14                           ` Michal Simek
  2024-03-11 15:15                             ` Tom Rini
  0 siblings, 1 reply; 18+ messages in thread
From: Michal Simek @ 2024-03-11 15:14 UTC (permalink / raw)
  To: Tom Rini; +Cc: Love Kumar, Angelo Dureghello, u-boot, git, Marek Vasut



On 3/11/24 16:09, Tom Rini wrote:
> On Mon, Mar 11, 2024 at 03:52:57PM +0100, Michal Simek wrote:
>>
>>
>> On 3/11/24 15:39, Tom Rini wrote:
>>> On Mon, Mar 11, 2024 at 02:40:59PM +0530, Love Kumar wrote:
>>>> Hi,
>>>>
>>>> On 11/03/24 2:11 pm, Angelo Dureghello wrote:
>>>>> Hi,
>>>>>
>>>>> jfyi,
>>>>>
>>>>> reset support added in qemu
>>>>> merged as commit d3c79c3974.
>>>>>
>>>>> Regards,
>>>>> angelo
>>>>>
>>>> The other issue was with echo commands:
>>>> => echo $modeboot
>>>> $modeboot
>>>>
>>>> => echo $?
>>>> $?
>>>>
>>>> Does HUSH shell is enabled by default for this?
>>>
>>> It is not, so at least the saveenv test needs to depend on HUSH_PARSER
>>> too.
>>
>> Based on logs on this platform echo $? doesn't return any value.
>> There is any config for it which is not enabled for this platform.
>> Do you know which Kconfig symbol it is?
>>
>> Depending on HUSH is likely big hammer but I was not able to find that exact
>> Kconfig symbol just for $?
> 
> Well, if we don't have the hush parser we have a much more limited
> parser enabled and I bet that's why (I think there's no variable
> expansion).

ok. Then this test should be limited to HUSH too based on how it is written.
I think it should be okish limitation and if someone wants to test it on systems 
without HUSH enabled it should just update it. If is fine for you?

Thanks,
Michal


^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH v3] test/py: reset: Add a test for reset command
  2024-03-11 15:14                           ` Michal Simek
@ 2024-03-11 15:15                             ` Tom Rini
  0 siblings, 0 replies; 18+ messages in thread
From: Tom Rini @ 2024-03-11 15:15 UTC (permalink / raw)
  To: Michal Simek; +Cc: Love Kumar, Angelo Dureghello, u-boot, git, Marek Vasut

[-- Attachment #1: Type: text/plain, Size: 1839 bytes --]

On Mon, Mar 11, 2024 at 04:14:04PM +0100, Michal Simek wrote:
> 
> 
> On 3/11/24 16:09, Tom Rini wrote:
> > On Mon, Mar 11, 2024 at 03:52:57PM +0100, Michal Simek wrote:
> > > 
> > > 
> > > On 3/11/24 15:39, Tom Rini wrote:
> > > > On Mon, Mar 11, 2024 at 02:40:59PM +0530, Love Kumar wrote:
> > > > > Hi,
> > > > > 
> > > > > On 11/03/24 2:11 pm, Angelo Dureghello wrote:
> > > > > > Hi,
> > > > > > 
> > > > > > jfyi,
> > > > > > 
> > > > > > reset support added in qemu
> > > > > > merged as commit d3c79c3974.
> > > > > > 
> > > > > > Regards,
> > > > > > angelo
> > > > > > 
> > > > > The other issue was with echo commands:
> > > > > => echo $modeboot
> > > > > $modeboot
> > > > > 
> > > > > => echo $?
> > > > > $?
> > > > > 
> > > > > Does HUSH shell is enabled by default for this?
> > > > 
> > > > It is not, so at least the saveenv test needs to depend on HUSH_PARSER
> > > > too.
> > > 
> > > Based on logs on this platform echo $? doesn't return any value.
> > > There is any config for it which is not enabled for this platform.
> > > Do you know which Kconfig symbol it is?
> > > 
> > > Depending on HUSH is likely big hammer but I was not able to find that exact
> > > Kconfig symbol just for $?
> > 
> > Well, if we don't have the hush parser we have a much more limited
> > parser enabled and I bet that's why (I think there's no variable
> > expansion).
> 
> ok. Then this test should be limited to HUSH too based on how it is written.
> I think it should be okish limitation and if someone wants to test it on
> systems without HUSH enabled it should just update it. If is fine for you?

Yup, sounds good. And I'll take the next iteration of this test patch
when I also grab the patch I posted to cherry-pick the missing reset
functionality in our QEMU.

-- 
Tom

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]

^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2024-03-11 15:15 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-02-20  7:41 [PATCH v3] test/py: reset: Add a test for reset command Love Kumar
2024-02-20 20:04 ` Tom Rini
2024-03-02 15:18 ` Tom Rini
2024-03-03 21:58   ` Angelo Dureghello
2024-03-05 12:34     ` Michal Simek
2024-03-06 23:36       ` Angelo Dureghello
2024-03-07  0:10         ` Tom Rini
2024-03-07  7:56           ` Angelo Dureghello
2024-03-07  8:26             ` Michal Simek
2024-03-07 12:55               ` Tom Rini
2024-03-08  6:40                 ` Angelo Dureghello
2024-03-11  8:41                 ` Angelo Dureghello
2024-03-11  9:10                   ` Love Kumar
2024-03-11 14:39                     ` Tom Rini
2024-03-11 14:52                       ` Michal Simek
2024-03-11 15:09                         ` Tom Rini
2024-03-11 15:14                           ` Michal Simek
2024-03-11 15:15                             ` Tom Rini

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.