Commit 4d2e26a3 authored by Mauro Carvalho Chehab's avatar Mauro Carvalho Chehab

docs: powerpc: convert docs to ReST and rename to *.rst

Convert docs to ReST and add them to the arch-specific
book.

The conversion here was trivial, as almost every file there
was already using an elegant format close to ReST standard.

The changes were mostly to mark literal blocks and add a few
missing section title identifiers.

One note with regards to "--": on Sphinx, this can't be used
to identify a list, as it will format it badly. This can be
used, however, to identify a long hyphen - and "---" is an
even longer one.

At its new index.rst, let's add a :orphan: while this is not linked to
the main index.rst file, in order to avoid build warnings.
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+samsung@kernel.org>
Acked-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com> # cxl
parent 0a8ad0ff
...@@ -403,7 +403,7 @@ That is, the recovery API only requires that: ...@@ -403,7 +403,7 @@ That is, the recovery API only requires that:
.. note:: .. note::
Implementation details for the powerpc platform are discussed in Implementation details for the powerpc platform are discussed in
the file Documentation/powerpc/eeh-pci-error-recovery.txt the file Documentation/powerpc/eeh-pci-error-recovery.rst
As of this writing, there is a growing list of device drivers with As of this writing, there is a growing list of device drivers with
patches implementing error recovery. Not all of these patches are in patches implementing error recovery. Not all of these patches are in
...@@ -422,3 +422,6 @@ That is, the recovery API only requires that: ...@@ -422,3 +422,6 @@ That is, the recovery API only requires that:
- drivers/net/cxgb3 - drivers/net/cxgb3
- drivers/net/s2io.c - drivers/net/s2io.c
- drivers/net/qlge - drivers/net/qlge
The End
-------
...@@ -143,6 +143,7 @@ implementation. ...@@ -143,6 +143,7 @@ implementation.
arm64/index arm64/index
ia64/index ia64/index
m68k/index m68k/index
powerpc/index
riscv/index riscv/index
s390/index s390/index
sh/index sh/index
......
========================
The PowerPC boot wrapper The PowerPC boot wrapper
------------------------ ========================
Copyright (C) Secret Lab Technologies Ltd. Copyright (C) Secret Lab Technologies Ltd.
PowerPC image targets compresses and wraps the kernel image (vmlinux) with PowerPC image targets compresses and wraps the kernel image (vmlinux) with
...@@ -21,6 +23,7 @@ it uses the wrapper script (arch/powerpc/boot/wrapper) to generate target ...@@ -21,6 +23,7 @@ it uses the wrapper script (arch/powerpc/boot/wrapper) to generate target
image. The details of the build system is discussed in the next section. image. The details of the build system is discussed in the next section.
Currently, the following image format targets exist: Currently, the following image format targets exist:
==================== ========================================================
cuImage.%: Backwards compatible uImage for older version of cuImage.%: Backwards compatible uImage for older version of
U-Boot (for versions that don't understand the device U-Boot (for versions that don't understand the device
tree). This image embeds a device tree blob inside tree). This image embeds a device tree blob inside
...@@ -29,31 +32,36 @@ Currently, the following image format targets exist: ...@@ -29,31 +32,36 @@ Currently, the following image format targets exist:
with boot wrapper code that extracts data from the old with boot wrapper code that extracts data from the old
bd_info structure and loads the data into the device bd_info structure and loads the data into the device
tree before jumping into the kernel. tree before jumping into the kernel.
Because of the series of #ifdefs found in the
Because of the series of #ifdefs found in the
bd_info structure used in the old U-Boot interfaces, bd_info structure used in the old U-Boot interfaces,
cuImages are platform specific. Each specific cuImages are platform specific. Each specific
U-Boot platform has a different platform init file U-Boot platform has a different platform init file
which populates the embedded device tree with data which populates the embedded device tree with data
from the platform specific bd_info file. The platform from the platform specific bd_info file. The platform
specific cuImage platform init code can be found in specific cuImage platform init code can be found in
arch/powerpc/boot/cuboot.*.c. Selection of the correct `arch/powerpc/boot/cuboot.*.c`. Selection of the correct
cuImage init code for a specific board can be found in cuImage init code for a specific board can be found in
the wrapper structure. the wrapper structure.
dtbImage.%: Similar to zImage, except device tree blob is embedded dtbImage.%: Similar to zImage, except device tree blob is embedded
inside the image instead of provided by firmware. The inside the image instead of provided by firmware. The
output image file can be either an elf file or a flat output image file can be either an elf file or a flat
binary depending on the platform. binary depending on the platform.
dtbImages are used on systems which do not have an
dtbImages are used on systems which do not have an
interface for passing a device tree directly. interface for passing a device tree directly.
dtbImages are similar to simpleImages except that dtbImages are similar to simpleImages except that
dtbImages have platform specific code for extracting dtbImages have platform specific code for extracting
data from the board firmware, but simpleImages do not data from the board firmware, but simpleImages do not
talk to the firmware at all. talk to the firmware at all.
PlayStation 3 support uses dtbImage. So do Embedded
PlayStation 3 support uses dtbImage. So do Embedded
Planet boards using the PlanetCore firmware. Board Planet boards using the PlanetCore firmware. Board
specific initialization code is typically found in a specific initialization code is typically found in a
file named arch/powerpc/boot/<platform>.c; but this file named arch/powerpc/boot/<platform>.c; but this
can be overridden by the wrapper script. can be overridden by the wrapper script.
simpleImage.%: Firmware independent compressed image that does not simpleImage.%: Firmware independent compressed image that does not
depend on any particular firmware interface and embeds depend on any particular firmware interface and embeds
a device tree blob. This image is a flat binary that a device tree blob. This image is a flat binary that
...@@ -61,14 +69,16 @@ Currently, the following image format targets exist: ...@@ -61,14 +69,16 @@ Currently, the following image format targets exist:
Firmware cannot pass any configuration data to the Firmware cannot pass any configuration data to the
kernel with this image type and it depends entirely on kernel with this image type and it depends entirely on
the embedded device tree for all information. the embedded device tree for all information.
The simpleImage is useful for booting systems with
The simpleImage is useful for booting systems with
an unknown firmware interface or for booting from an unknown firmware interface or for booting from
a debugger when no firmware is present (such as on a debugger when no firmware is present (such as on
the Xilinx Virtex platform). The only assumption that the Xilinx Virtex platform). The only assumption that
simpleImage makes is that RAM is correctly initialized simpleImage makes is that RAM is correctly initialized
and that the MMU is either off or has RAM mapped to and that the MMU is either off or has RAM mapped to
base address 0. base address 0.
simpleImage also supports inserting special platform
simpleImage also supports inserting special platform
specific initialization code to the start of the bootup specific initialization code to the start of the bootup
sequence. The virtex405 platform uses this feature to sequence. The virtex405 platform uses this feature to
ensure that the cache is invalidated before caching ensure that the cache is invalidated before caching
...@@ -81,9 +91,11 @@ Currently, the following image format targets exist: ...@@ -81,9 +91,11 @@ Currently, the following image format targets exist:
named (virtex405-<board>.dts). Search the wrapper named (virtex405-<board>.dts). Search the wrapper
script for 'virtex405' and see the file script for 'virtex405' and see the file
arch/powerpc/boot/virtex405-head.S for details. arch/powerpc/boot/virtex405-head.S for details.
treeImage.%; Image format for used with OpenBIOS firmware found treeImage.%; Image format for used with OpenBIOS firmware found
on some ppc4xx hardware. This image embeds a device on some ppc4xx hardware. This image embeds a device
tree blob inside the image. tree blob inside the image.
uImage: Native image format used by U-Boot. The uImage target uImage: Native image format used by U-Boot. The uImage target
does not add any boot code. It just wraps a compressed does not add any boot code. It just wraps a compressed
vmlinux in the uImage data structure. This image vmlinux in the uImage data structure. This image
...@@ -91,12 +103,14 @@ Currently, the following image format targets exist: ...@@ -91,12 +103,14 @@ Currently, the following image format targets exist:
a device tree to the kernel at boot. If using an older a device tree to the kernel at boot. If using an older
version of U-Boot, then you need to use a cuImage version of U-Boot, then you need to use a cuImage
instead. instead.
zImage.%: Image format which does not embed a device tree. zImage.%: Image format which does not embed a device tree.
Used by OpenFirmware and other firmware interfaces Used by OpenFirmware and other firmware interfaces
which are able to supply a device tree. This image which are able to supply a device tree. This image
expects firmware to provide the device tree at boot. expects firmware to provide the device tree at boot.
Typically, if you have general purpose PowerPC Typically, if you have general purpose PowerPC
hardware then you want this image format. hardware then you want this image format.
==================== ========================================================
Image types which embed a device tree blob (simpleImage, dtbImage, treeImage, Image types which embed a device tree blob (simpleImage, dtbImage, treeImage,
and cuImage) all generate the device tree blob from a file in the and cuImage) all generate the device tree blob from a file in the
......
============
CPU Families CPU Families
============ ============
...@@ -8,8 +9,8 @@ and are supported by arch/powerpc. ...@@ -8,8 +9,8 @@ and are supported by arch/powerpc.
Book3S (aka sPAPR) Book3S (aka sPAPR)
------------------ ------------------
- Hash MMU - Hash MMU
- Mix of 32 & 64 bit - Mix of 32 & 64 bit::
+--------------+ +----------------+ +--------------+ +----------------+
| Old POWER | --------------> | RS64 (threads) | | Old POWER | --------------> | RS64 (threads) |
...@@ -108,8 +109,8 @@ Book3S (aka sPAPR) ...@@ -108,8 +109,8 @@ Book3S (aka sPAPR)
IBM BookE IBM BookE
--------- ---------
- Software loaded TLB. - Software loaded TLB.
- All 32 bit - All 32 bit::
+--------------+ +--------------+
| 401 | | 401 |
...@@ -155,8 +156,8 @@ IBM BookE ...@@ -155,8 +156,8 @@ IBM BookE
Motorola/Freescale 8xx Motorola/Freescale 8xx
---------------------- ----------------------
- Software loaded with hardware assist. - Software loaded with hardware assist.
- All 32 bit - All 32 bit::
+-------------+ +-------------+
| MPC8xx Core | | MPC8xx Core |
...@@ -166,9 +167,9 @@ Motorola/Freescale 8xx ...@@ -166,9 +167,9 @@ Motorola/Freescale 8xx
Freescale BookE Freescale BookE
--------------- ---------------
- Software loaded TLB. - Software loaded TLB.
- e6500 adds HW loaded indirect TLB entries. - e6500 adds HW loaded indirect TLB entries.
- Mix of 32 & 64 bit - Mix of 32 & 64 bit::
+--------------+ +--------------+
| e200 | | e200 |
...@@ -207,8 +208,8 @@ Freescale BookE ...@@ -207,8 +208,8 @@ Freescale BookE
IBM A2 core IBM A2 core
----------- -----------
- Book3E, software loaded TLB + HW loaded indirect TLB entries. - Book3E, software loaded TLB + HW loaded indirect TLB entries.
- 64 bit - 64 bit::
+--------------+ +----------------+ +--------------+ +----------------+
| A2 core | --> | WSP | | A2 core | --> | WSP |
......
============
CPU Features
============
Hollis Blanchard <hollis@austin.ibm.com> Hollis Blanchard <hollis@austin.ibm.com>
5 Jun 2002 5 Jun 2002
...@@ -32,7 +36,7 @@ anyways). ...@@ -32,7 +36,7 @@ anyways).
After detecting the processor type, the kernel patches out sections of code After detecting the processor type, the kernel patches out sections of code
that shouldn't be used by writing nop's over it. Using cpufeatures requires that shouldn't be used by writing nop's over it. Using cpufeatures requires
just 2 macros (found in arch/powerpc/include/asm/cputable.h), as seen in head.S just 2 macros (found in arch/powerpc/include/asm/cputable.h), as seen in head.S
transfer_to_handler: transfer_to_handler::
#ifdef CONFIG_ALTIVEC #ifdef CONFIG_ALTIVEC
BEGIN_FTR_SECTION BEGIN_FTR_SECTION
......
====================================
Coherent Accelerator Interface (CXL) Coherent Accelerator Interface (CXL)
==================================== ====================================
...@@ -21,6 +22,8 @@ Introduction ...@@ -21,6 +22,8 @@ Introduction
Hardware overview Hardware overview
================= =================
::
POWER8/9 FPGA POWER8/9 FPGA
+----------+ +---------+ +----------+ +---------+
| | | | | | | |
...@@ -59,14 +62,16 @@ Hardware overview ...@@ -59,14 +62,16 @@ Hardware overview
the fault. The context to which this fault is serviced is based on the fault. The context to which this fault is serviced is based on
who owns that acceleration function. who owns that acceleration function.
POWER8 <-----> PSL Version 8 is compliant to the CAIA Version 1.0. - POWER8 and PSL Version 8 are compliant to the CAIA Version 1.0.
POWER9 <-----> PSL Version 9 is compliant to the CAIA Version 2.0. - POWER9 and PSL Version 9 are compliant to the CAIA Version 2.0.
This PSL Version 9 provides new features such as: This PSL Version 9 provides new features such as:
* Interaction with the nest MMU on the P9 chip. * Interaction with the nest MMU on the P9 chip.
* Native DMA support. * Native DMA support.
* Supports sending ASB_Notify messages for host thread wakeup. * Supports sending ASB_Notify messages for host thread wakeup.
* Supports Atomic operations. * Supports Atomic operations.
* .... * etc.
Cards with a PSL9 won't work on a POWER8 system and cards with a Cards with a PSL9 won't work on a POWER8 system and cards with a
PSL8 won't work on a POWER9 system. PSL8 won't work on a POWER9 system.
...@@ -147,7 +152,9 @@ User API ...@@ -147,7 +152,9 @@ User API
master devices. master devices.
A userspace library libcxl is available here: A userspace library libcxl is available here:
https://github.com/ibm-capi/libcxl https://github.com/ibm-capi/libcxl
This provides a C interface to this kernel API. This provides a C interface to this kernel API.
open open
...@@ -165,7 +172,8 @@ open ...@@ -165,7 +172,8 @@ open
When all available contexts are allocated the open call will fail When all available contexts are allocated the open call will fail
and return -ENOSPC. and return -ENOSPC.
Note: IRQs need to be allocated for each context, which may limit Note:
IRQs need to be allocated for each context, which may limit
the number of contexts that can be created, and therefore the number of contexts that can be created, and therefore
how many times the device can be opened. The POWER8 CAPP how many times the device can be opened. The POWER8 CAPP
supports 2040 IRQs and 3 are used by the kernel, so 2037 are supports 2040 IRQs and 3 are used by the kernel, so 2037 are
...@@ -186,7 +194,9 @@ ioctl ...@@ -186,7 +194,9 @@ ioctl
updated as userspace allocates and frees memory. This ioctl updated as userspace allocates and frees memory. This ioctl
returns once the AFU context is started. returns once the AFU context is started.
Takes a pointer to a struct cxl_ioctl_start_work: Takes a pointer to a struct cxl_ioctl_start_work
::
struct cxl_ioctl_start_work { struct cxl_ioctl_start_work {
__u64 flags; __u64 flags;
...@@ -269,7 +279,7 @@ read ...@@ -269,7 +279,7 @@ read
The buffer passed to read() must be at least 4K bytes. The buffer passed to read() must be at least 4K bytes.
The result of the read will be a buffer of one or more events, The result of the read will be a buffer of one or more events,
each event is of type struct cxl_event, of varying size. each event is of type struct cxl_event, of varying size::
struct cxl_event { struct cxl_event {
struct cxl_event_header header; struct cxl_event_header header;
...@@ -280,7 +290,9 @@ read ...@@ -280,7 +290,9 @@ read
}; };
}; };
The struct cxl_event_header is defined as: The struct cxl_event_header is defined as
::
struct cxl_event_header { struct cxl_event_header {
__u16 type; __u16 type;
...@@ -307,7 +319,9 @@ read ...@@ -307,7 +319,9 @@ read
For future extensions and padding. For future extensions and padding.
If the event type is CXL_EVENT_AFU_INTERRUPT then the event If the event type is CXL_EVENT_AFU_INTERRUPT then the event
structure is defined as: structure is defined as
::
struct cxl_event_afu_interrupt { struct cxl_event_afu_interrupt {
__u16 flags; __u16 flags;
...@@ -326,7 +340,9 @@ read ...@@ -326,7 +340,9 @@ read
For future extensions and padding. For future extensions and padding.
If the event type is CXL_EVENT_DATA_STORAGE then the event If the event type is CXL_EVENT_DATA_STORAGE then the event
structure is defined as: structure is defined as
::
struct cxl_event_data_storage { struct cxl_event_data_storage {
__u16 flags; __u16 flags;
...@@ -356,7 +372,9 @@ read ...@@ -356,7 +372,9 @@ read
For future extensions For future extensions
If the event type is CXL_EVENT_AFU_ERROR then the event structure If the event type is CXL_EVENT_AFU_ERROR then the event structure
is defined as: is defined as
::
struct cxl_event_afu_error { struct cxl_event_afu_error {
__u16 flags; __u16 flags;
...@@ -393,15 +411,15 @@ open ...@@ -393,15 +411,15 @@ open
ioctl ioctl
----- -----
CXL_IOCTL_DOWNLOAD_IMAGE: CXL_IOCTL_DOWNLOAD_IMAGE / CXL_IOCTL_VALIDATE_IMAGE:
CXL_IOCTL_VALIDATE_IMAGE:
Starts and controls flashing a new FPGA image. Partial Starts and controls flashing a new FPGA image. Partial
reconfiguration is not supported (yet), so the image must contain reconfiguration is not supported (yet), so the image must contain
a copy of the PSL and AFU(s). Since an image can be quite large, a copy of the PSL and AFU(s). Since an image can be quite large,
the caller may have to iterate, splitting the image in smaller the caller may have to iterate, splitting the image in smaller
chunks. chunks.
Takes a pointer to a struct cxl_adapter_image: Takes a pointer to a struct cxl_adapter_image::
struct cxl_adapter_image { struct cxl_adapter_image {
__u64 flags; __u64 flags;
__u64 data; __u64 data;
...@@ -442,7 +460,7 @@ Udev rules ...@@ -442,7 +460,7 @@ Udev rules
The following udev rules could be used to create a symlink to the The following udev rules could be used to create a symlink to the
most logical chardev to use in any programming mode (afuX.Yd for most logical chardev to use in any programming mode (afuX.Yd for
dedicated, afuX.Ys for afu directed), since the API is virtually dedicated, afuX.Ys for afu directed), since the API is virtually
identical for each: identical for each::
SUBSYSTEM=="cxl", ATTRS{mode}=="dedicated_process", SYMLINK="cxl/%b" SUBSYSTEM=="cxl", ATTRS{mode}=="dedicated_process", SYMLINK="cxl/%b"
SUBSYSTEM=="cxl", ATTRS{mode}=="afu_directed", \ SUBSYSTEM=="cxl", ATTRS{mode}=="afu_directed", \
......
================================
Coherent Accelerator (CXL) Flash
================================
Introduction Introduction
============ ============
...@@ -28,7 +32,7 @@ Introduction ...@@ -28,7 +32,7 @@ Introduction
responsible for the initialization of the adapter, setting up the responsible for the initialization of the adapter, setting up the
special path for user space access, and performing error recovery. It special path for user space access, and performing error recovery. It
communicates directly the Flash Accelerator Functional Unit (AFU) communicates directly the Flash Accelerator Functional Unit (AFU)
as described in Documentation/powerpc/cxl.txt. as described in Documentation/powerpc/cxl.rst.
The cxlflash driver supports two, mutually exclusive, modes of The cxlflash driver supports two, mutually exclusive, modes of
operation at the device (LUN) level: operation at the device (LUN) level:
...@@ -58,7 +62,7 @@ Overview ...@@ -58,7 +62,7 @@ Overview
The CXL Flash Adapter Driver establishes a master context with the The CXL Flash Adapter Driver establishes a master context with the
AFU. It uses memory mapped I/O (MMIO) for this control and setup. The AFU. It uses memory mapped I/O (MMIO) for this control and setup. The
Adapter Problem Space Memory Map looks like this: Adapter Problem Space Memory Map looks like this::
+-------------------------------+ +-------------------------------+
| 512 * 64 KB User MMIO | | 512 * 64 KB User MMIO |
...@@ -375,7 +379,7 @@ CXL Flash Driver Host IOCTLs ...@@ -375,7 +379,7 @@ CXL Flash Driver Host IOCTLs
Each host adapter instance that is supported by the cxlflash driver Each host adapter instance that is supported by the cxlflash driver
has a special character device associated with it to enable a set of has a special character device associated with it to enable a set of
host management function. These character devices are hosted in a host management function. These character devices are hosted in a
class dedicated for cxlflash and can be accessed via /dev/cxlflash/*. class dedicated for cxlflash and can be accessed via `/dev/cxlflash/*`.
Applications can be written to perform various functions using the Applications can be written to perform various functions using the
host ioctl APIs below. host ioctl APIs below.
......
=====================
DAWR issues on POWER9 DAWR issues on POWER9
============================ =====================
On POWER9 the Data Address Watchpoint Register (DAWR) can cause a checkstop On POWER9 the Data Address Watchpoint Register (DAWR) can cause a checkstop
if it points to cache inhibited (CI) memory. Currently Linux has no way to if it points to cache inhibited (CI) memory. Currently Linux has no way to
disinguish CI memory when configuring the DAWR, so (for now) the DAWR is disinguish CI memory when configuring the DAWR, so (for now) the DAWR is
disabled by this commit: disabled by this commit::
commit 9654153158d3e0684a1bdb76dbababdb7111d5a0 commit 9654153158d3e0684a1bdb76dbababdb7111d5a0
Author: Michael Neuling <mikey@neuling.org> Author: Michael Neuling <mikey@neuling.org>
...@@ -12,7 +13,7 @@ disabled by this commit: ...@@ -12,7 +13,7 @@ disabled by this commit:
powerpc: Disable DAWR in the base POWER9 CPU features powerpc: Disable DAWR in the base POWER9 CPU features
Technical Details: Technical Details:
============================ ==================
DAWR has 6 different ways of being set. DAWR has 6 different ways of being set.
1) ptrace 1) ptrace
...@@ -37,7 +38,7 @@ DAWR on the migration. ...@@ -37,7 +38,7 @@ DAWR on the migration.
For xmon, the 'bd' command will return an error on P9. For xmon, the 'bd' command will return an error on P9.
Consequences for users Consequences for users
============================ ======================
For GDB watchpoints (ie 'watch' command) on POWER9 bare metal , GDB For GDB watchpoints (ie 'watch' command) on POWER9 bare metal , GDB
will accept the command. Unfortunately since there is no hardware will accept the command. Unfortunately since there is no hardware
...@@ -57,8 +58,8 @@ trapped in GDB. The watchpoint is remembered, so if the guest is ...@@ -57,8 +58,8 @@ trapped in GDB. The watchpoint is remembered, so if the guest is
migrated back to the POWER8 host, it will start working again. migrated back to the POWER8 host, it will start working again.
Force enabling the DAWR Force enabling the DAWR
============================= =======================
Kernels (since ~v5.2) have an option to force enable the DAWR via: Kernels (since ~v5.2) have an option to force enable the DAWR via::
echo Y > /sys/kernel/debug/powerpc/dawr_enable_dangerous echo Y > /sys/kernel/debug/powerpc/dawr_enable_dangerous
...@@ -86,5 +87,7 @@ dawr_enable_dangerous file will fail if the hypervisor doesn't support ...@@ -86,5 +87,7 @@ dawr_enable_dangerous file will fail if the hypervisor doesn't support
writing the DAWR. writing the DAWR.
To double check the DAWR is working, run this kernel selftest: To double check the DAWR is working, run this kernel selftest:
tools/testing/selftests/powerpc/ptrace/ptrace-hwbreak.c tools/testing/selftests/powerpc/ptrace/ptrace-hwbreak.c
Any errors/failures/skips mean something is wrong. Any errors/failures/skips mean something is wrong.
DSCR (Data Stream Control Register) ===================================
================================================ DSCR (Data Stream Control Register)
===================================
DSCR register in powerpc allows user to have some control of prefetch of data DSCR register in powerpc allows user to have some control of prefetch of data
stream in the processor. Please refer to the ISA documents or related manual stream in the processor. Please refer to the ISA documents or related manual
...@@ -10,14 +11,17 @@ user interface. ...@@ -10,14 +11,17 @@ user interface.
(A) Data Structures: (A) Data Structures:
(1) thread_struct: (1) thread_struct::
dscr /* Thread DSCR value */ dscr /* Thread DSCR value */
dscr_inherit /* Thread has changed default DSCR */ dscr_inherit /* Thread has changed default DSCR */
(2) PACA: (2) PACA::
dscr_default /* per-CPU DSCR default value */ dscr_default /* per-CPU DSCR default value */
(3) sysfs.c: (3) sysfs.c::
dscr_default /* System DSCR default value */ dscr_default /* System DSCR default value */
(B) Scheduler Changes: (B) Scheduler Changes:
...@@ -35,8 +39,8 @@ user interface. ...@@ -35,8 +39,8 @@ user interface.
(C) SYSFS Interface: (C) SYSFS Interface:
Global DSCR default: /sys/devices/system/cpu/dscr_default - Global DSCR default: /sys/devices/system/cpu/dscr_default
CPU specific DSCR default: /sys/devices/system/cpu/cpuN/dscr - CPU specific DSCR default: /sys/devices/system/cpu/cpuN/dscr
Changing the global DSCR default in the sysfs will change all the CPU Changing the global DSCR default in the sysfs will change all the CPU
specific DSCR defaults immediately in their PACA structures. Again if specific DSCR defaults immediately in their PACA structures. Again if
......
==========================
PCI Bus EEH Error Recovery
==========================
Linas Vepstas <linas@austin.ibm.com>
PCI Bus EEH Error Recovery 12 January 2005
--------------------------
Linas Vepstas
<linas@austin.ibm.com>
12 January 2005
Overview: Overview:
...@@ -143,17 +143,17 @@ seen in /proc/ppc64/eeh (subject to change). Normally, almost ...@@ -143,17 +143,17 @@ seen in /proc/ppc64/eeh (subject to change). Normally, almost
all of these occur during boot, when the PCI bus is scanned, where all of these occur during boot, when the PCI bus is scanned, where
a large number of 0xff reads are part of the bus scan procedure. a large number of 0xff reads are part of the bus scan procedure.
If a frozen slot is detected, code in If a frozen slot is detected, code in
arch/powerpc/platforms/pseries/eeh.c will print a stack trace to arch/powerpc/platforms/pseries/eeh.c will print a stack trace to
syslog (/var/log/messages). This stack trace has proven to be very syslog (/var/log/messages). This stack trace has proven to be very
useful to device-driver authors for finding out at what point the EEH useful to device-driver authors for finding out at what point the EEH
error was detected, as the error itself usually occurs slightly error was detected, as the error itself usually occurs slightly
beforehand. beforehand.
Next, it uses the Linux kernel notifier chain/work queue mechanism to Next, it uses the Linux kernel notifier chain/work queue mechanism to
allow any interested parties to find out about the failure. Device allow any interested parties to find out about the failure. Device
drivers, or other parts of the kernel, can use drivers, or other parts of the kernel, can use
eeh_register_notifier(struct notifier_block *) to find out about EEH `eeh_register_notifier(struct notifier_block *)` to find out about EEH
events. The event will include a pointer to the pci device, the events. The event will include a pointer to the pci device, the
device node and some state info. Receivers of the event can "do as device node and some state info. Receivers of the event can "do as
they wish"; the default handler will be described further in this they wish"; the default handler will be described further in this
...@@ -162,10 +162,13 @@ section. ...@@ -162,10 +162,13 @@ section.
To assist in the recovery of the device, eeh.c exports the To assist in the recovery of the device, eeh.c exports the
following functions: following functions:
rtas_set_slot_reset() -- assert the PCI #RST line for 1/8th of a second rtas_set_slot_reset()
rtas_configure_bridge() -- ask firmware to configure any PCI bridges assert the PCI #RST line for 1/8th of a second
rtas_configure_bridge()
ask firmware to configure any PCI bridges
located topologically under the pci slot. located topologically under the pci slot.
eeh_save_bars() and eeh_restore_bars(): save and restore the PCI eeh_save_bars() and eeh_restore_bars():
save and restore the PCI
config-space info for a device and any devices under it. config-space info for a device and any devices under it.
...@@ -191,7 +194,7 @@ events get delivered to user-space scripts. ...@@ -191,7 +194,7 @@ events get delivered to user-space scripts.
Following is an example sequence of events that cause a device driver Following is an example sequence of events that cause a device driver
close function to be called during the first phase of an EEH reset. close function to be called during the first phase of an EEH reset.
The following sequence is an example of the pcnet32 device driver. The following sequence is an example of the pcnet32 device driver::
rpa_php_unconfig_pci_adapter (struct slot *) // in rpaphp_pci.c rpa_php_unconfig_pci_adapter (struct slot *) // in rpaphp_pci.c
{ {
...@@ -241,53 +244,54 @@ The following sequence is an example of the pcnet32 device driver. ...@@ -241,53 +244,54 @@ The following sequence is an example of the pcnet32 device driver.
}}}}}} }}}}}}
in drivers/pci/pci_driver.c, in drivers/pci/pci_driver.c,
struct device_driver->remove() is just pci_device_remove() struct device_driver->remove() is just pci_device_remove()
which calls struct pci_driver->remove() which is pcnet32_remove_one() which calls struct pci_driver->remove() which is pcnet32_remove_one()
which calls unregister_netdev() (in net/core/dev.c) which calls unregister_netdev() (in net/core/dev.c)
which calls dev_close() (in net/core/dev.c) which calls dev_close() (in net/core/dev.c)
which calls dev->stop() which is pcnet32_close() which calls dev->stop() which is pcnet32_close()
which then does the appropriate shutdown. which then does the appropriate shutdown.
--- ---
Following is the analogous stack trace for events sent to user-space Following is the analogous stack trace for events sent to user-space
when the pci device is unconfigured. when the pci device is unconfigured::
rpa_php_unconfig_pci_adapter() { // in rpaphp_pci.c rpa_php_unconfig_pci_adapter() { // in rpaphp_pci.c
calls
pci_remove_bus_device (struct pci_dev *) { // in /drivers/pci/remove.c
calls calls
pci_destroy_dev (struct pci_dev *) { pci_remove_bus_device (struct pci_dev *) { // in /drivers/pci/remove.c
calls calls
device_unregister (&dev->dev) { // in /drivers/base/core.c pci_destroy_dev (struct pci_dev *) {
calls calls
device_del(struct device * dev) { // in /drivers/base/core.c device_unregister (&dev->dev) { // in /drivers/base/core.c
calls calls
kobject_del() { //in /libs/kobject.c device_del(struct device * dev) { // in /drivers/base/core.c
calls calls
kobject_uevent() { // in /libs/kobject.c kobject_del() { //in /libs/kobject.c
calls calls
kset_uevent() { // in /lib/kobject.c kobject_uevent() { // in /libs/kobject.c
calls calls
kset->uevent_ops->uevent() // which is really just kset_uevent() { // in /lib/kobject.c
a call to
dev_uevent() { // in /drivers/base/core.c
calls calls
dev->bus->uevent() which is really just a call to kset->uevent_ops->uevent() // which is really just
pci_uevent () { // in drivers/pci/hotplug.c a call to
which prints device name, etc.... dev_uevent() { // in /drivers/base/core.c
calls
dev->bus->uevent() which is really just a call to
pci_uevent () { // in drivers/pci/hotplug.c
which prints device name, etc....
}
} }
} then kobject_uevent() sends a netlink uevent to userspace
then kobject_uevent() sends a netlink uevent to userspace --> userspace uevent
--> userspace uevent (during early boot, nobody listens to netlink events and
(during early boot, nobody listens to netlink events and kobject_uevent() executes uevent_helper[], which runs the
kobject_uevent() executes uevent_helper[], which runs the event process /sbin/hotplug)
event process /sbin/hotplug) }
} }
} kobject_del() then calls sysfs_remove_dir(), which would
kobject_del() then calls sysfs_remove_dir(), which would trigger any user-space daemon that was watching /sysfs,
trigger any user-space daemon that was watching /sysfs, and notice the delete event.
and notice the delete event.
Pro's and Con's of the Current Design Pro's and Con's of the Current Design
...@@ -299,12 +303,12 @@ individual device drivers, so that the current design throws a wide net. ...@@ -299,12 +303,12 @@ individual device drivers, so that the current design throws a wide net.
The biggest negative of the design is that it potentially disturbs The biggest negative of the design is that it potentially disturbs
network daemons and file systems that didn't need to be disturbed. network daemons and file systems that didn't need to be disturbed.
-- A minor complaint is that resetting the network card causes - A minor complaint is that resetting the network card causes
user-space back-to-back ifdown/ifup burps that potentially disturb user-space back-to-back ifdown/ifup burps that potentially disturb
network daemons, that didn't need to even know that the pci network daemons, that didn't need to even know that the pci
card was being rebooted. card was being rebooted.
-- A more serious concern is that the same reset, for SCSI devices, - A more serious concern is that the same reset, for SCSI devices,
causes havoc to mounted file systems. Scripts cannot post-facto causes havoc to mounted file systems. Scripts cannot post-facto
unmount a file system without flushing pending buffers, but this unmount a file system without flushing pending buffers, but this
is impossible, because I/O has already been stopped. Thus, is impossible, because I/O has already been stopped. Thus,
...@@ -322,7 +326,7 @@ network daemons and file systems that didn't need to be disturbed. ...@@ -322,7 +326,7 @@ network daemons and file systems that didn't need to be disturbed.
from the block layer. It would be very natural to add an EEH from the block layer. It would be very natural to add an EEH
reset into this chain of events. reset into this chain of events.
-- If a SCSI error occurs for the root device, all is lost unless - If a SCSI error occurs for the root device, all is lost unless
the sysadmin had the foresight to run /bin, /sbin, /etc, /var the sysadmin had the foresight to run /bin, /sbin, /etc, /var
and so on, out of ramdisk/tmpfs. and so on, out of ramdisk/tmpfs.
...@@ -330,5 +334,3 @@ network daemons and file systems that didn't need to be disturbed. ...@@ -330,5 +334,3 @@ network daemons and file systems that didn't need to be disturbed.
Conclusions Conclusions
----------- -----------
There's forward progress ... There's forward progress ...
.. SPDX-License-Identifier: GPL-2.0
=======
powerpc
=======
.. toctree::
:maxdepth: 1
bootwrapper
cpu_families
cpu_features
cxl
cxlflash
dawr-power9
dscr
eeh-pci-error-recovery
firmware-assisted-dump
hvcs
isa-versions
mpc52xx
pci_iov_resource_on_powernv
pmu-ebb
ptrace
qe_firmware
syscall64-abi
transactional_memory
.. only:: subproject and html
Indices
=======
* :ref:`genindex`
:orphan: ==========================
CPU to ISA Version Mapping CPU to ISA Version Mapping
========================== ==========================
Mapping of some CPU versions to relevant ISA versions. Mapping of some CPU versions to relevant ISA versions.
========= ==================== ========= ====================================================================
CPU Architecture version CPU Architecture version
========= ==================== ========= ====================================================================
Power9 Power ISA v3.0B Power9 Power ISA v3.0B
Power8 Power ISA v2.07 Power8 Power ISA v2.07
Power7 Power ISA v2.06 Power7 Power ISA v2.06
...@@ -24,7 +23,7 @@ PPC970 - PowerPC User Instruction Set Architecture Book I v2.01 ...@@ -24,7 +23,7 @@ PPC970 - PowerPC User Instruction Set Architecture Book I v2.01
- PowerPC Virtual Environment Architecture Book II v2.01 - PowerPC Virtual Environment Architecture Book II v2.01
- PowerPC Operating Environment Architecture Book III v2.01 - PowerPC Operating Environment Architecture Book III v2.01
- Plus Altivec/VMX ~= 2.03 - Plus Altivec/VMX ~= 2.03
========= ==================== ========= ====================================================================
Key Features Key Features
...@@ -60,9 +59,9 @@ Power5 No ...@@ -60,9 +59,9 @@ Power5 No
PPC970 No PPC970 No
========== ==== ========== ====
========== ==================== ========== ====================================
CPU Transactional Memory CPU Transactional Memory
========== ==================== ========== ====================================
Power9 Yes (* see transactional_memory.txt) Power9 Yes (* see transactional_memory.txt)
Power8 Yes Power8 Yes
Power7 No Power7 No
...@@ -73,4 +72,4 @@ Power5++ No ...@@ -73,4 +72,4 @@ Power5++ No
Power5+ No Power5+ No
Power5 No Power5 No
PPC970 No PPC970 No
========== ==================== ========== ====================================
=============================
Linux 2.6.x on MPC52xx family Linux 2.6.x on MPC52xx family
----------------------------- =============================
For the latest info, go to http://www.246tNt.com/mpc52xx/ For the latest info, go to http://www.246tNt.com/mpc52xx/
To compile/use : To compile/use :
- U-Boot: - U-Boot::
# <edit Makefile to set ARCH=ppc & CROSS_COMPILE=... ( also EXTRAVERSION # <edit Makefile to set ARCH=ppc & CROSS_COMPILE=... ( also EXTRAVERSION
if you wish to ). if you wish to ).
# make lite5200_defconfig # make lite5200_defconfig
...@@ -16,7 +18,8 @@ To compile/use : ...@@ -16,7 +18,8 @@ To compile/use :
=> tftpboot 400000 pRamdisk => tftpboot 400000 pRamdisk
=> bootm 200000 400000 => bootm 200000 400000
- DBug: - DBug::
# <edit Makefile to set ARCH=ppc & CROSS_COMPILE=... ( also EXTRAVERSION # <edit Makefile to set ARCH=ppc & CROSS_COMPILE=... ( also EXTRAVERSION
if you wish to ). if you wish to ).
# make lite5200_defconfig # make lite5200_defconfig
...@@ -28,7 +31,8 @@ To compile/use : ...@@ -28,7 +31,8 @@ To compile/use :
DBug> dn -i zImage.initrd.lite5200 DBug> dn -i zImage.initrd.lite5200
Some remarks : Some remarks:
- The port is named mpc52xxx, and config options are PPC_MPC52xx. The MGT5100 - The port is named mpc52xxx, and config options are PPC_MPC52xx. The MGT5100
is not supported, and I'm not sure anyone is interesting in working on it is not supported, and I'm not sure anyone is interesting in working on it
so. I didn't took 5xxx because there's apparently a lot of 5xxx that have so. I didn't took 5xxx because there's apparently a lot of 5xxx that have
......
===================================================
PCI Express I/O Virtualization Resource on Powerenv
===================================================
Wei Yang <weiyang@linux.vnet.ibm.com> Wei Yang <weiyang@linux.vnet.ibm.com>
Benjamin Herrenschmidt <benh@au1.ibm.com> Benjamin Herrenschmidt <benh@au1.ibm.com>
Bjorn Helgaas <bhelgaas@google.com> Bjorn Helgaas <bhelgaas@google.com>
26 Aug 2014 26 Aug 2014
This document describes the requirement from hardware for PCI MMIO resource This document describes the requirement from hardware for PCI MMIO resource
...@@ -10,6 +17,7 @@ Endpoints and the implementation on P8 (IODA2). The next two sections talks ...@@ -10,6 +17,7 @@ Endpoints and the implementation on P8 (IODA2). The next two sections talks
about considerations on enabling SRIOV on IODA2. about considerations on enabling SRIOV on IODA2.
1. Introduction to Partitionable Endpoints 1. Introduction to Partitionable Endpoints
==========================================
A Partitionable Endpoint (PE) is a way to group the various resources A Partitionable Endpoint (PE) is a way to group the various resources
associated with a device or a set of devices to provide isolation between associated with a device or a set of devices to provide isolation between
...@@ -35,6 +43,7 @@ is a completely separate HW entity that replicates the entire logic, so has ...@@ -35,6 +43,7 @@ is a completely separate HW entity that replicates the entire logic, so has
its own set of PEs, etc. its own set of PEs, etc.
2. Implementation of Partitionable Endpoints on P8 (IODA2) 2. Implementation of Partitionable Endpoints on P8 (IODA2)
==========================================================
P8 supports up to 256 Partitionable Endpoints per PHB. P8 supports up to 256 Partitionable Endpoints per PHB.
...@@ -149,6 +158,7 @@ P8 supports up to 256 Partitionable Endpoints per PHB. ...@@ -149,6 +158,7 @@ P8 supports up to 256 Partitionable Endpoints per PHB.
sense, but we haven't done it yet. sense, but we haven't done it yet.
3. Considerations for SR-IOV on PowerKVM 3. Considerations for SR-IOV on PowerKVM
========================================
* SR-IOV Background * SR-IOV Background
...@@ -224,7 +234,7 @@ P8 supports up to 256 Partitionable Endpoints per PHB. ...@@ -224,7 +234,7 @@ P8 supports up to 256 Partitionable Endpoints per PHB.
IODA supports 256 PEs, so segmented windows contain 256 segments, so if IODA supports 256 PEs, so segmented windows contain 256 segments, so if
total_VFs is less than 256, we have the situation in Figure 1.0, where total_VFs is less than 256, we have the situation in Figure 1.0, where
segments [total_VFs, 255] of the M64 window may map to some MMIO range on segments [total_VFs, 255] of the M64 window may map to some MMIO range on
other devices: other devices::
0 1 total_VFs - 1 0 1 total_VFs - 1
+------+------+- -+------+------+ +------+------+- -+------+------+
...@@ -243,7 +253,7 @@ P8 supports up to 256 Partitionable Endpoints per PHB. ...@@ -243,7 +253,7 @@ P8 supports up to 256 Partitionable Endpoints per PHB.
Figure 1.0 Direct map VF(n) BAR space Figure 1.0 Direct map VF(n) BAR space
Our current solution is to allocate 256 segments even if the VF(n) BAR Our current solution is to allocate 256 segments even if the VF(n) BAR
space doesn't need that much, as shown in Figure 1.1: space doesn't need that much, as shown in Figure 1.1::
0 1 total_VFs - 1 255 0 1 total_VFs - 1 255
+------+------+- -+------+------+- -+------+------+ +------+------+- -+------+------+- -+------+------+
...@@ -269,6 +279,7 @@ P8 supports up to 256 Partitionable Endpoints per PHB. ...@@ -269,6 +279,7 @@ P8 supports up to 256 Partitionable Endpoints per PHB.
responds to segments [total_VFs, 255]. responds to segments [total_VFs, 255].
4. Implications for the Generic PCI Code 4. Implications for the Generic PCI Code
========================================
The PCIe SR-IOV spec requires that the base of the VF(n) BAR space be The PCIe SR-IOV spec requires that the base of the VF(n) BAR space be
aligned to the size of an individual VF BAR. aligned to the size of an individual VF BAR.
......
========================
PMU Event Based Branches PMU Event Based Branches
======================== ========================
......
======
Ptrace
======
GDB intends to support the following hardware debug features of BookE GDB intends to support the following hardware debug features of BookE
processors: processors:
...@@ -12,6 +16,7 @@ that GDB doesn't need to special-case each of them. We added the ...@@ -12,6 +16,7 @@ that GDB doesn't need to special-case each of them. We added the
following 3 new ptrace requests. following 3 new ptrace requests.
1. PTRACE_PPC_GETHWDEBUGINFO 1. PTRACE_PPC_GETHWDEBUGINFO
============================
Query for GDB to discover the hardware debug features. The main info to Query for GDB to discover the hardware debug features. The main info to
be returned here is the minimum alignment for the hardware watchpoints. be returned here is the minimum alignment for the hardware watchpoints.
...@@ -22,9 +27,9 @@ adding special cases to GDB based on what it sees in AUXV. ...@@ -22,9 +27,9 @@ adding special cases to GDB based on what it sees in AUXV.
Since we're at it, we added other useful info that the kernel can return to Since we're at it, we added other useful info that the kernel can return to
GDB: this query will return the number of hardware breakpoints, hardware GDB: this query will return the number of hardware breakpoints, hardware
watchpoints and whether it supports a range of addresses and a condition. watchpoints and whether it supports a range of addresses and a condition.
The query will fill the following structure provided by the requesting process: The query will fill the following structure provided by the requesting process::
struct ppc_debug_info { struct ppc_debug_info {
unit32_t version; unit32_t version;
unit32_t num_instruction_bps; unit32_t num_instruction_bps;
unit32_t num_data_bps; unit32_t num_data_bps;
...@@ -32,46 +37,46 @@ struct ppc_debug_info { ...@@ -32,46 +37,46 @@ struct ppc_debug_info {
unit32_t data_bp_alignment; unit32_t data_bp_alignment;
unit32_t sizeof_condition; /* size of the DVC register */ unit32_t sizeof_condition; /* size of the DVC register */
uint64_t features; /* bitmask of the individual flags */ uint64_t features; /* bitmask of the individual flags */
}; };
features will have bits indicating whether there is support for: features will have bits indicating whether there is support for::
#define PPC_DEBUG_FEATURE_INSN_BP_RANGE 0x1 #define PPC_DEBUG_FEATURE_INSN_BP_RANGE 0x1
#define PPC_DEBUG_FEATURE_INSN_BP_MASK 0x2 #define PPC_DEBUG_FEATURE_INSN_BP_MASK 0x2
#define PPC_DEBUG_FEATURE_DATA_BP_RANGE 0x4 #define PPC_DEBUG_FEATURE_DATA_BP_RANGE 0x4
#define PPC_DEBUG_FEATURE_DATA_BP_MASK 0x8 #define PPC_DEBUG_FEATURE_DATA_BP_MASK 0x8
#define PPC_DEBUG_FEATURE_DATA_BP_DAWR 0x10 #define PPC_DEBUG_FEATURE_DATA_BP_DAWR 0x10
2. PTRACE_SETHWDEBUG 2. PTRACE_SETHWDEBUG
Sets a hardware breakpoint or watchpoint, according to the provided structure: Sets a hardware breakpoint or watchpoint, according to the provided structure::
struct ppc_hw_breakpoint { struct ppc_hw_breakpoint {
uint32_t version; uint32_t version;
#define PPC_BREAKPOINT_TRIGGER_EXECUTE 0x1 #define PPC_BREAKPOINT_TRIGGER_EXECUTE 0x1
#define PPC_BREAKPOINT_TRIGGER_READ 0x2 #define PPC_BREAKPOINT_TRIGGER_READ 0x2
#define PPC_BREAKPOINT_TRIGGER_WRITE 0x4 #define PPC_BREAKPOINT_TRIGGER_WRITE 0x4
uint32_t trigger_type; /* only some combinations allowed */ uint32_t trigger_type; /* only some combinations allowed */
#define PPC_BREAKPOINT_MODE_EXACT 0x0 #define PPC_BREAKPOINT_MODE_EXACT 0x0
#define PPC_BREAKPOINT_MODE_RANGE_INCLUSIVE 0x1 #define PPC_BREAKPOINT_MODE_RANGE_INCLUSIVE 0x1
#define PPC_BREAKPOINT_MODE_RANGE_EXCLUSIVE 0x2 #define PPC_BREAKPOINT_MODE_RANGE_EXCLUSIVE 0x2
#define PPC_BREAKPOINT_MODE_MASK 0x3 #define PPC_BREAKPOINT_MODE_MASK 0x3
uint32_t addr_mode; /* address match mode */ uint32_t addr_mode; /* address match mode */
#define PPC_BREAKPOINT_CONDITION_MODE 0x3 #define PPC_BREAKPOINT_CONDITION_MODE 0x3
#define PPC_BREAKPOINT_CONDITION_NONE 0x0 #define PPC_BREAKPOINT_CONDITION_NONE 0x0
#define PPC_BREAKPOINT_CONDITION_AND 0x1 #define PPC_BREAKPOINT_CONDITION_AND 0x1
#define PPC_BREAKPOINT_CONDITION_EXACT 0x1 /* different name for the same thing as above */ #define PPC_BREAKPOINT_CONDITION_EXACT 0x1 /* different name for the same thing as above */
#define PPC_BREAKPOINT_CONDITION_OR 0x2 #define PPC_BREAKPOINT_CONDITION_OR 0x2
#define PPC_BREAKPOINT_CONDITION_AND_OR 0x3 #define PPC_BREAKPOINT_CONDITION_AND_OR 0x3
#define PPC_BREAKPOINT_CONDITION_BE_ALL 0x00ff0000 /* byte enable bits */ #define PPC_BREAKPOINT_CONDITION_BE_ALL 0x00ff0000 /* byte enable bits */
#define PPC_BREAKPOINT_CONDITION_BE(n) (1<<((n)+16)) #define PPC_BREAKPOINT_CONDITION_BE(n) (1<<((n)+16))
uint32_t condition_mode; /* break/watchpoint condition flags */ uint32_t condition_mode; /* break/watchpoint condition flags */
uint64_t addr; uint64_t addr;
uint64_t addr2; uint64_t addr2;
uint64_t condition_value; uint64_t condition_value;
}; };
A request specifies one event, not necessarily just one register to be set. A request specifies one event, not necessarily just one register to be set.
For instance, if the request is for a watchpoint with a condition, both the For instance, if the request is for a watchpoint with a condition, both the
...@@ -88,61 +93,61 @@ can't be allocated on the registers. ...@@ -88,61 +93,61 @@ can't be allocated on the registers.
Some examples of using the structure to: Some examples of using the structure to:
- set a breakpoint in the first breakpoint register - set a breakpoint in the first breakpoint register::
p.version = PPC_DEBUG_CURRENT_VERSION; p.version = PPC_DEBUG_CURRENT_VERSION;
p.trigger_type = PPC_BREAKPOINT_TRIGGER_EXECUTE; p.trigger_type = PPC_BREAKPOINT_TRIGGER_EXECUTE;
p.addr_mode = PPC_BREAKPOINT_MODE_EXACT; p.addr_mode = PPC_BREAKPOINT_MODE_EXACT;
p.condition_mode = PPC_BREAKPOINT_CONDITION_NONE; p.condition_mode = PPC_BREAKPOINT_CONDITION_NONE;
p.addr = (uint64_t) address; p.addr = (uint64_t) address;
p.addr2 = 0; p.addr2 = 0;
p.condition_value = 0; p.condition_value = 0;
- set a watchpoint which triggers on reads in the second watchpoint register - set a watchpoint which triggers on reads in the second watchpoint register::
p.version = PPC_DEBUG_CURRENT_VERSION; p.version = PPC_DEBUG_CURRENT_VERSION;
p.trigger_type = PPC_BREAKPOINT_TRIGGER_READ; p.trigger_type = PPC_BREAKPOINT_TRIGGER_READ;
p.addr_mode = PPC_BREAKPOINT_MODE_EXACT; p.addr_mode = PPC_BREAKPOINT_MODE_EXACT;
p.condition_mode = PPC_BREAKPOINT_CONDITION_NONE; p.condition_mode = PPC_BREAKPOINT_CONDITION_NONE;
p.addr = (uint64_t) address; p.addr = (uint64_t) address;
p.addr2 = 0; p.addr2 = 0;
p.condition_value = 0; p.condition_value = 0;
- set a watchpoint which triggers only with a specific value - set a watchpoint which triggers only with a specific value::
p.version = PPC_DEBUG_CURRENT_VERSION; p.version = PPC_DEBUG_CURRENT_VERSION;
p.trigger_type = PPC_BREAKPOINT_TRIGGER_READ; p.trigger_type = PPC_BREAKPOINT_TRIGGER_READ;
p.addr_mode = PPC_BREAKPOINT_MODE_EXACT; p.addr_mode = PPC_BREAKPOINT_MODE_EXACT;
p.condition_mode = PPC_BREAKPOINT_CONDITION_AND | PPC_BREAKPOINT_CONDITION_BE_ALL; p.condition_mode = PPC_BREAKPOINT_CONDITION_AND | PPC_BREAKPOINT_CONDITION_BE_ALL;
p.addr = (uint64_t) address; p.addr = (uint64_t) address;
p.addr2 = 0; p.addr2 = 0;
p.condition_value = (uint64_t) condition; p.condition_value = (uint64_t) condition;
- set a ranged hardware breakpoint - set a ranged hardware breakpoint::
p.version = PPC_DEBUG_CURRENT_VERSION; p.version = PPC_DEBUG_CURRENT_VERSION;
p.trigger_type = PPC_BREAKPOINT_TRIGGER_EXECUTE; p.trigger_type = PPC_BREAKPOINT_TRIGGER_EXECUTE;
p.addr_mode = PPC_BREAKPOINT_MODE_RANGE_INCLUSIVE; p.addr_mode = PPC_BREAKPOINT_MODE_RANGE_INCLUSIVE;
p.condition_mode = PPC_BREAKPOINT_CONDITION_NONE; p.condition_mode = PPC_BREAKPOINT_CONDITION_NONE;
p.addr = (uint64_t) begin_range; p.addr = (uint64_t) begin_range;
p.addr2 = (uint64_t) end_range; p.addr2 = (uint64_t) end_range;
p.condition_value = 0; p.condition_value = 0;
- set a watchpoint in server processors (BookS) - set a watchpoint in server processors (BookS)::
p.version = 1; p.version = 1;
p.trigger_type = PPC_BREAKPOINT_TRIGGER_RW; p.trigger_type = PPC_BREAKPOINT_TRIGGER_RW;
p.addr_mode = PPC_BREAKPOINT_MODE_RANGE_INCLUSIVE; p.addr_mode = PPC_BREAKPOINT_MODE_RANGE_INCLUSIVE;
or or
p.addr_mode = PPC_BREAKPOINT_MODE_EXACT; p.addr_mode = PPC_BREAKPOINT_MODE_EXACT;
p.condition_mode = PPC_BREAKPOINT_CONDITION_NONE; p.condition_mode = PPC_BREAKPOINT_CONDITION_NONE;
p.addr = (uint64_t) begin_range; p.addr = (uint64_t) begin_range;
/* For PPC_BREAKPOINT_MODE_RANGE_INCLUSIVE addr2 needs to be specified, where /* For PPC_BREAKPOINT_MODE_RANGE_INCLUSIVE addr2 needs to be specified, where
* addr2 - addr <= 8 Bytes. * addr2 - addr <= 8 Bytes.
*/ */
p.addr2 = (uint64_t) end_range; p.addr2 = (uint64_t) end_range;
p.condition_value = 0; p.condition_value = 0;
3. PTRACE_DELHWDEBUG 3. PTRACE_DELHWDEBUG
......
Freescale QUICC Engine Firmware Uploading =========================================
----------------------------------------- Freescale QUICC Engine Firmware Uploading
=========================================
(c) 2007 Timur Tabi <timur at freescale.com>, (c) 2007 Timur Tabi <timur at freescale.com>,
Freescale Semiconductor Freescale Semiconductor
Table of Contents .. Table of Contents
=================
I - Software License for Firmware I - Software License for Firmware
II - Microcode Availability II - Microcode Availability
III - Description and Terminology III - Description and Terminology
IV - Microcode Programming Details IV - Microcode Programming Details
V - Firmware Structure Layout V - Firmware Structure Layout
VI - Sample Code for Creating Firmware Files VI - Sample Code for Creating Firmware Files
Revision Information Revision Information
==================== ====================
...@@ -39,7 +39,7 @@ http://opensource.freescale.com. For other firmware files, please contact ...@@ -39,7 +39,7 @@ http://opensource.freescale.com. For other firmware files, please contact
your Freescale representative or your operating system vendor. your Freescale representative or your operating system vendor.
III - Description and Terminology III - Description and Terminology
================================ =================================
In this document, the term 'microcode' refers to the sequence of 32-bit In this document, the term 'microcode' refers to the sequence of 32-bit
integers that compose the actual QE microcode. integers that compose the actual QE microcode.
...@@ -89,7 +89,7 @@ being fixed in the RAM package utilizing they should be activated. This data ...@@ -89,7 +89,7 @@ being fixed in the RAM package utilizing they should be activated. This data
structure signals the microcode which of these virtual traps is active. structure signals the microcode which of these virtual traps is active.
This structure contains 6 words that the application should copy to some This structure contains 6 words that the application should copy to some
specific been defined. This table describes the structure. specific been defined. This table describes the structure::
--------------------------------------------------------------- ---------------------------------------------------------------
| Offset in | | Destination Offset | Size of | | Offset in | | Destination Offset | Size of |
...@@ -119,7 +119,7 @@ Extended Modes ...@@ -119,7 +119,7 @@ Extended Modes
This is a double word bit array (64 bits) that defines special functionality This is a double word bit array (64 bits) that defines special functionality
which has an impact on the software drivers. Each bit has its own impact which has an impact on the software drivers. Each bit has its own impact
and has special instructions for the s/w associated with it. This structure is and has special instructions for the s/w associated with it. This structure is
described in this table: described in this table::
----------------------------------------------------------------------- -----------------------------------------------------------------------
| Bit # | Name | Description | | Bit # | Name | Description |
...@@ -220,7 +220,8 @@ The 'model' field is a 16-bit number that matches the actual SOC. The ...@@ -220,7 +220,8 @@ The 'model' field is a 16-bit number that matches the actual SOC. The
'major' and 'minor' fields are the major and minor revision numbers, 'major' and 'minor' fields are the major and minor revision numbers,
respectively, of the SOC. respectively, of the SOC.
For example, to match the 8323, revision 1.0: For example, to match the 8323, revision 1.0::
soc.model = 8323 soc.model = 8323
soc.major = 1 soc.major = 1
soc.minor = 0 soc.minor = 0
...@@ -273,10 +274,10 @@ library and available to any driver that calles qe_get_firmware_info(). ...@@ -273,10 +274,10 @@ library and available to any driver that calles qe_get_firmware_info().
'reserved'. 'reserved'.
After the last microcode is a 32-bit CRC. It can be calculated using After the last microcode is a 32-bit CRC. It can be calculated using
this algorithm: this algorithm::
u32 crc32(const u8 *p, unsigned int len) u32 crc32(const u8 *p, unsigned int len)
{ {
unsigned int i; unsigned int i;
u32 crc = 0; u32 crc = 0;
...@@ -286,7 +287,7 @@ u32 crc32(const u8 *p, unsigned int len) ...@@ -286,7 +287,7 @@ u32 crc32(const u8 *p, unsigned int len)
crc = (crc >> 1) ^ ((crc & 1) ? 0xedb88320 : 0); crc = (crc >> 1) ^ ((crc & 1) ? 0xedb88320 : 0);
} }
return crc; return crc;
} }
VI - Sample Code for Creating Firmware Files VI - Sample Code for Creating Firmware Files
============================================ ============================================
......
...@@ -5,12 +5,12 @@ Power Architecture 64-bit Linux system call ABI ...@@ -5,12 +5,12 @@ Power Architecture 64-bit Linux system call ABI
syscall syscall
======= =======
syscall calling sequence[*] matches the Power Architecture 64-bit ELF ABI syscall calling sequence\ [1]_ matches the Power Architecture 64-bit ELF ABI
specification C function calling sequence, including register preservation specification C function calling sequence, including register preservation
rules, with the following differences. rules, with the following differences.
[*] Some syscalls (typically low-level management functions) may have .. [1] Some syscalls (typically low-level management functions) may have
different calling sequences (e.g., rt_sigreturn). different calling sequences (e.g., rt_sigreturn).
Parameters and return value Parameters and return value
--------------------------- ---------------------------
...@@ -33,12 +33,14 @@ Register preservation rules ...@@ -33,12 +33,14 @@ Register preservation rules
Register preservation rules match the ELF ABI calling sequence with the Register preservation rules match the ELF ABI calling sequence with the
following differences: following differences:
r0: Volatile. (System call number.) =========== ============= ========================================
r3: Volatile. (Parameter 1, and return value.) r0 Volatile (System call number.)
r4-r8: Volatile. (Parameters 2-6.) r3 Volatile (Parameter 1, and return value.)
cr0: Volatile (cr0.SO is the return error condition) r4-r8 Volatile (Parameters 2-6.)
cr1, cr5-7: Nonvolatile. cr0 Volatile (cr0.SO is the return error condition)
lr: Nonvolatile. cr1, cr5-7 Nonvolatile
lr Nonvolatile
=========== ============= ========================================
All floating point and vector data registers as well as control and status All floating point and vector data registers as well as control and status
registers are nonvolatile. registers are nonvolatile.
...@@ -90,9 +92,12 @@ The vsyscall may or may not use the caller's stack frame save areas. ...@@ -90,9 +92,12 @@ The vsyscall may or may not use the caller's stack frame save areas.
Register preservation rules Register preservation rules
--------------------------- ---------------------------
r0: Volatile.
cr1, cr5-7: Volatile. =========== ========
lr: Volatile. r0 Volatile
cr1, cr5-7 Volatile
lr Volatile
=========== ========
Invocation Invocation
---------- ----------
......
============================
Transactional Memory support Transactional Memory support
============================ ============================
...@@ -17,29 +18,29 @@ instructions are presented to delimit transactions; transactions are ...@@ -17,29 +18,29 @@ instructions are presented to delimit transactions; transactions are
guaranteed to either complete atomically or roll back and undo any partial guaranteed to either complete atomically or roll back and undo any partial
changes. changes.
A simple transaction looks like this: A simple transaction looks like this::
begin_move_money: begin_move_money:
tbegin tbegin
beq abort_handler beq abort_handler
ld r4, SAVINGS_ACCT(r3) ld r4, SAVINGS_ACCT(r3)
ld r5, CURRENT_ACCT(r3) ld r5, CURRENT_ACCT(r3)
subi r5, r5, 1 subi r5, r5, 1
addi r4, r4, 1 addi r4, r4, 1
std r4, SAVINGS_ACCT(r3) std r4, SAVINGS_ACCT(r3)
std r5, CURRENT_ACCT(r3) std r5, CURRENT_ACCT(r3)
tend tend
b continue b continue
abort_handler: abort_handler:
... test for odd failures ... ... test for odd failures ...
/* Retry the transaction if it failed because it conflicted with /* Retry the transaction if it failed because it conflicted with
* someone else: */ * someone else: */
b begin_move_money b begin_move_money
The 'tbegin' instruction denotes the start point, and 'tend' the end point. The 'tbegin' instruction denotes the start point, and 'tend' the end point.
...@@ -123,7 +124,7 @@ Transaction-aware signal handlers can read the transactional register state ...@@ -123,7 +124,7 @@ Transaction-aware signal handlers can read the transactional register state
from the second ucontext. This will be necessary for crash handlers to from the second ucontext. This will be necessary for crash handlers to
determine, for example, the address of the instruction causing the SIGSEGV. determine, for example, the address of the instruction causing the SIGSEGV.
Example signal handler: Example signal handler::
void crash_handler(int sig, siginfo_t *si, void *uc) void crash_handler(int sig, siginfo_t *si, void *uc)
{ {
...@@ -133,9 +134,9 @@ Example signal handler: ...@@ -133,9 +134,9 @@ Example signal handler:
if (ucp_link) { if (ucp_link) {
u64 msr = ucp->uc_mcontext.regs->msr; u64 msr = ucp->uc_mcontext.regs->msr;
/* May have transactional ucontext! */ /* May have transactional ucontext! */
#ifndef __powerpc64__ #ifndef __powerpc64__
msr |= ((u64)transactional_ucp->uc_mcontext.regs->msr) << 32; msr |= ((u64)transactional_ucp->uc_mcontext.regs->msr) << 32;
#endif #endif
if (MSR_TM_ACTIVE(msr)) { if (MSR_TM_ACTIVE(msr)) {
/* Yes, we crashed during a transaction. Oops. */ /* Yes, we crashed during a transaction. Oops. */
fprintf(stderr, "Transaction to be restarted at 0x%llx, but " fprintf(stderr, "Transaction to be restarted at 0x%llx, but "
...@@ -176,6 +177,7 @@ Failure cause codes used by kernel ...@@ -176,6 +177,7 @@ Failure cause codes used by kernel
These are defined in <asm/reg.h>, and distinguish different reasons why the These are defined in <asm/reg.h>, and distinguish different reasons why the
kernel aborted a transaction: kernel aborted a transaction:
====================== ================================
TM_CAUSE_RESCHED Thread was rescheduled. TM_CAUSE_RESCHED Thread was rescheduled.
TM_CAUSE_TLBI Software TLB invalid. TM_CAUSE_TLBI Software TLB invalid.
TM_CAUSE_FAC_UNAV FP/VEC/VSX unavailable trap. TM_CAUSE_FAC_UNAV FP/VEC/VSX unavailable trap.
...@@ -184,6 +186,7 @@ kernel aborted a transaction: ...@@ -184,6 +186,7 @@ kernel aborted a transaction:
TM_CAUSE_MISC Currently unused. TM_CAUSE_MISC Currently unused.
TM_CAUSE_ALIGNMENT Alignment fault. TM_CAUSE_ALIGNMENT Alignment fault.
TM_CAUSE_EMULATE Emulation that touched memory. TM_CAUSE_EMULATE Emulation that touched memory.
====================== ================================
These can be checked by the user program's abort handler as TEXASR[0:7]. If These can be checked by the user program's abort handler as TEXASR[0:7]. If
bit 7 is set, it indicates that the error is consider persistent. For example bit 7 is set, it indicates that the error is consider persistent. For example
...@@ -203,7 +206,7 @@ POWER9 ...@@ -203,7 +206,7 @@ POWER9
====== ======
TM on POWER9 has issues with storing the complete register state. This TM on POWER9 has issues with storing the complete register state. This
is described in this commit: is described in this commit::
commit 4bb3c7a0208fc13ca70598efd109901a7cd45ae7 commit 4bb3c7a0208fc13ca70598efd109901a7cd45ae7
Author: Paul Mackerras <paulus@ozlabs.org> Author: Paul Mackerras <paulus@ozlabs.org>
......
...@@ -4468,7 +4468,7 @@ F: arch/powerpc/platforms/powernv/pci-cxl.c ...@@ -4468,7 +4468,7 @@ F: arch/powerpc/platforms/powernv/pci-cxl.c
F: drivers/misc/cxl/ F: drivers/misc/cxl/
F: include/misc/cxl* F: include/misc/cxl*
F: include/uapi/misc/cxl.h F: include/uapi/misc/cxl.h
F: Documentation/powerpc/cxl.txt F: Documentation/powerpc/cxl.rst
F: Documentation/ABI/testing/sysfs-class-cxl F: Documentation/ABI/testing/sysfs-class-cxl
CXLFLASH (IBM Coherent Accelerator Processor Interface CAPI Flash) SCSI DRIVER CXLFLASH (IBM Coherent Accelerator Processor Interface CAPI Flash) SCSI DRIVER
...@@ -4479,7 +4479,7 @@ L: linux-scsi@vger.kernel.org ...@@ -4479,7 +4479,7 @@ L: linux-scsi@vger.kernel.org
S: Supported S: Supported
F: drivers/scsi/cxlflash/ F: drivers/scsi/cxlflash/
F: include/uapi/scsi/cxlflash_ioctl.h F: include/uapi/scsi/cxlflash_ioctl.h
F: Documentation/powerpc/cxlflash.txt F: Documentation/powerpc/cxlflash.rst
CYBERPRO FB DRIVER CYBERPRO FB DRIVER
M: Russell King <linux@armlinux.org.uk> M: Russell King <linux@armlinux.org.uk>
...@@ -12353,7 +12353,7 @@ F: Documentation/PCI/pci-error-recovery.rst ...@@ -12353,7 +12353,7 @@ F: Documentation/PCI/pci-error-recovery.rst
F: drivers/pci/pcie/aer.c F: drivers/pci/pcie/aer.c
F: drivers/pci/pcie/dpc.c F: drivers/pci/pcie/dpc.c
F: drivers/pci/pcie/err.c F: drivers/pci/pcie/err.c
F: Documentation/powerpc/eeh-pci-error-recovery.txt F: Documentation/powerpc/eeh-pci-error-recovery.rst
F: arch/powerpc/kernel/eeh*.c F: arch/powerpc/kernel/eeh*.c
F: arch/powerpc/platforms/*/eeh*.c F: arch/powerpc/platforms/*/eeh*.c
F: arch/powerpc/include/*/eeh*.h F: arch/powerpc/include/*/eeh*.h
......
...@@ -1531,7 +1531,7 @@ EXC_COMMON(trap_0b_common, 0xb00, unknown_exception) ...@@ -1531,7 +1531,7 @@ EXC_COMMON(trap_0b_common, 0xb00, unknown_exception)
* *
* Call convention: * Call convention:
* *
* syscall register convention is in Documentation/powerpc/syscall64-abi.txt * syscall register convention is in Documentation/powerpc/syscall64-abi.rst
* *
* For hypercalls, the register convention is as follows: * For hypercalls, the register convention is as follows:
* r0 volatile * r0 volatile
......
...@@ -419,7 +419,7 @@ static void qe_upload_microcode(const void *base, ...@@ -419,7 +419,7 @@ static void qe_upload_microcode(const void *base,
/* /*
* Upload a microcode to the I-RAM at a specific address. * Upload a microcode to the I-RAM at a specific address.
* *
* See Documentation/powerpc/qe_firmware.txt for information on QE microcode * See Documentation/powerpc/qe_firmware.rst for information on QE microcode
* uploading. * uploading.
* *
* Currently, only version 1 is supported, so the 'version' field must be * Currently, only version 1 is supported, so the 'version' field must be
......
...@@ -47,7 +47,7 @@ ...@@ -47,7 +47,7 @@
* using the 2.6 Linux kernel kref construct. * using the 2.6 Linux kernel kref construct.
* *
* For direction on installation and usage of this driver please reference * For direction on installation and usage of this driver please reference
* Documentation/powerpc/hvcs.txt. * Documentation/powerpc/hvcs.rst.
*/ */
#include <linux/device.h> #include <linux/device.h>
......
...@@ -259,7 +259,7 @@ static inline int qe_alive_during_sleep(void) ...@@ -259,7 +259,7 @@ static inline int qe_alive_during_sleep(void)
/* Structure that defines QE firmware binary files. /* Structure that defines QE firmware binary files.
* *
* See Documentation/powerpc/qe_firmware.txt for a description of these * See Documentation/powerpc/qe_firmware.rst for a description of these
* fields. * fields.
*/ */
struct qe_firmware { struct qe_firmware {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment