All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1] test/py: Add test support for three stage boot
@ 2020-07-21 15:12 yan-liu at ti.com
  2020-08-04 15:32 ` Liu, Yan
  2020-08-05 20:27 ` Tom Rini
  0 siblings, 2 replies; 3+ messages in thread
From: yan-liu at ti.com @ 2020-07-21 15:12 UTC (permalink / raw)
  To: u-boot

From: Yan Liu <yan-liu@ti.com>

Current pytest only support upto 2 stage boot;
Some boards like TI K3 am6/J7 boards use 3 stage
boot. This patch adds u_boot_spl2 to be able to
handle the 3-stage boot case. User needs to set
"env__spl2_skipped" in u_boot_boardenv config
file to use this support. By default it is set
to TRUE.

Signed-off-by: Yan Liu <yan-liu@ti.com>
---
 test/py/u_boot_console_base.py | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/test/py/u_boot_console_base.py b/test/py/u_boot_console_base.py
index 326b2ac..1db5da4 100644
--- a/test/py/u_boot_console_base.py
+++ b/test/py/u_boot_console_base.py
@@ -17,6 +17,7 @@ import u_boot_spawn
 
 # Regexes for text we expect U-Boot to send to the console.
 pattern_u_boot_spl_signon = re.compile('(U-Boot SPL \\d{4}\\.\\d{2}[^\r\n]*\\))')
+pattern_u_boot_spl2_signon = re.compile('(U-Boot SPL \\d{4}\\.\\d{2}[^\r\n]*\\))')
 pattern_u_boot_main_signon = re.compile('(U-Boot \\d{4}\\.\\d{2}[^\r\n]*\\))')
 pattern_stop_autoboot_prompt = re.compile('Hit any key to stop autoboot: ')
 pattern_unknown_command = re.compile('Unknown command \'.*\' - try \'help\'')
@@ -28,6 +29,7 @@ PAT_RE = 1
 
 bad_pattern_defs = (
     ('spl_signon', pattern_u_boot_spl_signon),
+    ('spl2_signon', pattern_u_boot_spl2_signon),
     ('main_signon', pattern_u_boot_main_signon),
     ('stop_autoboot_prompt', pattern_stop_autoboot_prompt),
     ('unknown_command', pattern_unknown_command),
@@ -353,12 +355,20 @@ class ConsoleBase(object):
                                                  'n') == 'y'
             env_spl_skipped = self.config.env.get('env__spl_skipped',
                                                   False)
+            env_spl2_skipped = self.config.env.get('env__spl2_skipped',
+                                                  True)
             if config_spl and config_spl_serial_support and not env_spl_skipped:
                 m = self.p.expect([pattern_u_boot_spl_signon] +
                                   self.bad_patterns)
                 if m != 0:
                     raise Exception('Bad pattern found on SPL console: ' +
                                     self.bad_pattern_ids[m - 1])
