ppc/pnv: add a LPC controller
commita3980bf51702d05690f07db2f6f07ab0f55d49b9
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>
Sat, 22 Oct 2016 09:46:42 +0000 (22 11:46 +0200)
committerDavid Gibson <david@gibson.dropbear.id.au>
Thu, 27 Oct 2016 22:38:25 +0000 (28 09:38 +1100)
tree4742626d5b82731b26225e8fa9d09770a5c4abda
parent24ece072504b8c8b03861168d601d174a7948099
ppc/pnv: add a LPC controller

The LPC (Low Pin Count) interface on a POWER8 is made accessible to
the system through the ADU (XSCOM interface). This interface is part
of set of units connected together via a local OPB (On-Chip Peripheral
Bus) which act as a bridge between the ADU and the off chip LPC
endpoints, like external flash modules.

The most important units of this OPB are :
 - OPB Master: contains the ADU slave logic, a set of internal
   registers and the logic to control the OPB.
 - LPCHC (LPC HOST Controller): which implements a OPB Slave, a set of
   internal registers and the LPC HOST Controller to control the LPC
   interface.

Four address spaces are provided to the ADU :
 - LPC Bus Firmware Memory
 - LPC Bus Memory
 - LPC Bus I/O (ISA bus)
 - and the registers for the OPB Master and the LPC Host Controller

On POWER8, an intermediate hop is necessary to reach the OPB, through
a unit called the ECCB. OPB commands are simply mangled in ECCB write
commands.

On POWER9, the OPB master address space can be accessed via MMIO. The
logic is same but the code will be simpler as the XSCOM and ECCB hops
are not necessary anymore.

This version of the LPC controller model doesn't yet implement support
for the SerIRQ deserializer present in the Naples version of the chip
though some preliminary work is there.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
[clg: - updated for qemu-2.7
      - ported on latest PowerNV patchset
      - changed the XSCOM interface to fit new model
      - QOMified the model
      - moved the ISA hunks in another patch
      - removed printf logging
      - added a couple of UNIMP logging
      - rewrote commit log ]
Signed-off-by: Cédric Le Goater <clg@kaod.org>
Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
hw/ppc/Makefile.objs
hw/ppc/pnv.c
hw/ppc/pnv_lpc.c [new file with mode: 0644]
include/hw/ppc/pnv.h
include/hw/ppc/pnv_lpc.h [new file with mode: 0644]
include/hw/ppc/pnv_xscom.h