diff --git a/doc/manager_recovery.pu b/doc/manager_recovery.pu new file mode 100644 index 00000000..f86b0d37 --- /dev/null +++ b/doc/manager_recovery.pu @@ -0,0 +1,100 @@ +@startuml Nebula Manager Device Recovery +start +title Nebula Manager Device Recovery +if (Is Linux is accessible?) then (yes) + partition "Verify IP Address" { + :(1)get ip address via uart, + if none assign one via dhcp + (2)if address is not expected, + update nebula config to new address; + } + #palegreen: Home sweet home; + kill +else (no) + + if (usbsdmux enabled) then (yes) + partition #yellow "SD Card Mux"{ + : power down board using PDU + __power.power_down_board()__; + if (SD card mode) then (yes) + : update boot files + from within sdcard + via usb-sd-mux; + else (no) + : update boot files + from external sources + via usb-sd-mux; + endif + : Update device tree + via usb-sd-mux; + } + #Gray: Power cycle using PDU; + kill + else + if (JTAG enabled) then (yes) + : Restart board via JTAG; + else (no) + : Restart board via PDU; + endif + + if (if uboot menu reached) then (yes) + if (if tftp enabled) then (yes) + : load boot files + from tftp via uart; + #Gray: Power cycle using PDU; + kill + else (no) + if (SD card mode) then (yes) + : copy bootfiles + from within sdcard via uart; + else (no) + : copy bootfiles + from external sources via uart; + endif + #Gray: Power cycle using PDU; + kill + endif + else (no) + #orange: Second Stage; + kill + endif + endif + + #Gray: Power cycle using PDU; + if (Linux prompt reached) then (yes) + partition "Network check"{ + if (is Network (IP) functional) then (yes) + if (is SSH functional) then (yes) + #palegreen: Home sweet home; + kill + else (no) + #orange: Second Stage; + kill + endif + else (no) + #orange: Second Stage; + kill + endif + } + else (no) + #orange: Second Stage; + kill + endif + #orange :Second Stage; + : TO FIX JTAG Recovery + __manager.board_reboot_jtag_uart()__; + :__manager.power_cycle_to_boot()__; + if (power_cycle_to_boot ok) then (yes) + :__manager.network_check()__; + if (network check ok) then (yes) + #palegreen: Home sweet home; + kill + else (no) + #red: Recovery Failed; + endif + else (no) + #red: Recovery Failed; + endif +endif +end +@enduml diff --git a/nebula/errors.py b/nebula/errors.py index 5ddeca53..82dd008b 100644 --- a/nebula/errors.py +++ b/nebula/errors.py @@ -30,7 +30,13 @@ class SSHNotFunctionalAfterBootFileUpdate(Error): class LinuxNotReached(Error): - """Linux is accessible (likely previous bad BOOT.BIN or kernel crash)""" + """Linux is inaccessible (likely previous bad BOOT.BIN or kernel crash)""" + + pass + + +class UbootNotReached(Error): + """U-boot menu not reachable""" pass diff --git a/nebula/jtag.py b/nebula/jtag.py index d8f3317b..c2e6c664 100644 --- a/nebula/jtag.py +++ b/nebula/jtag.py @@ -115,11 +115,11 @@ def target_set_str(self, target_name): + "}} ; " ) - def boot_to_uboot(self): + def boot_to_uboot(self, fsblpath="fsbl.elf", ubootpath="u-boot.elf"): """From JTAG reset board and load up FSBL and uboot This should be followed by uboot interaction to stop it""" - assert os.path.isfile("fsbl.elf") - assert os.path.isfile("u-boot.elf") + assert os.path.isfile(fsblpath) + assert os.path.isfile(ubootpath) cmd = "connect; " cmd += "after 3000; " @@ -138,12 +138,16 @@ def boot_to_uboot(self): cmd += "after 1000; " cmd += "puts {Loading FSBL}; " - cmd += "dow fsbl.elf; " + cmd += f"dow {fsblpath}; " cmd += "con; " cmd += "after 1000; " cmd += "puts {Loading U-BOOT}; " - cmd += "if {[catch {dow u-boot.elf} result]} {puts {Error loading FSBL... u-boot is probably loaded}; }; " + cmd += ( + "if {[catch {dow " + + ubootpath + + "} result]} {puts {Error loading FSBL... u-boot is probably loaded}; }; " + ) cmd += "con; " self.run_xsdb(cmd) diff --git a/nebula/manager.py b/nebula/manager.py index 18b52197..4f2bbe8b 100644 --- a/nebula/manager.py +++ b/nebula/manager.py @@ -16,6 +16,7 @@ from nebula.tftpboot import tftpboot from nebula.uart import uart from nebula.usbdev import usbdev +from nebula.usbmux import usbmux logging.basicConfig(level=logging.INFO) log = logging.getLogger(__name__) @@ -24,7 +25,7 @@ class manager: """Board Manager""" - def __init__( + def __init__( # noqa:C901 self, monitor_type="uart", configfilename=None, @@ -110,6 +111,13 @@ def __init__( self.tftp = False + if "usbmux-config" in configs: + self.usbsdmux = usbmux( + yamlfilename=self.configfilename, board_name=board_name + ) + else: + self.usbsdmux = None + self.help = helper.helper() self.usbdev = usbdev() self.board_name = board_name @@ -138,7 +146,7 @@ def _check_files_exist(self, *args): raise Exception(filename + " not found or does not exist") def copy_reference_from_sdcard(self, bootbinpath, uimagepath, devtreepath): - target = uimagepath.split("/")[1].rstrip() + target = os.path.basename(uimagepath).strip("\n") if "uImage" in str(uimagepath): ref = "zynq-common/" + str(target) else: @@ -149,7 +157,7 @@ def copy_reference_from_sdcard(self, bootbinpath, uimagepath, devtreepath): ref = self.reference_boot_folder + "/" + str(self.boot_subfolder) else: ref = self.reference_boot_folder - target = bootbinpath.split("/")[1].rstrip() + target = os.path.basename(bootbinpath).strip("\n") ref = ref + "/" + str(target) self.monitor[0].copy_reference(ref, target) @@ -157,7 +165,7 @@ def copy_reference_from_sdcard(self, bootbinpath, uimagepath, devtreepath): ref = self.reference_boot_folder + "/" + str(self.devicetree_subfolder) else: ref = self.reference_boot_folder - target = devtreepath.split("/")[1].rstrip() + target = os.path.basename(devtreepath).strip("\n") ref = ref + "/" + str(target) self.monitor[0].copy_reference(ref, target) @@ -195,10 +203,17 @@ def network_check(self): raise ne.SSHNotFunctionalAfterBootFileUpdate @_release_thread_lock - def recover_board( - self, system_top_bit_path, bootbinpath, uimagepath, devtreepath, sdcard=False + def recover_board( # noqa:C901 + self, + system_top_bit_path, + bootbinpath, + uimagepath, + devtreepath, + fsblpath=None, + ubootpath=None, + sdcard=False, ): - """Recover boards with UART, PDU, JTAG, and Network are available""" + """Recover boards with UART, PDU, JTAG, USB-SD-Mux and Network if available""" self._check_files_exist( system_top_bit_path, bootbinpath, uimagepath, devtreepath ) @@ -238,127 +253,151 @@ def recover_board( return except (ne.LinuxNotReached, TimeoutError): + log.warn("Linux is not accessible") try: - # Power cycle - log.info("SSH reboot failed again after power cycling") - log.info("Forcing UART override on reset") - if self.jtag_use: - log.info("Resetting with JTAG") - self.jtag.restart_board() - else: - # TODO: consider zed boards which uart closes after a powercycle - log.info("Power cycling") - self.power.power_cycle_board() - - # Enter u-boot menu - if not self.monitor[0]._enter_uboot_menu_from_power_cycle(): - raise ne.LinuxNotReached - - if self.tftp: - # Move files to correct position for TFTP - # self.monitor[0].load_system_uart_from_tftp() - - # Load boot files over tftp - self.monitor[0].load_system_uart_from_tftp() - + if self.usbsdmux: + log.info("Will try to recover using usb-sd mux...") + self.power.power_down_board() + if sdcard: + # TODO: Recover using SD card boot files + pass + else: + self.usbsdmux.update_boot_files_from_external( + bootbin_loc=bootbinpath, + kernel_loc=uimagepath, + devicetree_loc=devtreepath, + ) + # if devtreepath: + # self.usbsdmux.update_devicetree_for_mux(devtreepath) + self.usbsdmux.set_mux_mode("dut") + + # powercycle board + log.info("Power cycling to boot") + self.power_cycle_to_boot() else: - try: - if sdcard: - log.info("Copying reference from sdcard") - self.copy_reference_from_sdcard( - bootbinpath, uimagepath, devtreepath - ) - self.monitor[0]._write_data("\r\n") - self.monitor[0]._write_data("boot") - else: - # Load boot files via uart - log.info("Sending reference via uart") - self.monitor[0].load_system_uart( - system_top_bit_filename=system_top_bit_path, - kernel_filename=uimagepath, - devtree_filename=devtreepath, - ) - except Exception as ex: - log.warning("Error copying reference.") - log.warning(str(ex)) - - log.info("Waiting for boot to complete") - - # Verify linux is reached - result = self.monitor[0]._read_until_done( - done_string="root@analog", max_time=100 - ) - - if not result: - # raise Exception("Linux not fully booting") - raise ne.LinuxNotReached + # Power cycle + log.info("Will try to recover using uart...") + log.info("Forcing UART override on reset") + if self.jtag_use: + log.info("Resetting with JTAG") + self.jtag.restart_board() + else: + # TODO: consider zed boards which uart closes after a powercycle + log.info("Power cycling") + self.power.power_cycle_board() + + # Enter u-boot menu + if not self.monitor[0]._enter_uboot_menu_from_power_cycle(): + raise ne.UbootNotReached + + if self.tftp: + # Move files to correct position for TFTP + # self.monitor[0].load_system_uart_from_tftp() + + # Load boot files over tftp + self.monitor[0].load_system_uart_from_tftp() + + else: + # TODO: Add option to load boot files from SD card reference + # Load boot files via uart + log.info("Sending reference via uart") + self.monitor[0].load_system_uart( + system_top_bit_filename=system_top_bit_path, + kernel_filename=uimagepath, + devtree_filename=devtreepath, + ) + results = self.monitor[0]._read_until_done_multi( + done_strings=["Starting kernel", "root@analog"], + max_time=100, + ) + + if len(results) == 1: + raise Exception("u-boot menu cannot boot kernel") + elif not results[1]: + raise Exception("Linux not fully booting") log.info("Linux fully booted") # Check is networking is working self.network_check() - - print("Home sweet home") + log.info("Board recovery complete") + log.info("Home sweet home") self.monitor[0].stop_log() # JTAG RECOVERY - except Exception: - self.board_reboot_jtag_uart( - bootbinpath, uimagepath, devtreepath, sdcard - ) + except Exception as e: + + if self.jtag: + log.warn("Recovery failed. Will try JTAG") + self.board_reboot_jtag_uart( + system_top_bit_path, + uimagepath, + devtreepath, + fsblpath, + ubootpath, + sdcard, + ) + log.info("Linux fully recovered") + else: + log.error("JTAG not configured, cannot recover further!") + raise e + self.monitor[0].stop_log() @_release_thread_lock def board_reboot_jtag_uart( - self, bootbinpath, uimagepath, devtreepath, sdcard=False + self, + system_top_bit_path, + uimagepath, + devtreepath, + fsblpath=None, + ubootpath=None, + sdcard=False, ): """Reset board and load fsbl, uboot, bitstream, and kernel over JTAG. Then over UART boot """ - # self.monitor[0].start_log() + self.monitor[0]._read_until_stop() # Flush + self.monitor[0].start_log(logappend=True) log.info("Resetting and looking DDR with boot files") - # self.jtag.full_boot() - # Check if u-boot loads first - # log.info("Resetting with JTAG and checking if u-boot is reachable") - # self.jtag.restart_board() - # do a power cylcle rather than jtag reboot to make sure jtag devices are working log.info("Resetting with JTAG and checking if u-boot is reachable") self.jtag.restart_board() if self.monitor[0]._enter_uboot_menu_from_power_cycle(): log.info("u-boot accessible after JTAG reset") - self.jtag.restart_board() - log.info("Taking over UART control") - self.monitor[0]._enter_uboot_menu_from_power_cycle() else: log.info("u-boot not reachable, manually loading u-boot over JTAG") - self.jtag.boot_to_uboot() + self.jtag.boot_to_uboot(fsblpath, ubootpath) log.info("Taking over UART control") - self.monitor[0]._enter_uboot_menu_from_power_cycle() + if not self.monitor[0]._enter_uboot_menu_from_power_cycle(): + raise ne.UbootNotReached - # Get SD card file directory - if not sdcard: - # Copy over and write to disk - log.info("Copying boot files over UART to SD card") - self.monitor[0].load_system_uart_copy_to_sdcard( - bootbinpath, devtreepath, uimagepath - ) + if self.tftp: + # Load boot files over tftp + self.monitor[0].load_system_uart_from_tftp() else: - self.copy_reference_from_sdcard(bootbinpath, uimagepath, devtreepath) - - # self.jtag.load_post_uboot_files() - # self.monitor[0].update_boot_args() - # self.monitor[0].boot() - # self.monitor[0].load_system_uart( - # system_top_bit_filename="system_top.bit", - # kernel_filename="uImage", - # devtree_filename="devicetree.dtb", - # ) - # power cycle board - self.power_cycle_to_boot() + # TODO: Add option to load boot files from SD card reference + # Load boot files via uart + log.info("Sending reference via uart") + self.monitor[0].load_system_uart( + system_top_bit_filename=system_top_bit_path, + kernel_filename=uimagepath, + devtree_filename=devtreepath, + ) + results = self.monitor[0]._read_until_done_multi( + done_strings=["U-Boot", "Starting kernel", "root@analog"], max_time=100 + ) - # Check is networking is working - self.network_check() + if len(results) == 1: + raise Exception("u-boot not reached") + elif not results[1]: + raise Exception("u-boot menu cannot boot kernel") + elif not results[2]: + raise Exception("Linux not fully booting") - self.monitor[0].stop_log() + log.info("Linux fully booted") + + # Check is networking is working + self.network_check() + self.monitor[0].stop_log() @_release_thread_lock def board_reboot_uart_net_pdu( @@ -459,6 +498,68 @@ def board_reboot_uart_net_pdu( print("Home sweet home") self.monitor[0].stop_log() + @_release_thread_lock + def board_reboot_sdmux_pdu( + self, system_top_bit_path, bootbinpath, uimagepath, devtreepath + ): + """Manager when sdcardmux, pdu is available""" + self._check_files_exist( + system_top_bit_path, bootbinpath, uimagepath, devtreepath + ) + try: + # Flush UART + self.monitor[0]._read_until_stop() # Flush + self.monitor[0].start_log(logappend=True) + # Check if Linux is accessible + log.info("Checking if Linux is accessible") + try: + out = self.monitor[0].get_uart_command_for_linux("uname -a", "Linux") + if not out: + raise ne.LinuxNotReached + except Exception as e: + # raise LinuxNotReached for other exceptions + log.info(str(e)) + raise ne.LinuxNotReached + + # Get IP over UART + ip = self.monitor[0].get_ip_address() + if not ip: + self.monitor[0].request_ip_dhcp() + ip = self.monitor[0].get_ip_address() + if not ip: + raise ne.NetworkNotFunctional + if ip != self.net.dutip: + log.info("DUT IP changed to: " + str(ip)) + self.net.dutip = ip + self.driver.uri = "ip:" + ip + # Update config file + self.help.update_yaml( + self.configfilename, "network-config", "dutip", ip, self.board_name + ) + + log.info("Update board over usb-sd-mux") + self.usbsdmux.update_boot_files_from_external( + bootbin_loc=bootbinpath, + kernel_loc=uimagepath, + devicetree_loc=devtreepath, + ) + # if devtreepath: + # self.usbsdmux.update_devicetree_for_mux(devtreepath) + self.usbsdmux.set_mux_mode("dut") + # powercycle board + log.info("Power cycling to boot") + self.power_cycle_to_boot() + + except Exception as e: + log.error("Updating boot files using usbsdmux failed to complete") + raise e + + # Check is networking is working + self.network_check() + + print("Home sweet home") + self.monitor[0].stop_log() + def board_reboot(self): # Try to reboot over SSH first try: @@ -641,37 +742,53 @@ def board_reboot_auto_folder( if jtag_mode: self.board_reboot_jtag_uart( system_top_bit_path=bit, - bootbinpath=bootbin, - uimagepath=kernel, - devtreepath=dt, - ) - if not recover: - self.board_reboot_uart_net_pdu( - system_top_bit_path=bit, - bootbinpath=bootbin, uimagepath=kernel, devtreepath=dt, ) else: - self.recover_board( + self.board_reboot_auto( system_top_bit_path=bit, bootbinpath=bootbin, uimagepath=kernel, devtreepath=dt, sdcard=sdcard, + recover=True, ) def board_reboot_auto( - self, system_top_bit_path, bootbinpath, uimagepath, devtreepath, recover=False + self, + system_top_bit_path, + bootbinpath, + uimagepath, + devtreepath, + sdcard=False, + recover=False, ): """Automatically select loading mechanism based on current class setup""" - self.board_reboot_uart_net_pdu( - system_top_bit_path=system_top_bit_path, - bootbinpath=bootbinpath, - uimagepath=uimagepath, - devtreepath=devtreepath, - ) + if recover: + self.recover_board( + system_top_bit_path=system_top_bit_path, + bootbinpath=bootbinpath, + uimagepath=uimagepath, + devtreepath=devtreepath, + sdcard=sdcard, + ) + else: + if self.usbsdmux: + self.board_reboot_sdmux_pdu( + system_top_bit_path=system_top_bit_path, + bootbinpath=bootbinpath, + uimagepath=uimagepath, + devtreepath=devtreepath, + ) + else: + self.board_reboot_uart_net_pdu( + system_top_bit_path=system_top_bit_path, + bootbinpath=bootbinpath, + uimagepath=uimagepath, + devtreepath=devtreepath, + ) def shutdown_powerdown_board(self): self.monitor[0].print_to_console = False diff --git a/nebula/resources/template_gen.yaml b/nebula/resources/template_gen.yaml index a6a31693..a79abb3b 100644 --- a/nebula/resources/template_gen.yaml +++ b/nebula/resources/template_gen.yaml @@ -253,3 +253,15 @@ netbox-config: help: "Token for netbox rest api access" optional: True netbox_field: devices.config_context.netbox_api_token +usbmux-config: + field_1: + name: search_path + help: "Path to search for usbmux devices" + default: "/dev/usb-sd-mux/" + optional: True + field_2: + name: target_mux + help: "Unique serial number of attached usbmux" + default: none + optional: True + netbox_field: devices.sd.serial diff --git a/nebula/tasks.py b/nebula/tasks.py index 3c98cb4f..e21ed15a 100644 --- a/nebula/tasks.py +++ b/nebula/tasks.py @@ -799,6 +799,7 @@ def recovery_device_manager( bootbinpath=bootbinpath, uimagepath=uimagepath, devtreepath=devtreepath, + sdcard=sdcard, recover=True, ) else: diff --git a/tests/bootfiles/zynq-zc706-adv7511-ad9361-fmcomms5/BOOT.BIN b/tests/bootfiles/zynq-zc706-adv7511-ad9361-fmcomms5/BOOT.BIN new file mode 100644 index 00000000..1e871f54 Binary files /dev/null and b/tests/bootfiles/zynq-zc706-adv7511-ad9361-fmcomms5/BOOT.BIN differ diff --git a/tests/bootfiles/zynq-zc706-adv7511-ad9361-fmcomms5/bootgen_sysfiles.tgz b/tests/bootfiles/zynq-zc706-adv7511-ad9361-fmcomms5/bootgen_sysfiles.tgz new file mode 100644 index 00000000..3f4aaf04 Binary files /dev/null and b/tests/bootfiles/zynq-zc706-adv7511-ad9361-fmcomms5/bootgen_sysfiles.tgz differ diff --git a/tests/bootfiles/zynq-zc706-adv7511-ad9361-fmcomms5/devicetree.dtb b/tests/bootfiles/zynq-zc706-adv7511-ad9361-fmcomms5/devicetree.dtb new file mode 100644 index 00000000..50a6132e Binary files /dev/null and b/tests/bootfiles/zynq-zc706-adv7511-ad9361-fmcomms5/devicetree.dtb differ diff --git a/tests/bootfiles/zynq-zc706-adv7511-ad9361-fmcomms5/fsbl.elf b/tests/bootfiles/zynq-zc706-adv7511-ad9361-fmcomms5/fsbl.elf new file mode 100755 index 00000000..ff16f7a4 Binary files /dev/null and b/tests/bootfiles/zynq-zc706-adv7511-ad9361-fmcomms5/fsbl.elf differ diff --git a/tests/bootfiles/zynq-zc706-adv7511-ad9361-fmcomms5/properties.yaml b/tests/bootfiles/zynq-zc706-adv7511-ad9361-fmcomms5/properties.yaml new file mode 100644 index 00000000..7c994299 --- /dev/null +++ b/tests/bootfiles/zynq-zc706-adv7511-ad9361-fmcomms5/properties.yaml @@ -0,0 +1,3 @@ +bootpartition_folder: 2023_05_15-20_45_13 +hdl_git_sha: d0336c0f6 +linux_git_sha: 255f8a9b983b diff --git a/tests/bootfiles/zynq-zc706-adv7511-ad9361-fmcomms5/system_top.bit b/tests/bootfiles/zynq-zc706-adv7511-ad9361-fmcomms5/system_top.bit new file mode 100644 index 00000000..2e85aea9 Binary files /dev/null and b/tests/bootfiles/zynq-zc706-adv7511-ad9361-fmcomms5/system_top.bit differ diff --git a/tests/bootfiles/zynq-zc706-adv7511-ad9361-fmcomms5/system_top.xsa b/tests/bootfiles/zynq-zc706-adv7511-ad9361-fmcomms5/system_top.xsa new file mode 100644 index 00000000..93f96bf4 Binary files /dev/null and b/tests/bootfiles/zynq-zc706-adv7511-ad9361-fmcomms5/system_top.xsa differ diff --git a/tests/bootfiles/zynq-zc706-adv7511-ad9361-fmcomms5/u-boot_zynq_zc706.elf b/tests/bootfiles/zynq-zc706-adv7511-ad9361-fmcomms5/u-boot_zynq_zc706.elf new file mode 100644 index 00000000..980e67e3 Binary files /dev/null and b/tests/bootfiles/zynq-zc706-adv7511-ad9361-fmcomms5/u-boot_zynq_zc706.elf differ diff --git a/tests/bootfiles/zynq-zc706-adv7511-ad9361-fmcomms5/uImage b/tests/bootfiles/zynq-zc706-adv7511-ad9361-fmcomms5/uImage new file mode 100644 index 00000000..22021148 Binary files /dev/null and b/tests/bootfiles/zynq-zc706-adv7511-ad9361-fmcomms5/uImage differ diff --git a/tests/bootfiles/zynq-zc706-adv7511-ad9361-fmcomms5/zynq.bif b/tests/bootfiles/zynq-zc706-adv7511-ad9361-fmcomms5/zynq.bif new file mode 100644 index 00000000..d2216882 --- /dev/null +++ b/tests/bootfiles/zynq-zc706-adv7511-ad9361-fmcomms5/zynq.bif @@ -0,0 +1,6 @@ +the_ROM_image: +{ +[bootloader] ./fsbl.elf +./system_top.bit +./u-boot_zynq_zc706.elf +} diff --git a/tests/bootfiles/zynqmp-adrv9009-zu11eg-revb-adrv2crr-fmc-revb/BOOT.BIN b/tests/bootfiles/zynqmp-adrv9009-zu11eg-revb-adrv2crr-fmc-revb/BOOT.BIN new file mode 100644 index 00000000..3a8e96f6 Binary files /dev/null and b/tests/bootfiles/zynqmp-adrv9009-zu11eg-revb-adrv2crr-fmc-revb/BOOT.BIN differ diff --git a/tests/bootfiles/zynqmp-adrv9009-zu11eg-revb-adrv2crr-fmc-revb/Image b/tests/bootfiles/zynqmp-adrv9009-zu11eg-revb-adrv2crr-fmc-revb/Image new file mode 100644 index 00000000..3268bda0 Binary files /dev/null and b/tests/bootfiles/zynqmp-adrv9009-zu11eg-revb-adrv2crr-fmc-revb/Image differ diff --git a/tests/bootfiles/zynqmp-adrv9009-zu11eg-revb-adrv2crr-fmc-revb/bl31.elf b/tests/bootfiles/zynqmp-adrv9009-zu11eg-revb-adrv2crr-fmc-revb/bl31.elf new file mode 100644 index 00000000..f8398416 Binary files /dev/null and b/tests/bootfiles/zynqmp-adrv9009-zu11eg-revb-adrv2crr-fmc-revb/bl31.elf differ diff --git a/tests/bootfiles/zynqmp-adrv9009-zu11eg-revb-adrv2crr-fmc-revb/fsbl.elf b/tests/bootfiles/zynqmp-adrv9009-zu11eg-revb-adrv2crr-fmc-revb/fsbl.elf new file mode 100644 index 00000000..db3a1dba Binary files /dev/null and b/tests/bootfiles/zynqmp-adrv9009-zu11eg-revb-adrv2crr-fmc-revb/fsbl.elf differ diff --git a/tests/bootfiles/zynqmp-adrv9009-zu11eg-revb-adrv2crr-fmc-revb/pmufw.elf b/tests/bootfiles/zynqmp-adrv9009-zu11eg-revb-adrv2crr-fmc-revb/pmufw.elf new file mode 100755 index 00000000..2c4385a7 Binary files /dev/null and b/tests/bootfiles/zynqmp-adrv9009-zu11eg-revb-adrv2crr-fmc-revb/pmufw.elf differ diff --git a/tests/bootfiles/zynqmp-adrv9009-zu11eg-revb-adrv2crr-fmc-revb/properties.yaml b/tests/bootfiles/zynqmp-adrv9009-zu11eg-revb-adrv2crr-fmc-revb/properties.yaml new file mode 100644 index 00000000..c4d005f7 --- /dev/null +++ b/tests/bootfiles/zynqmp-adrv9009-zu11eg-revb-adrv2crr-fmc-revb/properties.yaml @@ -0,0 +1,3 @@ +bootpartition_folder: 2023_08_17-07_43_49 +hdl_git_sha: e42877d33 +linux_git_sha: 08d579d732d4 diff --git a/tests/bootfiles/zynqmp-adrv9009-zu11eg-revb-adrv2crr-fmc-revb/system.dtb b/tests/bootfiles/zynqmp-adrv9009-zu11eg-revb-adrv2crr-fmc-revb/system.dtb new file mode 100644 index 00000000..f15e4964 Binary files /dev/null and b/tests/bootfiles/zynqmp-adrv9009-zu11eg-revb-adrv2crr-fmc-revb/system.dtb differ diff --git a/tests/bootfiles/zynqmp-adrv9009-zu11eg-revb-adrv2crr-fmc-revb/system_top.bit b/tests/bootfiles/zynqmp-adrv9009-zu11eg-revb-adrv2crr-fmc-revb/system_top.bit new file mode 100644 index 00000000..792f9382 Binary files /dev/null and b/tests/bootfiles/zynqmp-adrv9009-zu11eg-revb-adrv2crr-fmc-revb/system_top.bit differ diff --git a/tests/bootfiles/zynqmp-adrv9009-zu11eg-revb-adrv2crr-fmc-revb/system_top.xsa b/tests/bootfiles/zynqmp-adrv9009-zu11eg-revb-adrv2crr-fmc-revb/system_top.xsa new file mode 100644 index 00000000..5bb67a0a Binary files /dev/null and b/tests/bootfiles/zynqmp-adrv9009-zu11eg-revb-adrv2crr-fmc-revb/system_top.xsa differ diff --git a/tests/bootfiles/zynqmp-adrv9009-zu11eg-revb-adrv2crr-fmc-revb/u-boot_adi_zynqmp_adrv9009_zu11eg_adrv2crr_fmc.elf b/tests/bootfiles/zynqmp-adrv9009-zu11eg-revb-adrv2crr-fmc-revb/u-boot_adi_zynqmp_adrv9009_zu11eg_adrv2crr_fmc.elf new file mode 100644 index 00000000..f6b352e2 Binary files /dev/null and b/tests/bootfiles/zynqmp-adrv9009-zu11eg-revb-adrv2crr-fmc-revb/u-boot_adi_zynqmp_adrv9009_zu11eg_adrv2crr_fmc.elf differ diff --git a/tests/bootfiles/zynqmp-adrv9009-zu11eg-revb-adrv2crr-fmc-revb/zynqmp.bif b/tests/bootfiles/zynqmp-adrv9009-zu11eg-revb-adrv2crr-fmc-revb/zynqmp.bif new file mode 100644 index 00000000..e691338d --- /dev/null +++ b/tests/bootfiles/zynqmp-adrv9009-zu11eg-revb-adrv2crr-fmc-revb/zynqmp.bif @@ -0,0 +1,8 @@ +the_ROM_image: +{ +[pmufw_image] ./pmufw.elf +[bootloader,destination_cpu=a53-0] ./fsbl.elf +[destination_device=pl] ./system_top.bit +[destination_cpu=a53-0,exception_level=el-3,trustzone] ./bl31.elf +[destination_cpu=a53-0,exception_level=el-2] ./u-boot_adi_zynqmp_adrv9009_zu11eg_adrv2crr_fmc.elf +} diff --git a/tests/bootfiles/zynqmp-zcu102-rev10-adrv9002-vcmos/BOOT.BIN b/tests/bootfiles/zynqmp-zcu102-rev10-adrv9002-vcmos/BOOT.BIN new file mode 100644 index 00000000..4076b647 Binary files /dev/null and b/tests/bootfiles/zynqmp-zcu102-rev10-adrv9002-vcmos/BOOT.BIN differ diff --git a/tests/bootfiles/zynqmp-zcu102-rev10-adrv9002-vcmos/Image b/tests/bootfiles/zynqmp-zcu102-rev10-adrv9002-vcmos/Image new file mode 100644 index 00000000..3268bda0 Binary files /dev/null and b/tests/bootfiles/zynqmp-zcu102-rev10-adrv9002-vcmos/Image differ diff --git a/tests/bootfiles/zynqmp-zcu102-rev10-adrv9002-vcmos/bl31.elf b/tests/bootfiles/zynqmp-zcu102-rev10-adrv9002-vcmos/bl31.elf new file mode 100644 index 00000000..f8398416 Binary files /dev/null and b/tests/bootfiles/zynqmp-zcu102-rev10-adrv9002-vcmos/bl31.elf differ diff --git a/tests/bootfiles/zynqmp-zcu102-rev10-adrv9002-vcmos/fsbl.elf b/tests/bootfiles/zynqmp-zcu102-rev10-adrv9002-vcmos/fsbl.elf new file mode 100644 index 00000000..a008438f Binary files /dev/null and b/tests/bootfiles/zynqmp-zcu102-rev10-adrv9002-vcmos/fsbl.elf differ diff --git a/tests/bootfiles/zynqmp-zcu102-rev10-adrv9002-vcmos/pmufw.elf b/tests/bootfiles/zynqmp-zcu102-rev10-adrv9002-vcmos/pmufw.elf new file mode 100755 index 00000000..b50b141e Binary files /dev/null and b/tests/bootfiles/zynqmp-zcu102-rev10-adrv9002-vcmos/pmufw.elf differ diff --git a/tests/bootfiles/zynqmp-zcu102-rev10-adrv9002-vcmos/properties.yaml b/tests/bootfiles/zynqmp-zcu102-rev10-adrv9002-vcmos/properties.yaml new file mode 100644 index 00000000..c4d005f7 --- /dev/null +++ b/tests/bootfiles/zynqmp-zcu102-rev10-adrv9002-vcmos/properties.yaml @@ -0,0 +1,3 @@ +bootpartition_folder: 2023_08_17-07_43_49 +hdl_git_sha: e42877d33 +linux_git_sha: 08d579d732d4 diff --git a/tests/bootfiles/zynqmp-zcu102-rev10-adrv9002-vcmos/system.dtb b/tests/bootfiles/zynqmp-zcu102-rev10-adrv9002-vcmos/system.dtb new file mode 100644 index 00000000..c866be52 Binary files /dev/null and b/tests/bootfiles/zynqmp-zcu102-rev10-adrv9002-vcmos/system.dtb differ diff --git a/tests/bootfiles/zynqmp-zcu102-rev10-adrv9002-vcmos/system_top.bit b/tests/bootfiles/zynqmp-zcu102-rev10-adrv9002-vcmos/system_top.bit new file mode 100644 index 00000000..68807b5a Binary files /dev/null and b/tests/bootfiles/zynqmp-zcu102-rev10-adrv9002-vcmos/system_top.bit differ diff --git a/tests/bootfiles/zynqmp-zcu102-rev10-adrv9002-vcmos/system_top.xsa b/tests/bootfiles/zynqmp-zcu102-rev10-adrv9002-vcmos/system_top.xsa new file mode 100644 index 00000000..0cede6e4 Binary files /dev/null and b/tests/bootfiles/zynqmp-zcu102-rev10-adrv9002-vcmos/system_top.xsa differ diff --git a/tests/bootfiles/zynqmp-zcu102-rev10-adrv9002-vcmos/u-boot_xilinx_zynqmp_zcu102_revA.elf b/tests/bootfiles/zynqmp-zcu102-rev10-adrv9002-vcmos/u-boot_xilinx_zynqmp_zcu102_revA.elf new file mode 100644 index 00000000..0bf95aa5 Binary files /dev/null and b/tests/bootfiles/zynqmp-zcu102-rev10-adrv9002-vcmos/u-boot_xilinx_zynqmp_zcu102_revA.elf differ diff --git a/tests/bootfiles/zynqmp-zcu102-rev10-adrv9002-vcmos/zynqmp.bif b/tests/bootfiles/zynqmp-zcu102-rev10-adrv9002-vcmos/zynqmp.bif new file mode 100644 index 00000000..2210dbf5 --- /dev/null +++ b/tests/bootfiles/zynqmp-zcu102-rev10-adrv9002-vcmos/zynqmp.bif @@ -0,0 +1,8 @@ +the_ROM_image: +{ +[pmufw_image] ./pmufw.elf +[bootloader,destination_cpu=a53-0] ./fsbl.elf +[destination_device=pl] ./system_top.bit +[destination_cpu=a53-0,exception_level=el-3,trustzone] ./bl31.elf +[destination_cpu=a53-0,exception_level=el-2] ./u-boot_xilinx_zynqmp_zcu102_revA.elf +} diff --git a/tests/conftest.py b/tests/conftest.py index 462497b5..ca351a88 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -33,3 +33,13 @@ def power_off_dut(config, board): ) p.power_down_board() yield + + +@pytest.fixture() +def power_on_dut(config, board): + p = pdu( + yamlfilename=config, + board_name=board, + ) + p.power_up_board() + yield diff --git a/tests/nebula_config/nebula-manager-jtag.yaml b/tests/nebula_config/nebula-manager-jtag.yaml new file mode 100644 index 00000000..8f1dcdc3 --- /dev/null +++ b/tests/nebula_config/nebula-manager-jtag.yaml @@ -0,0 +1,135 @@ +zynq-zc706-adv7511-ad9361-fmcomms5: + board-config: + - board-name: zynq-zc706-adv7511-ad9361-fmcomms5 + - carrier: ZC706 + - daughter: FMCOMMS5 + - monitoring-interface: uart + - allow-jtag: True + downloader-config: + - reference_boot_folder: zynq-zc706-adv7511-ad9361-fmcomms5 + - hdl_folder: fmcomms5_zc706 + driver-config: + - iio_device_names: + - ad7291 + - ad9361-phy + - ad9361-phy-B + - cf-ad9361-dds-core-lpc + - cf-ad9361-dds-core-B + - cf-ad9361-A + - cf-ad9361-B + jtag-config: + - vivado_version: '2019.1' + - jtag_cable_id: 210251A077E0 + - jtag_cpu_target_name: ARM*#0 + netbox-config: + - netbox_server: 192.168.10.11 + - netbox_server_port: '8000' + - netbox_base_url: netbox + - netbox_api_token: 0123456789abcdef0123456789abcdef01234567 + network-config: + - dutip: 192.168.10.111 + - dhcp: False + - nic: eth0 + - nicip: 192.168.10.111 + pdu-config: + - pdu_type: cyberpower + - pduip: 192.168.10.23 + - outlet: '5' + - username: cyberpower + - password: cyberpower + uart-config: + - address: /dev/serial/by-path/pci-0000:00:14.0-usb-0:8.1.1:1.0-port0 + - baudrate: '115200' + - logfilename: zynq-zc706-adv7511-ad9361-fmcomms5.log +zynqmp-adrv9009-zu11eg-revb-adrv2crr-fmc-revb: + board-config: + - board-name: zynqmp-adrv9009-zu11eg-revb-adrv2crr-fmc-revb + - carrier: ADRV2CRR-FMC + - daughter: ADRV9009-ZU11EG + - monitoring-interface: uart + - allow-jtag: True + - serial: '' + - instr-serial: NA + downloader-config: + - reference_boot_folder: zynqmp-adrv9009-zu11eg-revb-adrv2crr-fmc-revb + - hdl_folder: adrv9009zu11eg_adrv2crr_fmc + driver-config: + - iio_device_names: + - ams + - hmc7044-car + - hmc7044-ext + - hmc7044 + - adrv9009-phy + - adrv9009-phy-b + - axi-adrv9009-rx-hpc + - axi-adrv9009-rx-obs-hpc + - axi-adrv9009-tx-hpc + jtag-config: + - vivado_version: '2019.1' + - jtag_cable_id: 210299B1A500 + - jtag_cpu_target_name: Cortex-A53*#0 + netbox-config: + - netbox_server: primary.englab + - netbox_server_port: '8000' + - netbox_base_url: netbox + - netbox_api_token: 0123456789abcdef0123456789abcdef01234567 + network-config: + - dutip: 192.168.10.115 + - dhcp: False + - nic: eth0 + - nicip: 192.168.10.115 + pdu-config: + - pdu_type: cyberpower + - pduip: 192.168.10.23 + - outlet: '7' + - username: cyber + - password: cyber + uart-config: + - address: /dev/serial/by-path/pci-0000:00:14.0-usb-0:2.2:1.0-port0 + - baudrate: '115200' + - logfilename: zynqmp-adrv9009-zu11eg-revb-adrv2crr-fmc-revb.log +zynqmp-zcu102-rev10-adrv9002-vcmos: + board-config: + - board-name: zynqmp-zcu102-rev10-adrv9002-vcmos + - carrier: ZCU102 + - daughter: ADRV9002-CMOS + - monitoring-interface: uart + - allow-jtag: True + downloader-config: + - reference_boot_folder: zynqmp-zcu102-rev10-adrv9002 + - devicetree_subfolder: zynqmp-zcu102-rev10-adrv9002 + - boot_subfolder: boot_bin_CMOS + - hdl_folder: adrv9001_zcu102 + driver-config: + - iio_device_names: + - adrv9002-phy + - axi-adrv9002-rx-lpc + - axi-adrv9002-rx2-lpc + - axi-core-tdd + - axi-core-tdd + - axi-adrv9002-tx-lpc + - axi-adrv9002-tx2-lpc + jtag-config: + - vivado_version: '2019.1' + - jtag_cable_id: 210308AE6A13 + - jtag_cpu_target_name: Cortex-A53*#0 + netbox-config: + - netbox_server: primary.englab + - netbox_server_port: '8000' + - netbox_base_url: netbox + - netbox_api_token: 0123456789abcdef0123456789abcdef01234567 + network-config: + - dutip: 192.168.10.112 + - dhcp: False + - nic: eth0 + - nicip: 192.168.10.112 + pdu-config: + - pdu_type: cyberpower + - pduip: 192.168.10.23 + - outlet: '6' + - username: cyber + - password: cyber + uart-config: + - address: /dev/serial/by-path/pci-0000:00:14.0-usb-0:8.3:1.0-port0 + - baudrate: 115200 + - logfilename: zynqmp-zcu102-rev10-adrv9002-vcmos.log diff --git a/tests/nebula_config/nebula-manager-usbmux.yml b/tests/nebula_config/nebula-manager-usbmux.yml new file mode 100644 index 00000000..8832d443 --- /dev/null +++ b/tests/nebula_config/nebula-manager-usbmux.yml @@ -0,0 +1,141 @@ +zynq-zc706-adv7511-ad9361-fmcomms5: + board-config: + - board-name: zynq-zc706-adv7511-ad9361-fmcomms5 + - carrier: ZC706 + - daughter: FMCOMMS5 + - monitoring-interface: uart + - allow-jtag: False + downloader-config: + - reference_boot_folder: zynq-zc706-adv7511-ad9361-fmcomms5 + - hdl_folder: fmcomms5_zc706 + driver-config: + - iio_device_names: + - ad7291 + - ad9361-phy + - ad9361-phy-B + - cf-ad9361-dds-core-lpc + - cf-ad9361-dds-core-B + - cf-ad9361-A + - cf-ad9361-B + jtag-config: + - vivado_version: '2019.1' + - jtag_cable_id: 210251A077E0 + - jtag_cpu_target_name: ARM*#0 + netbox-config: + - netbox_server: 192.168.10.11 + - netbox_server_port: '8000' + - netbox_base_url: netbox + - netbox_api_token: 0123456789abcdef0123456789abcdef01234567 + network-config: + - dutip: 192.168.10.111 + - dhcp: False + - nic: eth0 + - nicip: 192.168.10.111 + pdu-config: + - pdu_type: cyberpower + - pduip: 192.168.10.23 + - outlet: '5' + - username: cyberpower + - password: cyberpower + uart-config: + - address: /dev/serial/by-path/pci-0000:00:14.0-usb-0:8.1.1:1.0-port0 + - baudrate: '115200' + - logfilename: zynq-zc706-adv7511-ad9361-fmcomms5.log + usbmux-config: + - target_mux: id-000000001244 +zynqmp-adrv9009-zu11eg-revb-adrv2crr-fmc-revb: + board-config: + - board-name: zynqmp-adrv9009-zu11eg-revb-adrv2crr-fmc-revb + - carrier: ADRV2CRR-FMC + - daughter: ADRV9009-ZU11EG + - monitoring-interface: uart + - allow-jtag: False + - serial: '' + - instr-serial: NA + downloader-config: + - reference_boot_folder: zynqmp-adrv9009-zu11eg-revb-adrv2crr-fmc-revb + - hdl_folder: adrv9009zu11eg_adrv2crr_fmc + driver-config: + - iio_device_names: + - ams + - hmc7044-car + - hmc7044-ext + - hmc7044 + - adrv9009-phy + - adrv9009-phy-b + - axi-adrv9009-rx-hpc + - axi-adrv9009-rx-obs-hpc + - axi-adrv9009-tx-hpc + jtag-config: + - vivado_version: '2019.1' + - jtag_cable_id: 210299B1A500 + - jtag_cpu_target_name: Cortex-A53*#0 + netbox-config: + - netbox_server: primary.englab + - netbox_server_port: '8000' + - netbox_base_url: netbox + - netbox_api_token: 0123456789abcdef0123456789abcdef01234567 + network-config: + - dutip: 192.168.10.115 + - dhcp: False + - nic: eth0 + - nicip: 192.168.10.115 + pdu-config: + - pdu_type: cyberpower + - pduip: 192.168.10.23 + - outlet: '7' + - username: cyber + - password: cyber + uart-config: + - address: /dev/serial/by-path/pci-0000:00:14.0-usb-0:2.2:1.0-port0 + - baudrate: '115200' + - logfilename: zynqmp-adrv9009-zu11eg-revb-adrv2crr-fmc-revb.log + usbmux-config: + - target_mux: id-000000001249 +zynqmp-zcu102-rev10-adrv9002-vcmos: + board-config: + - board-name: zynqmp-zcu102-rev10-adrv9002-vcmos + - carrier: ZCU102 + - daughter: ADRV9002-CMOS + - monitoring-interface: uart + - allow-jtag: False + downloader-config: + - reference_boot_folder: zynqmp-zcu102-rev10-adrv9002 + - devicetree_subfolder: zynqmp-zcu102-rev10-adrv9002 + - boot_subfolder: boot_bin_CMOS + - hdl_folder: adrv9001_zcu102 + driver-config: + - iio_device_names: + - adrv9002-phy + - axi-adrv9002-rx-lpc + - axi-adrv9002-rx2-lpc + - axi-core-tdd + - axi-core-tdd + - axi-adrv9002-tx-lpc + - axi-adrv9002-tx2-lpc + jtag-config: + - vivado_version: '2019.1' + - jtag_cable_id: 210308AE6A13 + - jtag_cpu_target_name: Cortex-A53*#0 + netbox-config: + - netbox_server: primary.englab + - netbox_server_port: '8000' + - netbox_base_url: netbox + - netbox_api_token: 0123456789abcdef0123456789abcdef01234567 + network-config: + - dutip: 192.168.10.112 + - dhcp: False + - nic: eth0 + - nicip: 192.168.10.112 + pdu-config: + - pdu_type: cyberpower + - pduip: 192.168.10.23 + - outlet: '6' + - username: cyber + - password: cyber + uart-config: + - address: /dev/serial/by-path/pci-0000:00:14.0-usb-0:8.3:1.0-port0 + - baudrate: 115200 + - logfilename: zynqmp-zcu102-rev10-adrv9002-vcmos.log + usbmux-config: + - target_mux: id-000000001358 diff --git a/tests/nebula_config/nebula-manager.yml b/tests/nebula_config/nebula-manager.yml new file mode 100644 index 00000000..368d0570 --- /dev/null +++ b/tests/nebula_config/nebula-manager.yml @@ -0,0 +1,135 @@ +zynq-zc706-adv7511-ad9361-fmcomms5: + board-config: + - board-name: zynq-zc706-adv7511-ad9361-fmcomms5 + - carrier: ZC706 + - daughter: FMCOMMS5 + - monitoring-interface: uart + - allow-jtag: False + downloader-config: + - reference_boot_folder: zynq-zc706-adv7511-ad9361-fmcomms5 + - hdl_folder: fmcomms5_zc706 + driver-config: + - iio_device_names: + - ad7291 + - ad9361-phy + - ad9361-phy-B + - cf-ad9361-dds-core-lpc + - cf-ad9361-dds-core-B + - cf-ad9361-A + - cf-ad9361-B + jtag-config: + - vivado_version: '2019.1' + - jtag_cable_id: 210251A077E0 + - jtag_cpu_target_name: ARM*#0 + netbox-config: + - netbox_server: 192.168.10.11 + - netbox_server_port: '8000' + - netbox_base_url: netbox + - netbox_api_token: 0123456789abcdef0123456789abcdef01234567 + network-config: + - dutip: 192.168.10.111 + - dhcp: False + - nic: eth0 + - nicip: 192.168.10.111 + pdu-config: + - pdu_type: cyberpower + - pduip: 192.168.10.23 + - outlet: '5' + - username: cyberpower + - password: cyberpower + uart-config: + - address: /dev/serial/by-path/pci-0000:00:14.0-usb-0:8.1.1:1.0-port0 + - baudrate: '115200' + - logfilename: zynq-zc706-adv7511-ad9361-fmcomms5.log +zynqmp-adrv9009-zu11eg-revb-adrv2crr-fmc-revb: + board-config: + - board-name: zynqmp-adrv9009-zu11eg-revb-adrv2crr-fmc-revb + - carrier: ADRV2CRR-FMC + - daughter: ADRV9009-ZU11EG + - monitoring-interface: uart + - allow-jtag: False + - serial: '' + - instr-serial: NA + downloader-config: + - reference_boot_folder: zynqmp-adrv9009-zu11eg-revb-adrv2crr-fmc-revb + - hdl_folder: adrv9009zu11eg_adrv2crr_fmc + driver-config: + - iio_device_names: + - ams + - hmc7044-car + - hmc7044-ext + - hmc7044 + - adrv9009-phy + - adrv9009-phy-b + - axi-adrv9009-rx-hpc + - axi-adrv9009-rx-obs-hpc + - axi-adrv9009-tx-hpc + jtag-config: + - vivado_version: '2019.1' + - jtag_cable_id: 210299B1A500 + - jtag_cpu_target_name: Cortex-A53*#0 + netbox-config: + - netbox_server: primary.englab + - netbox_server_port: '8000' + - netbox_base_url: netbox + - netbox_api_token: 0123456789abcdef0123456789abcdef01234567 + network-config: + - dutip: 192.168.10.115 + - dhcp: False + - nic: eth0 + - nicip: 192.168.10.115 + pdu-config: + - pdu_type: cyberpower + - pduip: 192.168.10.23 + - outlet: '7' + - username: cyber + - password: cyber + uart-config: + - address: /dev/serial/by-path/pci-0000:00:14.0-usb-0:2.2:1.0-port0 + - baudrate: '115200' + - logfilename: zynqmp-adrv9009-zu11eg-revb-adrv2crr-fmc-revb.log +zynqmp-zcu102-rev10-adrv9002-vcmos: + board-config: + - board-name: zynqmp-zcu102-rev10-adrv9002-vcmos + - carrier: ZCU102 + - daughter: ADRV9002-CMOS + - monitoring-interface: uart + - allow-jtag: False + downloader-config: + - reference_boot_folder: zynqmp-zcu102-rev10-adrv9002 + - devicetree_subfolder: zynqmp-zcu102-rev10-adrv9002 + - boot_subfolder: boot_bin_CMOS + - hdl_folder: adrv9001_zcu102 + driver-config: + - iio_device_names: + - adrv9002-phy + - axi-adrv9002-rx-lpc + - axi-adrv9002-rx2-lpc + - axi-core-tdd + - axi-core-tdd + - axi-adrv9002-tx-lpc + - axi-adrv9002-tx2-lpc + jtag-config: + - vivado_version: '2019.1' + - jtag_cable_id: 210308AE6A13 + - jtag_cpu_target_name: Cortex-A53*#0 + netbox-config: + - netbox_server: primary.englab + - netbox_server_port: '8000' + - netbox_base_url: netbox + - netbox_api_token: 0123456789abcdef0123456789abcdef01234567 + network-config: + - dutip: 192.168.10.112 + - dhcp: False + - nic: eth0 + - nicip: 192.168.10.112 + pdu-config: + - pdu_type: cyberpower + - pduip: 192.168.10.23 + - outlet: '6' + - username: cyber + - password: cyber + uart-config: + - address: /dev/serial/by-path/pci-0000:00:14.0-usb-0:8.3:1.0-port0 + - baudrate: 115200 + - logfilename: zynqmp-zcu102-rev10-adrv9002-vcmos.log diff --git a/tests/test_manager.py b/tests/test_manager.py index e6ba0f6d..bf213bf5 100644 --- a/tests/test_manager.py +++ b/tests/test_manager.py @@ -3,11 +3,12 @@ import time import pytest -from nebula import manager +from nebula import helper, manager # @pytest.mark.skip(reason="Not fully implemented") # @pytest.mark.dependency() +@pytest.mark.hardware def test_board_reboot_uart_net_pdu(): # Get necessary boot files root = os.path.dirname(os.path.realpath(__file__)) @@ -31,5 +32,321 @@ def test_board_reboot_uart_net_pdu(): ) +@pytest.mark.hardware +@pytest.mark.parametrize( + "config", + [ + os.path.join( + os.path.dirname(__file__), "nebula_config", "nebula-manager-usbmux.yml" + ) + ], +) +@pytest.mark.parametrize( + "board", + [ + "zynq-zc706-adv7511-ad9361-fmcomms5", + "zynqmp-adrv9009-zu11eg-revb-adrv2crr-fmc-revb", + "zynqmp-zcu102-rev10-adrv9002-vcmos", + ], +) +def test_board_reboot_sdmux_pdu(power_on_dut, config, board): + + # Get necessary boot files + root = os.path.dirname(os.path.realpath(__file__)) + system_top_bit = "system_top.bit" + bootbin = "BOOT.BIN" + uimage = "uImage" + devtree = "devicetree.dtb" + + if "zynqmp" in board: + uimage = "Image" + devtree = "system.dtb" + + system_top_bit_path = f"{root}/bootfiles/{board}/" + system_top_bit + bootbinpath = f"{root}/bootfiles/{board}/" + bootbin + uimagepath = f"{root}/bootfiles/{board}/" + uimage + devtreepath = f"{root}/bootfiles/{board}/" + devtree + + assert os.path.isfile(system_top_bit_path) + assert os.path.isfile(bootbinpath) + assert os.path.isfile(uimagepath) + assert os.path.isfile(devtreepath) + + m = manager(configfilename=config, board_name=board) + m.net.check_board_booted() + + m.board_reboot_sdmux_pdu(system_top_bit_path, bootbinpath, uimagepath, devtreepath) + + +@pytest.mark.hardware +@pytest.mark.parametrize( + "config", + [ + os.path.join( + os.path.dirname(__file__), "nebula_config", "nebula-manager-usbmux.yml" + ) + ], +) +@pytest.mark.parametrize( + "board", + [ + "zynq-zc706-adv7511-ad9361-fmcomms5", + "zynqmp-adrv9009-zu11eg-revb-adrv2crr-fmc-revb", + "zynqmp-zcu102-rev10-adrv9002-vcmos", + ], +) +def test_recover_board_functional(power_on_dut, config, board): + + # Get necessary boot files + root = os.path.dirname(os.path.realpath(__file__)) + system_top_bit = "system_top.bit" + bootbin = "BOOT.BIN" + uimage = "uImage" + devtree = "devicetree.dtb" + fsbl = "fsbl.elf" + uboot = "u-boot_zynq.elf" + + if "zc706" in board: + uboot = "u-boot_zynq_zc706.elf" + elif "zu11eg" in board: + uboot = "u-boot_adi_zynqmp_adrv9009_zu11eg_adrv2crr_fmc.elf" + elif "zcu102" in board: + uboot = "u-boot_xilinx_zynqmp_zcu102_revA.elf" + + if "zynqmp" in board: + uimage = "Image" + devtree = "system.dtb" + + system_top_bit_path = f"{root}/bootfiles/{board}/" + system_top_bit + bootbinpath = f"{root}/bootfiles/{board}/" + bootbin + uimagepath = f"{root}/bootfiles/{board}/" + uimage + devtreepath = f"{root}/bootfiles/{board}/" + devtree + fsblpath = f"{root}/bootfiles/{board}/" + fsbl + ubootpath = f"{root}/bootfiles/{board}/" + uboot + + assert os.path.isfile(system_top_bit_path) + assert os.path.isfile(bootbinpath) + assert os.path.isfile(uimagepath) + assert os.path.isfile(devtreepath) + assert os.path.isfile(fsblpath) + assert os.path.isfile(ubootpath) + + m = manager(configfilename=config, board_name=board) + m.net.check_board_booted() + + # recover via usb-sd-mux + m.recover_board( + system_top_bit_path, bootbinpath, uimagepath, devtreepath, fsblpath, ubootpath + ) + + +@pytest.mark.hardware +@pytest.mark.parametrize( + "config", + [ + os.path.join( + os.path.dirname(__file__), "nebula_config", "nebula-manager-usbmux.yml" + ) + ], +) +@pytest.mark.parametrize( + "board", + [ + "zynq-zc706-adv7511-ad9361-fmcomms5", + "zynqmp-adrv9009-zu11eg-revb-adrv2crr-fmc-revb", + "zynqmp-zcu102-rev10-adrv9002-vcmos", + ], +) +def test_recover_board_usbsdmux(power_on_dut, config, board): + + # Get necessary boot files + root = os.path.dirname(os.path.realpath(__file__)) + system_top_bit = "system_top.bit" + bootbin = "BOOT.BIN" + uimage = "uImage" + devtree = "devicetree.dtb" + fsbl = "fsbl.elf" + uboot = "u-boot_zynq.elf" + + if "zc706" in board: + uboot = "u-boot_zynq_zc706.elf" + elif "zu11eg" in board: + uboot = "u-boot_adi_zynqmp_adrv9009_zu11eg_adrv2crr_fmc.elf" + elif "zcu102" in board: + uboot = "u-boot_xilinx_zynqmp_zcu102_revA.elf" + + if "zynqmp" in board: + uimage = "Image" + devtree = "system.dtb" + + system_top_bit_path = f"{root}/bootfiles/{board}/" + system_top_bit + bootbinpath = f"{root}/bootfiles/{board}/" + bootbin + uimagepath = f"{root}/bootfiles/{board}/" + uimage + devtreepath = f"{root}/bootfiles/{board}/" + devtree + fsblpath = f"{root}/bootfiles/{board}/" + fsbl + ubootpath = f"{root}/bootfiles/{board}/" + uboot + + assert os.path.isfile(system_top_bit_path) + assert os.path.isfile(bootbinpath) + assert os.path.isfile(uimagepath) + assert os.path.isfile(devtreepath) + assert os.path.isfile(fsblpath) + assert os.path.isfile(ubootpath) + + m = manager(configfilename=config, board_name=board) + m.net.check_board_booted() + + # purposely fail dut + m.net.run_ssh_command(f"rm /boot/{uimage}") + m.power.power_cycle_board() + + # recover via usb-sd-mux + m.recover_board( + system_top_bit_path, bootbinpath, uimagepath, devtreepath, fsblpath, ubootpath + ) + + +@pytest.mark.hardware +@pytest.mark.parametrize( + "config", + [os.path.join(os.path.dirname(__file__), "nebula_config", "nebula-manager.yml")], +) +@pytest.mark.parametrize( + "board", + [ + "zynq-zc706-adv7511-ad9361-fmcomms5", + "zynqmp-adrv9009-zu11eg-revb-adrv2crr-fmc-revb", + "zynqmp-zcu102-rev10-adrv9002-vcmos", + ], +) +def test_recover_board_uart(power_on_dut, config, board): + + # Get necessary boot files + root = os.path.dirname(os.path.realpath(__file__)) + system_top_bit = "system_top.bit" + bootbin = "BOOT.BIN" + uimage = "uImage" + devtree = "devicetree.dtb" + fsbl = "fsbl.elf" + uboot = "u-boot_zynq.elf" + + if "zc706" in board: + uboot = "u-boot_zynq_zc706.elf" + elif "zu11eg" in board: + uboot = "u-boot_adi_zynqmp_adrv9009_zu11eg_adrv2crr_fmc.elf" + elif "zcu102" in board: + uboot = "u-boot_xilinx_zynqmp_zcu102_revA.elf" + + if "zynqmp" in board: + uimage = "Image" + devtree = "system.dtb" + + system_top_bit_path = f"{root}/bootfiles/{board}/" + system_top_bit + bootbinpath = f"{root}/bootfiles/{board}/" + bootbin + uimagepath = f"{root}/bootfiles/{board}/" + uimage + devtreepath = f"{root}/bootfiles/{board}/" + devtree + fsblpath = f"{root}/bootfiles/{board}/" + fsbl + ubootpath = f"{root}/bootfiles/{board}/" + uboot + + assert os.path.isfile(system_top_bit_path) + assert os.path.isfile(bootbinpath) + assert os.path.isfile(uimagepath) + assert os.path.isfile(devtreepath) + assert os.path.isfile(fsblpath) + assert os.path.isfile(ubootpath) + + m = manager(configfilename=config, board_name=board) + m.net.check_board_booted() + + # purposely fail dut + m.net.run_ssh_command(f"rm /boot/{uimage}") + m.net.run_ssh_command(f"rm /boot/{devtree}") + m.power.power_cycle_board() + + # recover via uart + m.recover_board( + system_top_bit_path, + bootbinpath, + uimagepath, + devtreepath, + fsblpath, + ubootpath, + ) + + +# @pytest.mark.skip(reason="Not fully implemented") +@pytest.mark.hardware +@pytest.mark.parametrize( + "config", + [ + os.path.join( + os.path.dirname(__file__), "nebula_config", "nebula-manager-jtag.yml" + ) + ], +) +@pytest.mark.parametrize( + "board", + [ + "zynq-zc706-adv7511-ad9361-fmcomms5", + "zynqmp-adrv9009-zu11eg-revb-adrv2crr-fmc-revb", + "zynqmp-zcu102-rev10-adrv9002-vcmos", + ], +) +def test_recover_board_jtag(power_on_dut, config, board): + + # Get necessary boot files + root = os.path.dirname(os.path.realpath(__file__)) + system_top_bit = "system_top.bit" + bootbin = "BOOT.BIN" + uimage = "uImage" + devtree = "devicetree.dtb" + fsbl = "fsbl.elf" + uboot = "u-boot_zynq.elf" + + if "zc706" in board: + uboot = "u-boot_zynq_zc706.elf" + elif "zu11eg" in board: + uboot = "u-boot_adi_zynqmp_adrv9009_zu11eg_adrv2crr_fmc.elf" + elif "zcu102" in board: + uboot = "u-boot_xilinx_zynqmp_zcu102_revA.elf" + + if "zynqmp" in board: + uimage = "Image" + devtree = "system.dtb" + + system_top_bit_path = f"{root}/bootfiles/{board}/" + system_top_bit + bootbinpath = f"{root}/bootfiles/{board}/" + bootbin + uimagepath = f"{root}/bootfiles/{board}/" + uimage + devtreepath = f"{root}/bootfiles/{board}/" + devtree + fsblpath = f"{root}/bootfiles/{board}/" + fsbl + ubootpath = f"{root}/bootfiles/{board}/" + uboot + + assert os.path.isfile(system_top_bit_path) + assert os.path.isfile(bootbinpath) + assert os.path.isfile(uimagepath) + assert os.path.isfile(devtreepath) + assert os.path.isfile(fsblpath) + assert os.path.isfile(ubootpath) + m = manager(configfilename=config, board_name=board) + m.net.check_board_booted() + + # purposely fail dut + # purposely fail dut + m.net.run_ssh_command(f"rm /boot/{uimage}") + m.net.run_ssh_command(f"rm /boot/{devtree}") + m.net.run_ssh_command(f"rm /boot/{bootbin}") + m.power.power_cycle_board() + + # recover via uart + m.recover_board( + system_top_bit_path, + bootbinpath, + uimagepath, + devtreepath, + fsblpath, + ubootpath, + ) + + if __name__ == "__main__": test_board_reboot_uart_net_pdu()