@@ -6,6 +6,7 @@ load("@rules_pkg//pkg:tar.bzl", "pkg_tar")
66load ("//rules:const.bzl" , "CONST" , "hex" )
77load ("//rules:manifest.bzl" , "manifest" )
88load ("//rules:signing.bzl" , "offline_presigning_artifacts" , "offline_signature_attach" )
9+ load ("//rules/coverage:view.bzl" , "coverage_view_test" )
910load ("//rules/opentitan:defs.bzl" , "opentitan_binary" )
1011load (
1112 "//sw/device/silicon_creator/rom_ext:defs.bzl" ,
@@ -105,6 +106,56 @@ manifest(d = {
105106 for slot in SLOTS
106107]
107108
109+ ROM_EXT_CONFIGS = {
110+ "dice_x509_xmodem" : {
111+ "dice" : "dice_x509" ,
112+ "deps" : ["//sw/device/silicon_creator/lib/rescue:rescue_xmodem" ],
113+ },
114+ "dice_cwt_spidfu" : {
115+ "dice" : "dice_cwt" ,
116+ "deps" : ["//sw/device/silicon_creator/lib/rescue:rescue_spidfu" ],
117+ },
118+ "dice_x509_usbdfu" : {
119+ "dice" : "dice_x509" ,
120+ "deps" : ["//sw/device/silicon_creator/lib/rescue:rescue_usbdfu" ],
121+ },
122+ }
123+
124+ [
125+ opentitan_binary (
126+ name = "rom_ext_prod_{}" .format (name ),
127+ exec_env = [
128+ "//hw/top_earlgrey:silicon_creator" ,
129+ ],
130+ extra_bazel_features = [
131+ "minsize" ,
132+ "use_lld" ,
133+ ],
134+ linker_script = "//sw/device/silicon_creator/rom_ext:ld_slot_virtual" ,
135+ linkopts = [
136+ "$(location //sw/device/silicon_creator/rom_ext:rom_ext_{})" .format (config ["dice" ]),
137+ "$(location //sw/device/lib/crt)" ,
138+ ],
139+ deps = [
140+ # The sival_owner C library is excluded from the real ROM_EXT,
141+ # as chips maintain their ownership configuration in flash.
142+ "//sw/device/lib/crt" ,
143+ "//sw/device/silicon_creator/lib:manifest_def" ,
144+ "//sw/device/silicon_creator/rom_ext:rom_ext_{}" .format (config ["dice" ]),
145+ "//sw/device/silicon_creator/rom_ext/imm_section:main_section_{}_slot_virtual" .format (config ["dice" ]),
146+ ] + config ["deps" ],
147+ )
148+ for name , config in ROM_EXT_CONFIGS .items ()
149+ ]
150+
151+ [
152+ coverage_view_test (
153+ name = "rom_ext_prod_{}_coverage_view" .format (name ),
154+ elf = "rom_ext_prod_{}" .format (name ),
155+ )
156+ for name in ROM_EXT_CONFIGS .keys ()
157+ ]
158+
108159offline_presigning_artifacts (
109160 name = "presigning" ,
110161 testonly = True ,
0 commit comments