west: commands: sign: Add signing support for other CAVS targets

Sign for CAVS15, CAVS18, CAVS20 and CAVS25 SOCs

Originally-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
diff --git a/scripts/west_commands/sign.py b/scripts/west_commands/sign.py
index 75a1b62..37d0bd0 100644
--- a/scripts/west_commands/sign.py
+++ b/scripts/west_commands/sign.py
@@ -391,6 +391,20 @@
 
 class RimageSigner(Signer):
 
+    @staticmethod
+    def edt_get_rimage_target(board):
+        if 'up_squared_adsp' in board:
+            return 'apl'
+        if 'intel_adsp_cavs18' in board:
+            return 'cnl'
+        if 'intel_adsp_cavs20' in board:
+            return 'icl'
+        if 'intel_adsp_cavs25' in board:
+            return 'tgl'
+
+        log.die('Signing not supported for board ' + board)
+
+
     def sign(self, command, build_dir, bcfg, formats):
         args = command.args
 
@@ -409,8 +423,9 @@
         cache = CMakeCache.from_build_dir(build_dir)
 
         board = cache['CACHED_BOARD']
-        if board != 'up_squared_adsp':
-            log.die('Supported only for up_squared_adsp board')
+        log.inf('Signing for board ' + board)
+        target = self.edt_get_rimage_target(board)
+        log.inf('Signing for SOC target ' + target)
 
         if not args.quiet:
             log.inf('Signing with tool {}'.format(tool_path))
@@ -420,7 +435,7 @@
         out_bin = str(b / 'zephyr' / 'zephyr.ri')
 
         sign_base = ([tool_path] + args.tool_args +
-                     ['-o', out_bin, '-m', 'apl', '-i', '3'] +
+                     ['-o', out_bin, '-m', target, '-i', '3'] +
                      [bootloader, kernel])
 
         if not args.quiet: