Age | Commit message (Collapse) | Author | Files | Lines |
|
Right now the $(sbindir) variable isn't defined, so the binary gets installed
directly into $(DESTDIR).
Signed-off-by: Dan Horák <dan@danny.cz>
Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
|
|
The various ffspart test cases use /dev/zero as an input which doesn't
behave like a normal file. The stat.st_size field for char devs is
generally zero so the subsequent attempt to mmap() the file fails
because we requested a zero size mapping.
Previously we didn't notice this, but it sort of worked since the
partitions in the test script that used /dev/zero as an input were
also had those partitions marked as ECC. This resulted in the partition
contents being re-generated (using a buffer libflash allocates) and
the source data pointer being ignored since we said it was zero length.
Fix all this by dropping mmap() entirely and inhale the input file into
a buffer we malloc() instead. This works for any file, including
/dev/urandom, which can't be mmap()ed.
Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
|
|
SPDX makes it a simpler diff.
I have audited the commit history of each file to ensure that they are
exclusively authored by IBM and thus we have the right to relicense.
The motivation behind this is twofold:
1) We want to enable experiments with coreboot, which is GPLv2 licensed
2) An upcoming firmware component wants to incorporate code from skiboot
and code from the Linux kernel, which is GPLv2 licensed.
I have gone through the IBM internal way of gaining approval for this.
The following files are not exclusively authored by IBM, so are *not*
included in this update (I will be seeking approval from contributors):
core/direct-controls.c
core/flash.c
core/pcie-slot.c
external/common/arch_flash_unknown.c
external/common/rules.mk
external/gard/Makefile
external/gard/rules.mk
external/opal-prd/Makefile
external/pflash/Makefile
external/xscom-utils/Makefile
hdata/vpd.c
hw/dts.c
hw/ipmi/ipmi-watchdog.c
hw/phb4.c
include/cpu.h
include/phb4.h
include/platform.h
libflash/libffs.c
libstb/mbedtls/sha512.c
libstb/mbedtls/sha512.h
platforms/astbmc/barreleye.c
platforms/astbmc/garrison.c
platforms/astbmc/mihawk.c
platforms/astbmc/nicole.c
platforms/astbmc/p8dnu.c
platforms/astbmc/p8dtu.c
platforms/astbmc/p9dsu.c
platforms/astbmc/vesnin.c
platforms/rhesus/ec/config.h
platforms/rhesus/ec/gpio.h
platforms/rhesus/gpio.c
platforms/rhesus/rhesus.c
platforms/astbmc/talos.c
platforms/astbmc/romulus.c
Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
[oliver: fixed up the drift]
Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
|
|
Use Software Package Data Exchange (SPDX) to indicate license for each
file that is unique to skiboot.
At the same time, ensure the (C) who and years are correct.
See https://spdx.org/
Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
[oliver: Added a few missing files]
Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
|
|
libflash/file.c: In function 'file_erase':
libflash/file.c:134:1: error: the frame size of 4128 bytes is larger than 1024 bytes [-Werror=frame-larger-than=]
}
^
and
ffspart.c: In function ‘main’:
ffspart.c:529:1: error: the frame size of 4864 bytes is larger than 1024 bytes [-Werror=frame-larger-than=]
}
^
In both cases, mark the local variables as static to avoid the stack.
The static approach is valid for file.c as the buffer is always filled
with `~0`. Given it's now going to be in .bss due to static we have to
still perform the memset(), but racing memset()s in this fashion won't
be harmful, just wasteful.
For ffspart.c's main(), there are bigger problems if that needs to be
re-entrant.
Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
|
|
We do this by assuming filenames with '.ecc' in them are already ECC
protected.
This solves a practical problem in transitioning op-build to use ffspart
for pnor assembly rather than three perl scripts and a lot of XML.
We also update the ffspart tests to take into account ECC requirements.
Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
Reviewed-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
|
|
Otherwise we saw failures in CI and the ~221 character paths Jankins
likes to have.
Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
Reviewed-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
|
|
This test checks that the partitions are correctly laid out when the
eraseblock size is greater than the start of the first partition.
Currently ffspart fails to create a valid image in this case.
There are two tests. The second is expected to fail but it is marked as
passing for now.
This test requires pflash to work. Currently we leave that as an
exercise for the user.
Signed-off-by: Joel Stanley <joel@jms.id.au>
Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
|
|
This test specifies a toc in the configuration file.
There are no tests or documentation for the toc syntax, so this exists
to describe how specify a toc.
Signed-off-by: Joel Stanley <joel@jms.id.au>
Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
|
|
Add '--allow-empty' which allows the filename for a given partition to
be blank. If set ffspart will set that part of the PNOR file 'blank' and
set ECC bits if required.
Without this option behaviour is unchanged and ffspart will return an
error if it can not find the partition file.
Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
|
|
Signed-off-by: Cyril Bur <cyril.bur@au1.ibm.com>
Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
|
|
This also updated the pflash tests which use ffspart to generate pnors
Signed-off-by: Cyril Bur <cyril.bur@au1.ibm.com>
Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
|
|
An FFS TOC is comprised of two parts. A small header which has a magic
and very minimmal information about the TOC which will be common to all
partitions, things like number of patritions, block sizes and the like.
Following this small header are a series of entries. Importantly there
is always an entry which encompases the TOC its self, this is usually
called the 'part' partition.
Currently libffs always assumes that the 'part' partition is at zero.
While there is always a TOC and zero there doesn't actually have to be.
PNORs may have multiple TOCs within them, therefore libffs needs to be
flexible enough to allow callers to specify TOCs not at zero.
The 'part' partition is otherwise a regular partition which may have
flags associated with it. libffs should allow the user to set the flags
for the 'part' partition.
This patch achieves both by allowing the caller to specify the 'part'
partition. The caller can not and libffs will provide a sensible
default.
Signed-off-by: Cyril Bur <cyril.bur@au1.ibm.com>
Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
|
|
Currently consumers can add an new ffs entry to multiple headers, this
is fine but freeing any of the headers will cause the entry to be freed,
this causes double free problems.
Even if only one header is uses, the consumer of the library still has a
reference to the entry, which they may well reuse at some other point.
libffs will now refcount entries and only free when there are no more
references.
This patch also removes the pointless return value of ffs_hdr_free()
Signed-off-by: Cyril Bur <cyril.bur@au1.ibm.com>
Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
|
|
Since the libffs no longer needs to sort the entries as they get added
it makes little sense to have the complexity of a linked list when an
array will suffice.
Signed-off-by: Cyril Bur <cyril.bur@au1.ibm.com>
Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
|
|
It turns out this code was messy and not all that reliable. Doing it at
the library level adds complexity to the library and restrictions to the
caller.
A simpler approach can be achived with the just instantiating multiple
ffs_header structures pointing to different parts of the same file.
Signed-off-by: Cyril Bur <cyril.bur@au1.ibm.com>
Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
|
|
These options are currently flakey in libflash/libffs so there isn't
much point to being able to use them in ffspart.
Future reworks planned for libflash/libffs will render these options
redundant anyway.
Signed-off-by: Cyril Bur <cyril.bur@au1.ibm.com>
Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
|
|
It seems we've developed a character respresentation for ffs partition
flags. Currently only pflash really prints them so it hasn't been a
problem but now ffspart wants to read them in from user input.
It is important that what libffs reads and what pflash prints remain
consistent, we should move the code into libffs to avoid problems.
Signed-off-by: Cyril Bur <cyril.bur@au1.ibm.com>
Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
|
|
Signed-off-by: Cyril Bur <cyril.bur@au1.ibm.com>
Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
|
|
Add the misc flag clear_on_ecc_error to libflash/pflash. This was
the only missing flag. The generator of the virtual pnor image
relies on libflash/pflash to provide the partition information,
so all flags are needed to build an accurate virtual pnor partition
table.
Signed-off-by: Adriana Kobylak <anoo@linux.vnet.ibm.com>
Reviewed-by: Cyril Bur <cyril.bur@au1.ibm.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
The volatile flag was added to the pnor image to
indicate partitions that are cleared during a host
power off. Display this flag from the pflash command.
Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
The reason for this is that check targets for one tool will start to
depend on other tools. For example, future pflash tests will rely on
ffspart to generate pnors. The current method is too racey and results
in races cleaning/building ffspart for its tests and for pflash tests.
Signed-off-by: Cyril Bur <cyril.bur@au1.ibm.com>
Reviewed-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
Currently the FFS header/TOC generation code requires that consumers
know the size of their TOC beforehand. While this may be advantageous in
some circumstances if there are known limitations of other software. It
should not be a requirement.
Knowing the size of the FFS header/TOC partially breaks the abstraction
since it would require consumers of the library to be aware of/have some
idea of the on flash structure and size.
Future work may introduce functions to force sizes but the default
behaviour should be to calculate it behind the scenes.
This patch also addresses an off by one issue in checking for TOC
overflow.
Signed-off-by: Cyril Bur <cyril.bur@au1.ibm.com>
Reviewed-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
Signed-off-by: Cyril Bur <cyril.bur@au1.ibm.com>
Reviewed-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
Signed-off-by: Cyril Bur <cyril.bur@au1.ibm.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
A typical input file to generate something that current op-build would create:
HBI,0x00010000,0x05a0000,EV,./bins/HBI.bin
MVPD,0x05b0000,0x0090000,EF,./bins/MVPD.bin
CVPD,0x0640000,0x0048000,EF,./bins/CVPD.bin
DJVPD,0x688000,0x0048000,EF,./bins/DJVPD.bin
HBD,0x006d0000,0x0060000,E,./bins/HBD.bin
SBEC,0x0730000,0x0090000,EI,./bins/SBEC.bin
SBE,0x007c0000,0x0048000,EI,./bins/SBE.bin
ATTR_TMP,0x808000,0x8000,F,./bins/ATTR_TMP.bin
ATTR_PERM,0x810000,0x8000,EF,./bins/ATTR_PERM.bin
WINK,0x00818000,0x0120000,EV,./bins/WINK.bin
GUARD,0x00938000,0x005000,EPF,./bins/GUARD.bin
HBEL,0x0093d000,0x0024000,EF,./bins/HBEL.bin
PAYLOAD,0x961000,0x100000,,./bins/skiboot.lid
BOOTKERNEL,0xa61000,0xf00000,,./bins/petitboot.zImage
NVRAM,0x01961000,0x90000,EPF,./bins/NVRAM.bin
HBRT,0x019f1000,0x360000,EV,./bins/HBRT.bin
OCC,0x001d51000,0x120000,E,./bins/OCC.bin
FIRDATA,0x1e71000,0x3000,EF,./bins/FIRDATA.bin
CAPP,0x001e74000,0x24000,E,./bins/CAPP.bin
HBB,0x0001f67000,0x90000,EV,./bins/HBB.bin
VERSION,0x1ff7000,0x1000,,./bins/VERSION2.bin
Signed-off-by: Cyril Bur <cyril.bur@au1.ibm.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|