summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLei YU <mine260309@gmail.com>2019-01-24 11:00:48 +0800
committerLei YU <mine260309@gmail.com>2019-01-24 11:24:49 +0800
commitae81da466084a2db45e41e06f01123f2f35002dc (patch)
tree241335a5cafca6fdf9411ce4c7d775802fdef8d6
parent17f55a823134a35b7847b2ae4077ae81f9c0cf79 (diff)
downloadopenpower-pnor-code-mgmt-ae81da466084a2db45e41e06f01123f2f35002dc.tar.gz
openpower-pnor-code-mgmt-ae81da466084a2db45e41e06f01123f2f35002dc.zip
Allow delete functional PNOR if only 1 PNOR is allowed
When a system only supports 1 PNOR (e.g. 64MiB chip), it shall define ACTIVE_PNOR_MAX_ALLOWED to 1. In this case, the PNOR code update shall delete the exising functional PNOR to free the space for the new PNOR, otherwise there will be not enough space for the new PNOR, and the code update will fail. So change the logic in freeSpace() to allow delete functional PNOR if ACTIVE_PNOR_MAX_ALLOWED is defined to 1. Tested: Enable openpower-ubi on Romulus and verify PNOR code update succeeds. Change-Id: Ib46c8a542d6baf02b60c3453686d7fe831468e6e Signed-off-by: Lei YU <mine260309@gmail.com>
-rw-r--r--item_updater.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/item_updater.cpp b/item_updater.cpp
index fcb7aca73..f920661a6 100644
--- a/item_updater.cpp
+++ b/item_updater.cpp
@@ -536,8 +536,10 @@ void ItemUpdater::freeSpace()
{
count++;
// Don't put the functional version on the queue since we can't
- // remove the "running" PNOR version.
- if (isVersionFunctional(iter.second->versionId))
+ // remove the "running" PNOR version if it allows multiple PNORs
+ // But removing functional version if there is only one PNOR.
+ if (ACTIVE_PNOR_MAX_ALLOWED > 1 &&
+ isVersionFunctional(iter.second->versionId))
{
continue;
}
OpenPOWER on IntegriCloud