More trace endian fixes so make check works again

We need the core to do proper endian among others since that
code is compiled in run-trace

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Merge remote-tracking branch 'ltcgit/master'
Enable warn_unused_result for fsp_queue_msg()

We now get a bunch of warnings of places where we should go and fix
the code, yay!

(acked in discussing thread on list)

Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Acked-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
Acked-by: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
elog: (sensor) Replace prerror with elog

Replace prerror with 'elog' interface and correct one existing SRC
map from error type.

Signed-off-by: Neelesh Gupta <neelegup@linux.vnet.ibm.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
PLAT: Add i2c busses on firenze

Set up the device tree nodes of i2c masters and their busses, eventually
all this has to come from hostboot.

Signed-off-by: Neelesh Gupta <neelegup@linux.vnet.ibm.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Remove sprintf: there's no good reason to have this in firmware

Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Remove vsprintf: just like sprintf, vsnprintf is a much better idea

Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Add tweaks to work in Mambo simulator

Mambo doesn't implement various things such as PBA SCOMs, LPC,
ChipTOD, etc... It also provides a special console hook.

This adds detection of Mambo via the /mambo node, and enables
us to boot all the way to Linux.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Add scripts to run from Mambo

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Add documentation describing skiboot versioning

Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
opal: Handle more TFAC errors.

Handle more TFAC errors reported through TFMR i.e TB_RESIDUE_ERR,
FW_CONTROL_ERR and CHIP_TOD_PARITY_ERR. Clear these errors by writing to
respective TFMR bits.

Signed-off-by: Mahesh Salgaonkar <mahesh@linux.vnet.ibm.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
opal: Report only one HMI event per core for recovered TFAC errors.

HMER is per thread and each thread needs to reset the relavant error bit.
But Timebase register is per core and first thread that gets an interrupt
would fix the actual TFAC errors where as others just resets the respective
HMER error bit. This patch limits the reporting of HMI event one per
core for TFAC errors.

Signed-off-by: Mahesh Salgaonkar <mahesh@linux.vnet.ibm.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
core/test: fix compile error in run-trace

Signed-off-by: Cédric Le Goater <clg@fr.ibm.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Remove #define sync in test/run-trace.c - don't confuse with sync(2)

Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
core/init: make fdt a local variable

Currently there is a file scope variable fdt, which is just used in
load_and_boot_kernel(). Since no other user, it is not necessary to define it
as a file scope variable.

This patch makes it a local variable in the function.

Signed-off-by: Wei Yang <weiyang@linux.vnet.ibm.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Makefile: set CROSS based on arch

CROSS is used to do the cross compile of skiboot on other platform, while this
variable is not necessary on ppc64. When this is set on ppc64, there would be
an error.

This patch sets the CROSS depends on the arch.

Signed-off-by: Wei Yang <weiyang@linux.vnet.ibm.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
core/device: wrap a function to destroy a dt_node

When destroying a dt_node, it needs to release both the name and itself. And
there are several places to do the release.

This patch wrap a function dt_destroy() to make sure both of the elements of a
dt_node are released when it is not used any more.

Signed-off-by: Wei Yang <weiyang@linux.vnet.ibm.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
ipmi/fru: Add support for populating fru data

This patch adds basic support for populating some fru data. Currently
we only support adding the skiboot version number to the product
information area.

Signed-off-by: Alistair Popple <alistair@popple.id.au>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
tce: Use TCE macros

Use available TCE mask and size macros to make the code readable
and easy to maintain.

Signed-off-by: Neelesh Gupta <neelegup@linux.vnet.ibm.com>
Reviewed-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
rtc: Add a generic rtc cache

Some of the generic skiboot code needs access to the rtc (for example
the pel logging code). Currently this is accessed via a call to fsp
specific code which implements an rtc cache. Obviously this wont work
on systems without a fsp.

This patch makes the rtc cache generic so that we can get the time on
other platforms (assuming they have some kind of rtc).

Signed-off-by: Alistair Popple <alistair@popple.id.au>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>