diff options
author | Radu Bacrau <radu.bacrau@intel.com> | 2020-12-15 11:06:58 -0600 |
---|---|---|
committer | Radu Bacrau <radu.bacrau@intel.com> | 2020-12-15 11:06:58 -0600 |
commit | f8fa401f6a29d7ee7344cd2d1dbc98e5c6ca86d4 (patch) | |
tree | 4c5df9df040def01eeb3c2a148267a5e1a7f6b47 /arch | |
parent | 8668e7a2ebf9ae763b633ce75a87bd0e6b09a606 (diff) | |
download | u-boot-socfpga-f8fa401f6a29d7ee7344cd2d1dbc98e5c6ca86d4.tar.gz |
HSD #14013140082: rsu: reload cpb after restoring sptrel_socfpga_v2020.10_RC_20.12.03_prrel_socfpga_v2020.10_RC_20.12.02_pr
Whenever SPT is corrupted, CPB is also automatically considered corrupted.
Added code to try reloading CPB after restoring SPT. Reloading the CPB
includes validation of data, and recovery of a corrupted CPB in case one
copy is corrupted and one is valid.
RSU = Remote System Update
CPB = Configuration Pointer Block
SPT = Sub Partition Table
Signed-off-by: Radu Bacrau <radu.bacrau@intel.com>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/mach-socfpga/rsu_ll_qspi.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/arch/arm/mach-socfpga/rsu_ll_qspi.c b/arch/arm/mach-socfpga/rsu_ll_qspi.c index 4e13e69fc4..4d5a9abe74 100644 --- a/arch/arm/mach-socfpga/rsu_ll_qspi.c +++ b/arch/arm/mach-socfpga/rsu_ll_qspi.c @@ -121,6 +121,8 @@ static int cpb1_part = -1; static bool cpb_corrupted; static bool spt_corrupted; +static int load_cpb(void); + /** * get_part_offset() - get a selected partition offset * @part_num: the selected partition number @@ -448,6 +450,12 @@ static int restore_spt_from_address(u64 address) } spt_corrupted = false; + + /* try to reload CPB, as we have a new SPT */ + cpb_corrupted = false; + if (load_cpb() && !cpb_corrupted) + rsu_log(RSU_ERR, "Bad CPB\n"); + return 0; } |