+            if not env_spl2_skipped:
+                m = self.p.expect([pattern_u_boot_spl2_signon] +
+                                  self.bad_patterns)
+                if m != 0:
+                    raise Exception('Bad pattern found on SPL2 console: ' +
+                                    self.bad_pattern_ids[m - 1])
             m = self.p.expect([pattern_u_boot_main_signon] + self.bad_patterns)
             if m != 0:
                 raise Exception('Bad pattern found on console: ' +
-- 
2.7.4

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

* [PATCH v1] test/py: Add test support for three stage boot
  2020-07-21 15:12 [PATCH v1] test/py: Add test support for three stage boot yan-liu at ti.com
@ 2020-08-04 15:32 ` Liu, Yan
  2020-08-05 20:27 ` Tom Rini
  1 sibling, 0 replies; 3+ messages in thread
From: Liu, Yan @ 2020-08-04 15:32 UTC (permalink / raw)
  To: u-boot

Hi,

Any comments on this patch? Can this patch be merged in?

Thanks and Regards,
Yan


-----Original Message-----
From: Liu, Yan 
Sent: Tuesday, July 21, 2020 11:12 AM
To: u-boot at lists.denx.de
Cc: trini at konsulko.com; Liu, Yan
Subject: [PATCH v1] test/py: Add test support for three stage boot

From: Yan Liu <yan-liu@ti.com>

Current pytest only support upto 2 stage boot;
Some boards like TI K3 am6/J7 boards use 3 stage
boot. This patch adds u_boot_spl2 to be able to
handle the 3-stage boot case. User needs to set
"env__spl2_skipped" in u_boot_boardenv config
file to use this support. By default it is set
to TRUE.

Signed-off-by: Yan Liu <yan-liu@ti.com>
---
 test/py/u_boot_console_base.py | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/test/py/u_boot_console_base.py b/test/py/u_boot_console_base.py
index 326b2ac..1db5da4 100644
--- a/test/py/u_boot_console_base.py
+++ b/test/py/u_boot_console_base.py
@@ -17,6 +17,7 @@ import u_boot_spawn
 
 # Regexes for text we expect U-Boot to send to the console.
 pattern_u_boot_spl_signon = re.compile('(U-Boot SPL \\d{4}\\.\\d{2}[^\r\n]*\\))')
+pattern_u_boot_spl2_signon = re.compile('(U-Boot SPL \\d{4}\\.\\d{2}[^\r\n]*\\))')
 pattern_u_boot_main_signon = re.compile('(U-Boot \\d{4}\\.\\d{2}[^\r\n]*\\))')
 pattern_stop_autoboot_prompt = re.compile('Hit any key to stop autoboot: ')
 pattern_unknown_command = re.compile('Unknown command \'.*\' - try \'help\'')
@@ -28,6 +29,7 @@ PAT_RE = 1
 
 bad_pattern_defs = (
     ('spl_signon', pattern_u_boot_spl_signon),
+    ('spl2_signon', pattern_u_boot_spl2_signon),
     ('main_signon', pattern_u_boot_main_signon),
     ('stop_autoboot_prompt', pattern_stop_autoboot_prompt),
     ('unknown_command', pattern_unknown_command),
@@ -353,12 +355,20 @@ class ConsoleBase(object):
                                                  'n') == 'y'
             env_spl_skipped = self.config.env.get('env__spl_skipped',
                                                   False)
+            env_spl2_skipped = self.config.env.get('env__spl2_skipped',
+                                                  True)
             if config_spl and config_spl_serial_support and not env_spl_skipped:
                 m = self.p.expect([pattern_u_boot_spl_signon] +
                                   self.bad_patterns)
                 if m != 0:
                     raise Exception('Bad pattern found on SPL console: ' +
                                     self.bad_pattern_ids[m - 1])
+            if not env_spl2_skipped:
+                m = self.p.expect([pattern_u_boot_spl2_signon] +
+                                  self.bad_patterns)
+                if m != 0:
+                    raise Exception('Bad pattern found on SPL2 console: ' +
+                                    self.bad_pattern_ids[m - 1])
             m = self.p.expect([pattern_u_boot_main_signon] + self.bad_patterns)
             if m != 0:
                 raise Exception('Bad pattern found on console: ' +
-- 
2.7.4

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

* [PATCH v1] test/py: Add test support for three stage boot
  2020-07-21 15:12 [PATCH v1] test/py: Add test support for three stage boot yan-liu at ti.com
  2020-08-04 15:32 ` Liu, Yan
@ 2020-08-05 20:27 ` Tom Rini
  1 sibling, 0 replies; 3+ messages in thread
From: Tom Rini @ 2020-08-05 20:27 UTC (permalink / raw)
  To: u-boot

On Tue, Jul 21, 2020 at 11:12:05AM -0400, yan-liu at ti.com wrote:

> From: Yan Liu <yan-liu@ti.com>
> 
> Current pytest only support upto 2 stage boot;
> Some boards like TI K3 am6/J7 boards use 3 stage
> boot. This patch adds u_boot_spl2 to be able to
> handle the 3-stage boot case. User needs to set
> "env__spl2_skipped" in u_boot_boardenv config
> file to use this support. By default it is set
> to TRUE.
> 
> Signed-off-by: Yan Liu <yan-liu@ti.com>
> Signed-off-by: Yan Liu <yan-liu@ti.com>

Applied to u-boot/master, thanks!

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20200805/7124cae9/attachment.sig>

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

end of thread, other threads:[~2020-08-05 20:27 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-21 15:12 [PATCH v1] test/py: Add test support for three stage boot yan-liu at ti.com
2020-08-04 15:32 ` Liu, Yan
2020-08-05 20:27 ` 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.