Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SD Card Mux support #100

Merged
merged 6 commits into from
Oct 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
100 changes: 100 additions & 0 deletions doc/manager_recovery.pu
Original file line number Diff line number Diff line change
@@ -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
8 changes: 7 additions & 1 deletion nebula/errors.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
14 changes: 9 additions & 5 deletions nebula/jtag.py
Original file line number Diff line number Diff line change
Expand Up @@ -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; "
Expand All @@ -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)

Expand Down
Loading
Loading