Add a simple README

Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
hdat: Add Venice hub ID to HDAT conversion

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
i2c: Bug fixes, clean up of the code

Fixed few bugs and clean up a lot. Renamed the state machine variables
to make more sense. A new helper 'p8_i2c_check_work' to avoid hitting
deep call stack after request complete.

Signed-off-by: Neelesh Gupta <neelegup@linux.vnet.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
list: Add list_add_before

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
timer: Add scheduled timer facility

For now running off the event pollers, that will improve once we get
delayed interrupts from the SLW

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
fsp/ti: Make sure the TI area is initialized before use

Otherwise we whack things at 0 which isn't great...

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
i2c: Rework P8 i2c driver

This updates the i2c driver significantly, using a simpler state machine,
using the new timer for timeouts, and fixing a number of issues. I also
changed the Linux interface so I've changed the token number since some
builds have been done with the old code already.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
PLAT: Add i2c busses on palmetto/habanero

We add engine 1 only for now. Eventually, HostBoot will provide
the device nodes and we'll filter what Linux can access.

We expose the VPD eeprom so that the Linux AT24 driver can pick it up

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Merge branch 'i2c'
i2c: Improve operations without interrupts

We use a timer for running the state machine without interrupts. When
we get proper timers using the SLW engine, we'll be able to also reduce
the timeouts but for now, use a large (4s) per-char timeout for polled
mode as it depends on the opal poll frequency which can be very slow.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
i2c: Move bus management and OPAL API to core i2c code

And start adding interfaces to lookup i2c busses.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
timer: Add "polling" timers

These have no expiry and get called whenever the opal pollers run,
they are intended to replace most opal pollers and allow the same
code in drivers to chose between a poller or a timer based on things
like interrupt availability for example.

The other advantage over existing pollers (which I hope to deprecate)
is that they are protected against re-entrancy (while still running
without locks held).

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
i2c: Use new timer facility and improve interrupts handling

We only poll the masters for the chip that got the interrupt
and we improve the running of the timers as well.

We user the new TIMER_POLL facility to replace the use of the
OPAL poller, which simplifies the code further.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
timer: Only check "poll" timers on actual poll, not any interrupt

Due to the lack of SLW timed interrupt support, we take the opportunity
to check out timers on any incoming interrupt. However we really don't
want to do that for the background pollers.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
bt: Add call to bt_poll to kick start message state machine

The bt interface relies on a fairly simple state machine to send
messages to the bmc. Messages are added to a queue for sending and
something calls the state machine to start sending messages, usually
via opal_poll_events. However under some circumstances this doesn't
happen so we need to crank the state machine to start start sending
messages.

This patch adds a call to bt_poll to make sure we start sending a
message which should ensure the bmc generates an irq once the message
is sent to continue processing.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
bt: Add locking for bt hardware polling

This patch adds some locking to the polling of the bt
hardware/state. Prior to having proper interrupts and events working
this was not so critical as we would only ever have one call to
bt_poll running at a time. However functioning interrupts mean we can
have multiple calls to bt_poll so we need to add some locking to ensure
consistency between the state machine and the hardware.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
bt: Fix message timeouts

The initial timeout scheme started a message timeout when it was added
to the queue rather than when transmission was started. To avoid
timing out messages that just got stuck behind a couple of slow ones
we should instead just check that the active message has not timed
out.

This patch ensures timeout values are only checked for the currently
active message.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
bt/ipmi: Quieten logging output

Some tools (eg. ipmitool) that use the Linux ipmi stack send
potentially invalid commands to probe functionality. Currently skiboot
prints an error to the console whenever this happens resulting in
excessive noise when using the Linux ipmi stack.

This patch just removes and/or lowers the logging level of these
errors.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
bt: Reinitialise bt interface correctly after a reset

Add a call to bt_init_interface() in bt_reset_interface(). This
ensures that interrupts are re-enabled after a bt interface reset.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
bt: Use new polling timer interface instead of OPAL pollers

 ... which I'm trying to deprecate

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>