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>
external: Add xscom utilities

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