Age | Commit message (Collapse) | Author | Files | Lines |
|
In several places, a "bus/device/function" u16 was being directly
or'ed into an address using a left-shift. This should be using
SETFIELD, especially now that all _LSH have been removed.
Change use of BDFN (bus/device/function) field from using plain
left-shift to using SETFIELD(). Add proper BDFN field definitions.
Signed-off-by: Dan Streetman <ddstreet@ieee.org>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
The last patch changed the SETFIELD() and GETFIELD() macros to automatically
calculate the shift of a given mask, so manually specifying the shift is no
longer needed. Additionally, any masks should have the _MASK suffix removed
since the GETFIELD() and SETFIELD() operations expected to be passed the
mask name without the _MASK suffix (and so either the mask name or the
get/setfield call needs to have its mask name changed).
Change all _MASK masks to remove the _MASK suffix, except for any places
that leaving _MASK makes sense (e.g. already an existing define without
_MASK suffix).
Remove all _LSH defines, as they are no longer needed.
Signed-off-by: Dan Streetman <ddstreet@ieee.org>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
Currently, the GETFIELD() and SETFIELD() macros require the user to define
both the _MASK and the _LSH of the field. However, the shift of the field
is trivially determinable and there is no reason it needs to be specified
by the user.
Add MASK_TO_LSH() macro, which determines the shift of a given mask.
Change GETFIELD() and SETFIELD() to use MASK_TO_LSH() to determine the
shift of the specified mask, instead of requiring it to be specified by
the user.
Signed-off-by: Dan Streetman <ddstreet@ieee.org>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
Since we want to prevent conflicts between PNOR and NVRAM, this change
moves the flash-nvram handling out of flash-nvram.c and into the generic
flash module. This way, the OPAL_FLASH_{READ,WRITE,ERASE} API won't
conflict with the OPAL_*_NVRAM api.
To do this, we use the flash_register function to look for an "NVRAM"
partition. If one is found, it is automatically registered as the system
NVRAM backend.
We also change the rhesus and astmbc platforms to use the common flash
code.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Reviewed-by: Joel Stanley <joel@jms.id.au>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
Since we have a flash device registered as the system flash, use this as
a generic load_resource backend.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Reviewed-by: Joel Stanley <joel@jms.id.au>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
We'd like to enable access to the system PNOR, on platforms where its
present. This change introduces an API for global flash operations:
opal_flash_read
opal_flash_erase
opal_flash_write
- plus device-tree bindings to expose the flash details.
Since there are other components of the system that use the PNOR (NVRAM
and pnor_load_resource), upcoming changes will port this these over to
use the new interface.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Reviewed-by: Joel Stanley <joel@jms.id.au>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
And add some basic qemu quirks
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
If the chiptod is not in the device-tree, we must fail, the old
OPAL mode isn't supported anymore
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
We want to move to pollers being run inly when no lock is held
so let's start recording lock depth. It will also be a useful
debugging tool.
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
... to prevent any potential poller recursions during lid load.
With this change:
...
[10810950484,5] CUPD: P side ML Keyword = FW830.00
[10832756491,6] HBRT: 1 lids to load
[10832762732,7] FSP: Fetch data id: 05 sid: 81e00430 to 0x306cf500(0x100000
bytes)
[10832766825,7] FSP: 0x00100000 bytes balign=306cf000 boff=500 bsize=101000
[10857829395,5] CUPD: Marker LID id : size : status = 0x80a08001 : 0x5d0 : 0x0
[10966464432,7] FSP: -> rc=0x00 off: 00000000 twritten: 0007fb80
[10966468418,7] HBRT: LID 0x81e00430 successfully loaded, len=0x31b83db8
...
[19485180658,7] HBRT: stopOCCs() rc = 0
[19582727570,6] OCC: Got OCC Load message, scope=0x2 dbob=0x0 seq=0x10
[19582732660,7] HBRT: OCC Load requested
[19582734678,7] HBRT: Calling loadOCC() homer 0000000401400000, occ_common_area
0000000400800000, chip 0000
[19582803643,6] HBRT: Lid load request for 0x81e00430
[19582806532,7] HBRT: Serviced from cache, len=0x7fb80
[19582996931,7] HBRT: -> rc = 0
[19582999113,7] HBRT: Calling loadOCC() homer 0000000401c00000, occ_common_area
0000000400800000, chip 0001
[19583097594,6] HBRT: Lid load request for 0x81e00430
[19583100343,7] HBRT: Serviced from cache, len=0x7fb80
[19583274638,7] HBRT: -> rc = 0
[19583277114,6] HBRT: OCC Start requested
V2:
Address Vasant's comments (bz reference and OPAL_NO_MEM)
Signed-off-by: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
For use by hservices mainly...
Signed-off-by: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
This adds a subid to load_resource() so that sub-partitions can be accessed
inside a PNOR partition. These sub-partitions follow the format used by the
hostboot SBE image.
The subid will match on the EC field of the SBE table of contents. If it's
found, only that sub-partition is returned to the caller.
Current partitions (kernel and ramfs) don't support sub-partitions. If caller
tries to access a sub-partition within these, we fail the call.
Signed-off-by: Michael Neuling <mikey@neuling.org>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
Add new function call load_resource(). This helps cleanup the callers of
platform.load_resource().
Signed-off-by: Michael Neuling <mikey@neuling.org>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
We now consistently use msg as abbreviation for message in OPAL API.
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
Don't expose functions which are not used outside LED driver.
Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
Avoids duplication of init values.
Signed-off-by: Michael Neuling <mikey@neuling.org>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
Add a function dt_find_by_name() that returns the child node if
matches the given name, otherwise NULL.
Signed-off-by: Neelesh Gupta <neelegup@linux.vnet.ibm.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
Now matches linux.
Fix up all the fsp code using these structs to do the proper
be64_to_cpu conversions so at least everything is annotated correctly.
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
Rather than have DUMP_REGION_HOST_START and (unused) OPAL_DUMP_REGION_HOST_START
let's use the defines we have in opal.h as this is API that just happens
to match with what FSP expects.
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
In Linux, we had OPAL_PM_(NAP|SLEEP|WINKLE)_ENABLED defines,
this makes sense from an API PoV as having defines for flags
in DT is useful, but we should clearly define what these flags
are.
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
Never used, but exists for testing.
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
We currently just log an error when we don't find an active PSI link
15 minutes after it went down. Add a PEL log, with sufficient severity
so it gets pushed to the administrator.
V2:
Reset the timeout correctly to prevent error log flooding.
Signed-off-by: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
Tested-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
Add support for an ipmi watchdog timer. During skiboot initialisation
this patch will cause the system to be reset if opal_run_pollers()
isn't called for more than 60 seconds.
Once the payload is started the watchdog timer will be reset and a
pre-timeout interrupt set. The payload should then receive the
interrupt and call into skiboot which will disable the watchdog timer.
Signed-off-by: Alistair Popple <alistair@popple.id.au>
Reviewed-by: Joel Stanley <joel@jms.id.au>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
This sends the previously unused OPAL_MSG_SHUTDOWN using opal_queue_msg
to initiate a graceful shutdown.
The message provides a single parameter indicating weather the shutdown
is will result in a power-off, or a reboot.
Signed-off-by: Joel Stanley <joel@jms.id.au>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
The read event mechanism is used when the BMC has an asynchronous message
for the host. It sets a flag that we read with Get Message Flags, and then
we read the message using Read Event. This event message contains a SEL
message. There are two OEM SEL messages we expect from the AMI BMC:
- graceful power operations. This is when the BMC wants the host to
power down or reboot.
- PNOR Locking. When the BMC wants to access the PNOR, it requests
that the host not touch it.
This patch implements the parsing.
Signed-off-by: Joel Stanley <joel@jms.id.au>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
For OEM events including graceful power down and BMC PNOR access we want
to receive notification whenever a message is ready to be read from the
BMC. This requires the Event Message Buffer flag to be enabled.
This is the equivalent of doing mc setenables event_msg=on with
ipmitool, except the message must come from the BT interface in order to
have permission to modify the flags.
Signed-off-by: Joel Stanley <joel@jms.id.au>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
When the bt interface sets the SMS_ATN flag, we perform a Get Message
Flags to determine what messages are available.
The only message type currently processed is the Event Message Buffer,
which provides SEL messages for indicating OEM specific events such as
graceful system shutdown and PNOR access requested. These events will be
handled by the IPMI layer in skiboot.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Signed-off-by: Joel Stanley <joel@jms.id.au>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
This patch adds support for sending ipmi messages synchronously. This
is necessary to allow messages to be sent during skiboot
initialisation as interrupt servicing/polling is controlled by the
host operating system which is not yet running.
Signed-off-by: Alistair Popple <alistair@popple.id.au>
Reviewed-by: Joel Stanley <joel@jms.id.au>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
Add a platform hook that is called just prior to loading
and running the payload.
Signed-off-by: Alistair Popple <alistair@popple.id.au>
Reviewed-by: Joel Stanley <joel@jms.id.au>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
Currently the only functions we have for initialising ipmi messages
with the correct values also allocate memory for the message. In some
cases we want to reuse previously allocated messages to avoid
continually freeing/allocating memory.
This patch introduces a function which (re)initialises a previously
allocated message and converts existing instances of this behaviour
over to the new function.
Signed-off-by: Alistair Popple <alistair@popple.id.au>
Reviewed-by: Joel Stanley <joel@jms.id.au>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
Commit 16c80346 change included some reverts of previous commits, which
we need. This change reverts those reverts, leaving the original intent
of that change.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
This is probably not the best collection of things in the world,
but it means that opal.h is much closer to being directly usable
by an OS.
This triggers a bunch of #include fixes throughout the tree.
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
The __be64 (etc) annotations are likely going to be useful in the future
if/when we start running sparse around skiboot and it's already useful
in linux, so it's completely harmless having __be64 rather than uint64_t
in skiboot.
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
Was mentioned in linux as possibly being used by some external test
modules. It's harmless to make this official behaviour.
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
Also means we start getting consistent codestyle
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
Big-endian ELF64 ELF executables normally (the Linux kernel is an
exception) have their entry point refer to a function descriptor instead
of the first instruction. Distinguish between the Linux case and the
function descriptor case, which is used for the FreeBSD kernel, by
checking whether the entry point points into an executable section or
not. This allows use of the FreeBSD kernel as a skiboot payload.
Signed-off-by: Nathan Whitehorn <nwhitehorn@freebsd.org>
[stewart@linux.vnet.ibm.com: reverse test polarity, change continue to break]
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
This seem to be left behind during the previous commit for creating
a generic interface of reading the cached tod on non-fsp systems.
So, remove the old prototype fsp_rtc_get_cached_tod().
Signed-off-by: Neelesh Gupta <neelegup@linux.vnet.ibm.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
fsp_fetch_data_queue() internally calls fsp_queue_msg().
So ideally we should consume the result of this function.
Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
If the OCC interrupt comes from another chip, we incorrectly try to clear
it on the local one. This causes hangs at boot on some machines.
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
Commit cf6f4e8912d29fb89ce85c84834607065ad595a5 introduced a platform
independent frontend for error logging. However it failed to move the
generic parts of the fsp-elog.h header into the platform independent
one, instead relying on the fact that up until now fsp-elog.h was
included whenever a function needed to log errors.
This patch moves the platform independent defines into the frontend
header file (errorlog.h) and removes the include of the platform
specific header in generic code paths.
Signed-off-by: Alistair Popple <alistair@popple.id.au>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
This patch adds a backend for bmc based machines running AMI firmware
supporting the OEM extended sel commands. Errors are logged in pel
format to the bmc.
Signed-off-by: Alistair Popple <alistair@popple.id.au>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|