summaryrefslogtreecommitdiffstats
path: root/static
Commit message (Collapse)AuthorAgeFilesLines
* Fix ECC usage of being cleaned partitionsAlexander Filippov2019-12-201-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Reset procedure of PNOR works improperly for our P8 based VESNIN hardware and makes the host unbootable. The problem is in incorrect partition cleaning. Hostboot for P8 has no support for CLEARECC bit and PNOR flash has no partitions with flag 'C'. P9 based hardware is not affected until PNOR has partitions with ECC flag only. This commit modifies the reset procedure to make it use the flag 'E' (ECC) instead of 'C' (CLEARECC). * The flag 'E' means that the partition requires ECC. * The flag 'C' means that the partition might be cleaned by hostboot when ECC is wrong. For details see: https://github.com/open-power/hostboot/blob/75c0908b91275dc10bd17cb0f10b452f32ce0b91/src/include/usr/pnor/pnor_const.H#L128 Tested: All PNOR partitions with enabled flags 'E' and 'F' should be cleaned with ECC. Change-Id: I632e90c8e256df3445fc3d1f45c830d155a1d208 Signed-off-by: Alexander Filippov <a.filippov@yadro.com>
* Static layout: support image verificationLei YU2019-04-042-23/+39
| | | | | | | | | | | Add support of image verification for static layout PNOR code update. Tested: Verify the PNOR code update succeeds with valid-signed PNOR; and fails with invalid-signed PNOR or a PNOR tarball without signature. Change-Id: I1aafeb4e8e07eaa16c170f33f4f21940f7c9c146 Signed-off-by: Lei YU <mine260309@gmail.com>
* Refactor: Use hiomapd instead of mboxdLei YU2019-03-181-68/+5
| | | | | | | | | | | | | | mbox service is renamed to hiomapd and provides "Suspend" and "Resume" method calls, which is more appropriate for raw "cmd" calls. Use the new methods to suspend and resume hiomapd. Move "getService()" function into utils so it is shared by multiple files. Tested: Verify the reset works on Romulus Change-Id: I8f89de134b13126697bfc69a21a3148a01c34cca Signed-off-by: Lei YU <mine260309@gmail.com>
* test: Add test for getPartsToClearLei YU2019-03-131-4/+27
| | | | | | | | | | Add the test for getPartsToClear(), and fix issues found by the unit test case with malformed input. Tested: Verify test builds and passes. Change-Id: I67c8bbd184e7e0c0f7f0f0fca678d1952a07cd66 Signed-off-by: Lei YU <mine260309@gmail.com>
* test: Add sources of static PNORLei YU2019-03-132-2/+15
| | | | | | | | | | | | | | | | Add sources in static dir to test. It generates a link error about duplcated GardReset::reset(). Then an issue is found that GardReset::~GardReset() is not virtual, this will casuse the destructor not calling its super class' dtor. To fix the above link error, add GardReset[Ubi|Static] to make ubi/static specific implementation in its own class. Tested: Verify the test build works fine. Change-Id: I41bd4d522e8b9c4053283c0cf4373807ef4f2d1c Signed-off-by: Lei YU <mine260309@gmail.com>
* Static layout: Do not crash on empty PNORLei YU2019-03-131-1/+8
| | | | | | | | | | | | | | | | When PNOR is empty, or corrupted and it fails to retrieve the version, the service throws an exception. This is not good because it should run on a corrupted or empty PNOR, which then could be used to re-program the PNOR. This commit fixes the issue, by not throwing on the above case. Tested: Verify the service does not crash on a corrupted VERSION partition, and could be used to do code update to fix the corruption. Change-Id: Ic6a413a81ad13894a9c7f039df71fff9b9d4b2ad Signed-off-by: Lei YU <mine260309@gmail.com>
* Static layout: Do not update PNOR when host is onLei YU2019-03-133-8/+14
| | | | | | | | | | | | | | Static layout only has 1 active and functional PNOR. When host is running, do not update PNOR. This is done by checking the return value of freeSpace(), and if it returns false, it means there is no space for PNOR because the host is running and erase() returns false. Tested: Verify the status becomes Failed when trying to activate a PNOR while host is running. Change-Id: Ie2986b0c6fd29557685f67eb77ccc29709e1669a Signed-off-by: Lei YU <mine260309@gmail.com>
* Static layout: Use pflash to get partitions to clearLei YU2019-03-131-18/+39
| | | | | | | | | | | Use pflash -i to get partitions that should be cleared during factory reset, instead of hard-coded ones. Tested: From log verify the partitions with REPROVISION flag are cleared during factory reset. Change-Id: I5f1681d0c5092e89a4a964ce41991b116252b9dd Signed-off-by: Lei YU <mine260309@gmail.com>
* Static layout: Implement factory resetLei YU2019-03-131-10/+74
| | | | | | | | Tested: Verify the partitions hard-coded are cleared during factory reset. Change-Id: I70febe5f8245a299d4e2a782414662dbf09e84cb Signed-off-by: Lei YU <mine260309@gmail.com>
* Static layout: Implement gard resetLei YU2019-03-131-6/+69
| | | | | | | | | Use pflash to clear GUARD partition. Tested: Verify GUARD partition is cleared on gard reset. Change-Id: I54f77a30d728dc80aa40dfd58a17152b936a6a6d Signed-off-by: Lei YU <mine260309@gmail.com>
* Static layout: Implement PNOR code updateLei YU2019-03-134-1/+154
| | | | | | | | | | Implement the PNOR code update by pflash tool in openpower-pnor-update service, and update the related associations. Tested: Verify PNOR code update succeeds. Change-Id: I53781d6420071200ac2ed6837f7a79bf5e1162c2 Signed-off-by: Lei YU <mine260309@gmail.com>
* Static layout: Add dummy activation_staticLei YU2019-03-134-4/+80
| | | | | | | | | | Add ActivationStatic inherits Activation, which will be used to do PNOR code update for statis layout. Tested: Verify code compiles. Change-Id: I5d90c84b63797e37fa309caeb9b23035f3c76f9f Signed-off-by: Lei YU <mine260309@gmail.com>
* Static layout: Read PNOR VERSION using pflashLei YU2019-03-131-1/+146
| | | | | | | | | | | Use pflash to read VERSION partition to get the PNOR version Add code to parse pflash's VERSION partition string. Tested: Verify that the version and extended version are retrieved correctly on Romulus and Palmetto. Change-Id: Ia053c1683a5a969be0773d251cb88c4c5c9b6c60 Signed-off-by: Lei YU <mine260309@gmail.com>
* Static layout: Add dummy item_updaterLei YU2019-03-133-1/+138
| | | | | | | | | This commit only adds the functions without implementation. Tested: Verify the code compiles with or without static layout. Change-Id: Id57640b367f9594d07e6780d446479eb7ac06007 Signed-off-by: Lei YU <mine260309@gmail.com>
* Refactor: Split item_updater to common and ubiLei YU2019-03-071-0/+2
The existing item_updater is highly coupled with ubifs. It will support static layout and ubi in future. So split the functions in to common ones and ubi specific ones, and move the ubi specific code in ubi dir. 1. Keep common functions and make them virtual for extension. createActiveAssociation() updateFunctionalAssociation() removeAssociation() erase() 2. Create ubi/item_updater_ubi and move other functions into it. 3. Change updateFunctionalAssociation() parameter for future use. To support static layout, a new item_updater_static will be written. Tested: On the last commit of the patch series, run code update and factory reset on Witherspoon and all work fine. Change-Id: I4cc55b31ee3f37c5b27168611305dee8ce02880a Signed-off-by: Lei YU <mine260309@gmail.com>
OpenPOWER on IntegriCloud