64ec3e45 | 17-Jul-2017 |
Deepak Kodihalli <dkodihal@in.ibm.com> |
vpnor: rename APIs
To maintain consistency, rename vpnor_create_partition_table to init_vpnor and vpnor_destroy_partition_table to destroy_vpnor. Also move a bunch of vpnor specific string copy code
vpnor: rename APIs
To maintain consistency, rename vpnor_create_partition_table to init_vpnor and vpnor_destroy_partition_table to destroy_vpnor. Also move a bunch of vpnor specific string copy code from main() to init_vpnor().
Change-Id: Ia1b6598d4d308dd727916dc79be9b3b733f314f2 Signed-off-by: Deepak Kodihalli <dkodihal@in.ibm.com>
show more ...
|
aee73897 | 12-Jul-2017 |
Deepak Kodihalli <dkodihal@in.ibm.com> |
vpnor: correct offset alignment
With the current implementation of the virtual pnor, a window contains at most one partition, and a partition may be smaller than the window max size. An offset reque
vpnor: correct offset alignment
With the current implementation of the virtual pnor, a window contains at most one partition, and a partition may be smaller than the window max size. An offset requested by the host, which starts right after such a small partition ends, must result in a new window mapping (because said offset points to another partition).
Change-Id: I07fd51c6af2c8125891073bf10ceb1399a55dc92 Signed-off-by: Deepak Kodihalli <dkodihal@in.ibm.com>
show more ...
|
e8b0e8ac | 12-Jul-2017 |
Deepak Kodihalli <dkodihal@in.ibm.com> |
vpnor: add partition version check to the TOC
Change-Id: If5497476f03484334396e483e251b1e9434137f3 Signed-off-by: Deepak Kodihalli <dkodihal@in.ibm.com> |
b100fb8e | 12-Jul-2017 |
Deepak Kodihalli <dkodihal@in.ibm.com> |
vpnor copy_flash: remove incorrect size check
Remove a read window size check, which essentially mandated that a pnor partition is at least as large as the window size.
To elaborate, the current mb
vpnor copy_flash: remove incorrect size check
Remove a read window size check, which essentially mandated that a pnor partition is at least as large as the window size.
To elaborate, the current mbox implementation assumes a read window size of 1M. This is as per protocol; a host can even send a read size of 0, the BMC implementation is responsible for reading what's valid and fits in the window, and inform host about the size read. There was a check which would see that a read size of 1M past the requested flash offset is larger than an actual partition file size (for partitions < 1M), and would fail the read request. Instead, in such a case, read the entire partition and inform host about the size read.
Change-Id: I07d4b24d7eb31c5473c4142e96743d8f8d0e08a2 Signed-off-by: Deepak Kodihalli <dkodihal@in.ibm.com>
show more ...
|
7ee307c7 | 12-Jul-2017 |
Deepak Kodihalli <dkodihal@in.ibm.com> |
copy_flash: update window size
When a pnor partition is copied to a window, update the window size with the actual number of blocks copied. This is required in the response of the V2 Read Window Com
copy_flash: update window size
When a pnor partition is copied to a window, update the window size with the actual number of blocks copied. This is required in the response of the V2 Read Window Command.
Change-Id: I2c158df1bd261a4e62b9cbb2765e7623a7fb3dc9 Signed-off-by: Deepak Kodihalli <dkodihal@in.ibm.com>
show more ...
|
017e45c3 | 12-Jul-2017 |
Deepak Kodihalli <dkodihal@in.ibm.com> |
vpnor: create hostboot bootloader partition
The hostboot bootloader code doesn't use mbox.
It has specific requirements: - The PNOR TOC should be at the 'PNOR end - TOC size - page size' offset.
vpnor: create hostboot bootloader partition
The hostboot bootloader code doesn't use mbox.
It has specific requirements: - The PNOR TOC should be at the 'PNOR end - TOC size - page size' offset. It searches for the TOC here, if not found, the search moves down page by page. - The PNOR should be 64M. The page size and erase block should be 4K. The TOC should be 32K.
Copy what the bootloader expects to the LPC memory when mboxd starts up. The same needs to be done in the case of an mbox reset (irrespective of where the reset comes from).
Skiboot expects that the TOC should be at offset 0, but it uses mbox to read the TOC. So this commit doesn't impact skiboot requirements.
Change-Id: I7de556dccfea85f2faa5f401177006a3a562494e Signed-off-by: Deepak Kodihalli <dkodihal@in.ibm.com>
show more ...
|
8a89969d | 11-Jul-2017 |
Deepak Kodihalli <dkodihal@in.ibm.com> |
vpnor: add API to get partition entry by name
Change-Id: I1f86c646c6629a6a42788821e469d36f55c92264 Signed-off-by: Deepak Kodihalli <dkodihal@in.ibm.com> |
d1d7930d | 11-Jul-2017 |
Deepak Kodihalli <dkodihal@in.ibm.com> |
vpnor: make PNOR block size configurable
The vpnor code would assume a PNOR FFS block size of 4K. Make it possible to supply this value, since it needn't always be 4K.
Change-Id: I21463b05f1047e937
vpnor: make PNOR block size configurable
The vpnor code would assume a PNOR FFS block size of 4K. Make it possible to supply this value, since it needn't always be 4K.
Change-Id: I21463b05f1047e93705ba82d46f746056568dcc5 Signed-off-by: Deepak Kodihalli <dkodihal@in.ibm.com>
show more ...
|
abd52a78 | 13-Jul-2017 |
Deepak Kodihalli <dkodihal@in.ibm.com> |
vpnor: implement init_flash_dev
The vpnor version needs to set the erase block size as 4K. That's the size hostboot expects in the FFS structure.
This change also requires moving code from mboxd_fl
vpnor: implement init_flash_dev
The vpnor version needs to set the erase block size as 4K. That's the size hostboot expects in the FFS structure.
This change also requires moving code from mboxd_flash.c to mboxd_flash_physical.c, else there will be 3 symbols per flash function.
It should suffice to just have mboxd_flash_physical.c and mboxd_flash_virtual.cpp.
Change-Id: I35442a0c1dbee7f66b278cbf094be78e870b6c86 Signed-off-by: Deepak Kodihalli <dkodihal@in.ibm.com>
show more ...
|
96acf160 | 12-Jul-2017 |
Deepak Kodihalli <dkodihal@in.ibm.com> |
vpnor: fix partition file path passed to open()
Change-Id: I712699b6a5200115759eadc64a10d0b61b3d9d6f Signed-off-by: Deepak Kodihalli <dkodihal@in.ibm.com> |
b9cdcd2b | 12-Jul-2017 |
Deepak Kodihalli <dkodihal@in.ibm.com> |
vpnor partition table: fix checksums
Checksums in the host-endian partition table were being incorrectly computed. Fixed this problem.
The checksums in the host-endian (big-endian) partition table
vpnor partition table: fix checksums
Checksums in the host-endian partition table were being incorrectly computed. Fixed this problem.
The checksums in the host-endian (big-endian) partition table were being computed by just converting their little-endian checksum counterparts to big-endian. This won't work because one of the fields in the table is a string, which is stored the same irrespective of endian-ness. Hence the checksum must be re-computed for the host-endian partition tables.
Change-Id: I45f876b5eb536620a9b361ac47317df816481cc1 Signed-off-by: Deepak Kodihalli <dkodihal@in.ibm.com>
show more ...
|
2407f155 | 31-May-2017 |
Ratan Gupta <ratagupt@in.ibm.com> |
test: write the vpnor file(flash)
Add the test binary which runs the following test cases 1) Write to the read only partition 2) Write to the RW partition 3) Write to the preserved partition. 4) Wri
test: write the vpnor file(flash)
Add the test binary which runs the following test cases 1) Write to the read only partition 2) Write to the RW partition 3) Write to the preserved partition. 4) Write beyond the partition file length. 5) other boundary test cases.
Resolves openbmc/openbmc#1479
Change-Id: Ifd4f0e89e434a26e2579415a973fe1bfdbb3e66f Signed-off-by: Ratan Gupta <ratagupt@in.ibm.com>
show more ...
|
dc50ce5a | 31-May-2017 |
Ratan Gupta <ratagupt@in.ibm.com> |
Implement write flash function for vpnor
Opens the partition file from the vpnor, Memory map to it and then copy the given data from the reserved memory area to the vpnor.
Change-Id: I29f44482155d8
Implement write flash function for vpnor
Opens the partition file from the vpnor, Memory map to it and then copy the given data from the reserved memory area to the vpnor.
Change-Id: I29f44482155d890622221695deee255b222e9a49 Signed-off-by: Ratan Gupta <ratagupt@in.ibm.com>
show more ...
|
6a98e183 | 06-Jun-2017 |
Ratan Gupta <ratagupt@in.ibm.com> |
Read the partition file from the vpnor.
This fix reads the file from the partition, Memory map to it and then copy the asked memory area to the reserved memory area.
Change-Id: I4b2987e628bc4820edf
Read the partition file from the vpnor.
This fix reads the file from the partition, Memory map to it and then copy the asked memory area to the reserved memory area.
Change-Id: I4b2987e628bc4820edfeb1b0a81e5d1cbb8e7cf1 Signed-off-by: Ratan Gupta <ratagupt@in.ibm.com>
show more ...
|
c0ef9877 | 06-Jun-2017 |
Ratan Gupta <ratagupt@in.ibm.com> |
Read/write window property defines FFS partition file location.
The BMC loads the PNOR partitions in a read-only volume.
So after that there are following two cases:
Read: Tries to open the file i
Read/write window property defines FFS partition file location.
The BMC loads the PNOR partitions in a read-only volume.
So after that there are following two cases:
Read: Tries to open the file in read only mode from the partition(READONLY/READWRITE/PRESERVED), Partition Table tells the partition type depends on the offset. if file is not there in the mapped partition then tries to open the file from the read only partition.
Write: Tries to open the file in write mode from the partition(READWRITE/PRESERVED), if file is not there in the mapped partition then mailbox daemon will copy the requested partition to the read-write volume to make changes to it.
Change-Id: Ic0ef882380b56536ac55feae3ec563de95fdd4a6 Signed-off-by: Ratan Gupta <ratagupt@in.ibm.com>
show more ...
|
b0327581 | 28-Jun-2017 |
Ratan Gupta <ratagupt@in.ibm.com> |
Add dependency on phosphor logging and sdbusplus
Change-Id: Ie7f6f1806c203ddf46fb8d5a651ebd908ea921cb Signed-off-by: Ratan Gupta <ratagupt@in.ibm.com> |
3214b513 | 10-May-2017 |
Ratan Gupta <ratagupt@in.ibm.com> |
test: read window from partition file
Resolves openbmc/openbmc#1440
Change-Id: I8e6ae35e4c5ba2936a578349e6cea464de6ab40d Signed-off-by: Ratan Gupta <ratagupt@in.ibm.com> |
8441a395 | 05-May-2017 |
Ratan Gupta <ratagupt@in.ibm.com> |
Load the partitions into virtual pnor
Change-Id: I709c410009fb0047d7e59ddd3a681f25e49341a0 Signed-off-by: Ratan Gupta <ratagupt@in.ibm.com> |
99551ef1 | 24-May-2017 |
Ratan Gupta <ratagupt@in.ibm.com> |
test: Add SDK testcase flags
It is required as earlier create_pnor_partition_table test binary try to link with host native libs instead of SDK libs.
Change-Id: I7817929db8699f66f6f2198cae5f1d5a16f
test: Add SDK testcase flags
It is required as earlier create_pnor_partition_table test binary try to link with host native libs instead of SDK libs.
Change-Id: I7817929db8699f66f6f2198cae5f1d5a16fcc5b9 Signed-off-by: Ratan Gupta <ratagupt@in.ibm.com>
show more ...
|
6c2fa90d | 01-May-2017 |
Deepak Kodihalli <dkodihal@in.ibm.com> |
msg: handle partition table read request
Map host's request to read the flash at offset less than the partition table length as a request to read the pnor partition table.
Resolves openbmc/openbmc#
msg: handle partition table read request
Map host's request to read the flash at offset less than the partition table length as a request to read the pnor partition table.
Resolves openbmc/openbmc#1439.
Change-Id: I0f5b98f073d983b0d4749b0aba84b37d7f42f884 Signed-off-by: Deepak Kodihalli <dkodihal@in.ibm.com>
show more ...
|
b6a446f9 | 29-Apr-2017 |
Deepak Kodihalli <dkodihal@in.ibm.com> |
pnor: provide "C" interface to partition table
Change-Id: I35af6c4c43e9a43f6a21992bfb0c13542a2c8f0d Signed-off-by: Deepak Kodihalli <dkodihal@in.ibm.com> |
393821dd | 28-Apr-2017 |
Deepak Kodihalli <dkodihal@in.ibm.com> |
pnor : generate partition table
Implement a class that, upon construction, generates the virtual PNOR partition table. The virtual PNOR is typically a subset of the full PNOR image, by choosing part
pnor : generate partition table
Implement a class that, upon construction, generates the virtual PNOR partition table. The virtual PNOR is typically a subset of the full PNOR image, by choosing partitions of interest.
The generation is based on upon information read from the PNOR partition files and table of contents (toc) file.
Provide an interface to the virtual PNOR partition table.
Change-Id: I7a68e3833b8cf66e92eb6ca274f6a3c376ce0add Signed-off-by: Deepak Kodihalli <dkodihal@in.ibm.com>
show more ...
|
90b92fe4 | 05-May-2017 |
Ratan Gupta <ratagupt@in.ibm.com> |
Make the code compatible with c++ compiler
if we write "int i;" in header file, c compiler treats as a tentative definition while c++ compiler treats as a definition. so when two cpp file includes t
Make the code compatible with c++ compiler
if we write "int i;" in header file, c compiler treats as a tentative definition while c++ compiler treats as a definition. so when two cpp file includes the same header file then during linking time compiler says that there are multiple definitions.
so to overcome this problem we are declaring it as extern and defining it in the corresponding c file.
Change-Id: I91378c4c587414edf35f8313f2497268be36e2f4 Signed-off-by: Ratan Gupta <ratagupt@in.ibm.com>
show more ...
|
b3d88c43 | 28-Apr-2017 |
Deepak Kodihalli <dkodihal@in.ibm.com> |
autotools: check for C++ compiler
In view of some of the upcoming C++ code, check for the C++ compiler.
Also enable compiling C++14 code.
Change-Id: I7ac587e3b40385845b39f7ae0655227c45ed055b Signe
autotools: check for C++ compiler
In view of some of the upcoming C++ code, check for the C++ compiler.
Also enable compiling C++14 code.
Change-Id: I7ac587e3b40385845b39f7ae0655227c45ed055b Signed-off-by: Deepak Kodihalli <dkodihal@in.ibm.com>
show more ...
|
b49e1b8e | 05-May-2017 |
Ratan Gupta <ratagupt@in.ibm.com> |
Enable conditional compilation flag for virtual pnor
Change-Id: I70e1b1f8d709ce79e0664d5f916115e77427b1e8 Signed-off-by: Ratan Gupta <ratagupt@in.ibm.com> |