xref: /qemu/docs/specs/fsi.rst (revision c3709fde5955d13f6d4f86ab46ef3cc2288ca65e)
1*9f70e83aSNinad Palsule======================================
2*9f70e83aSNinad PalsuleIBM's Flexible Service Interface (FSI)
3*9f70e83aSNinad Palsule======================================
4*9f70e83aSNinad Palsule
5*9f70e83aSNinad PalsuleThe QEMU FSI emulation implements hardware interfaces between ASPEED SOC, FSI
6*9f70e83aSNinad Palsulemaster/slave and the end engine.
7*9f70e83aSNinad Palsule
8*9f70e83aSNinad PalsuleFSI is a point-to-point two wire interface which is capable of supporting
9*9f70e83aSNinad Palsuledistances of up to 4 meters. FSI interfaces have been used successfully for
10*9f70e83aSNinad Palsulemany years in IBM servers to attach IBM Flexible Support Processors(FSP) to
11*9f70e83aSNinad PalsuleCPUs and IBM ASICs.
12*9f70e83aSNinad Palsule
13*9f70e83aSNinad PalsuleFSI allows a service processor access to the internal buses of a host POWER
14*9f70e83aSNinad Palsuleprocessor to perform configuration or debugging. FSI has long existed in POWER
15*9f70e83aSNinad Palsuleprocesses and so comes with some baggage, including how it has been integrated
16*9f70e83aSNinad Palsuleinto the ASPEED SoC.
17*9f70e83aSNinad Palsule
18*9f70e83aSNinad PalsuleWorking backwards from the POWER processor, the fundamental pieces of interest
19*9f70e83aSNinad Palsulefor the implementation are: (see the `FSI specification`_ for more details)
20*9f70e83aSNinad Palsule
21*9f70e83aSNinad Palsule1. The Common FRU Access Macro (CFAM), an address space containing various
22*9f70e83aSNinad Palsule   "engines" that drive accesses on buses internal and external to the POWER
23*9f70e83aSNinad Palsule   chip. Examples include the SBEFIFO and I2C masters. The engines hang off of
24*9f70e83aSNinad Palsule   an internal Local Bus (LBUS) which is described by the CFAM configuration
25*9f70e83aSNinad Palsule   block.
26*9f70e83aSNinad Palsule
27*9f70e83aSNinad Palsule2. The FSI slave: The slave is the terminal point of the FSI bus for FSI
28*9f70e83aSNinad Palsule   symbols addressed to it. Slaves can be cascaded off of one another. The
29*9f70e83aSNinad Palsule   slave's configuration registers appear in address space of the CFAM to
30*9f70e83aSNinad Palsule   which it is attached.
31*9f70e83aSNinad Palsule
32*9f70e83aSNinad Palsule3. The FSI master: A controller in the platform service processor (e.g. BMC)
33*9f70e83aSNinad Palsule   driving CFAM engine accesses into the POWER chip. At the hardware level
34*9f70e83aSNinad Palsule   FSI is a bit-based protocol supporting synchronous and DMA-driven accesses
35*9f70e83aSNinad Palsule   of engines in a CFAM.
36*9f70e83aSNinad Palsule
37*9f70e83aSNinad Palsule4. The On-Chip Peripheral Bus (OPB): A low-speed bus typically found in POWER
38*9f70e83aSNinad Palsule   processors. This now makes an appearance in the ASPEED SoC due to tight
39*9f70e83aSNinad Palsule   integration of the FSI master IP with the OPB, mainly the existence of an
40*9f70e83aSNinad Palsule   MMIO-mapping of the CFAM address straight onto a sub-region of the OPB
41*9f70e83aSNinad Palsule   address space.
42*9f70e83aSNinad Palsule
43*9f70e83aSNinad Palsule5. An APB-to-OPB bridge enabling access to the OPB from the ARM core in the
44*9f70e83aSNinad Palsule   AST2600. Hardware limitations prevent the OPB from being directly mapped
45*9f70e83aSNinad Palsule   into APB, so all accesses are indirect through the bridge.
46*9f70e83aSNinad Palsule
47*9f70e83aSNinad PalsuleThe LBUS is modelled to maintain the qdev bus hierarchy and to take advantages
48*9f70e83aSNinad Palsuleof the object model to automatically generate the CFAM configuration block.
49*9f70e83aSNinad PalsuleThe configuration block presents engines in the order they are attached to the
50*9f70e83aSNinad PalsuleCFAM's LBUS. Engine implementations should subclass the LBusDevice and set the
51*9f70e83aSNinad Palsule'config' member of LBusDeviceClass to match the engine's type.
52*9f70e83aSNinad Palsule
53*9f70e83aSNinad PalsuleCFAM designs offer a lot of flexibility, for instance it is possible for a
54*9f70e83aSNinad PalsuleCFAM to be simultaneously driven from multiple FSI links. The modeling is not
55*9f70e83aSNinad Palsuleso complete; it's assumed that each CFAM is attached to a single FSI slave (as
56*9f70e83aSNinad Palsulea consequence the CFAM subclasses the FSI slave).
57*9f70e83aSNinad Palsule
58*9f70e83aSNinad PalsuleAs for FSI, its symbols and wire-protocol are not modelled at all. This is not
59*9f70e83aSNinad Palsulenecessary to get FSI off the ground thanks to the mapping of the CFAM address
60*9f70e83aSNinad Palsulespace onto the OPB address space - the models follow this directly and map the
61*9f70e83aSNinad PalsuleCFAM memory region into the OPB's memory region.
62*9f70e83aSNinad Palsule
63*9f70e83aSNinad PalsuleThe following commands start the ``rainier-bmc`` machine with built-in FSI
64*9f70e83aSNinad Palsulemodel. There are no model specific arguments. Please check this document to
65*9f70e83aSNinad Palsulelearn more about Aspeed ``rainier-bmc`` machine: (:doc:`../../system/arm/aspeed`)
66*9f70e83aSNinad Palsule
67*9f70e83aSNinad Palsule.. code-block:: console
68*9f70e83aSNinad Palsule
69*9f70e83aSNinad Palsule  qemu-system-arm -M rainier-bmc -nographic \
70*9f70e83aSNinad Palsule  -kernel fitImage-linux.bin \
71*9f70e83aSNinad Palsule  -dtb aspeed-bmc-ibm-rainier.dtb \
72*9f70e83aSNinad Palsule  -initrd obmc-phosphor-initramfs.rootfs.cpio.xz \
73*9f70e83aSNinad Palsule  -drive file=obmc-phosphor-image.rootfs.wic.qcow2,if=sd,index=2 \
74*9f70e83aSNinad Palsule  -append "rootwait console=ttyS4,115200n8 root=PARTLABEL=rofs-a"
75*9f70e83aSNinad Palsule
76*9f70e83aSNinad PalsuleThe implementation appears as following in the qemu device tree:
77*9f70e83aSNinad Palsule
78*9f70e83aSNinad Palsule.. code-block:: console
79*9f70e83aSNinad Palsule
80*9f70e83aSNinad Palsule  (qemu) info qtree
81*9f70e83aSNinad Palsule  bus: main-system-bus
82*9f70e83aSNinad Palsule    type System
83*9f70e83aSNinad Palsule    ...
84*9f70e83aSNinad Palsule    dev: aspeed.apb2opb, id ""
85*9f70e83aSNinad Palsule      gpio-out "sysbus-irq" 1
86*9f70e83aSNinad Palsule      mmio 000000001e79b000/0000000000001000
87*9f70e83aSNinad Palsule      bus: opb.1
88*9f70e83aSNinad Palsule        type opb
89*9f70e83aSNinad Palsule        dev: fsi.master, id ""
90*9f70e83aSNinad Palsule          bus: fsi.bus.1
91*9f70e83aSNinad Palsule            type fsi.bus
92*9f70e83aSNinad Palsule            dev: cfam.config, id ""
93*9f70e83aSNinad Palsule            dev: cfam, id ""
94*9f70e83aSNinad Palsule              bus: lbus.1
95*9f70e83aSNinad Palsule                type lbus
96*9f70e83aSNinad Palsule                dev: scratchpad, id ""
97*9f70e83aSNinad Palsule                  address = 0 (0x0)
98*9f70e83aSNinad Palsule      bus: opb.0
99*9f70e83aSNinad Palsule        type opb
100*9f70e83aSNinad Palsule        dev: fsi.master, id ""
101*9f70e83aSNinad Palsule          bus: fsi.bus.0
102*9f70e83aSNinad Palsule            type fsi.bus
103*9f70e83aSNinad Palsule            dev: cfam.config, id ""
104*9f70e83aSNinad Palsule            dev: cfam, id ""
105*9f70e83aSNinad Palsule              bus: lbus.0
106*9f70e83aSNinad Palsule                type lbus
107*9f70e83aSNinad Palsule                dev: scratchpad, id ""
108*9f70e83aSNinad Palsule                  address = 0 (0x0)
109*9f70e83aSNinad Palsule
110*9f70e83aSNinad Palsulepdbg is a simple application to allow debugging of the host POWER processors
111*9f70e83aSNinad Palsulefrom the BMC. (see the `pdbg source repository`_ for more details)
112*9f70e83aSNinad Palsule
113*9f70e83aSNinad Palsule.. code-block:: console
114*9f70e83aSNinad Palsule
115*9f70e83aSNinad Palsule  root@p10bmc:~# pdbg -a getcfam 0x0
116*9f70e83aSNinad Palsule  p0: 0x0 = 0xc0022d15
117*9f70e83aSNinad Palsule
118*9f70e83aSNinad Palsule.. _FSI specification:
119*9f70e83aSNinad Palsule   https://openpowerfoundation.org/specifications/fsi/
120*9f70e83aSNinad Palsule
121*9f70e83aSNinad Palsule.. _pdbg source repository:
122*9f70e83aSNinad Palsule   https://github.com/open-power/pdbg
123