]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit - arch/openrisc/include/asm/serial.h
openrisc: initial SMP support
authorStefan Kristiansson <stefan.kristiansson@saunalahti.fi>
Sun, 11 May 2014 18:49:34 +0000 (21:49 +0300)
committerStafford Horne <shorne@gmail.com>
Fri, 3 Nov 2017 05:01:13 +0000 (14:01 +0900)
commit8e6d08e0a15e7d4d4b608b56597350d4cdd77710
tree5c060395457f5bdd407c09b85caedcbbf701072c
parent9b54470afd836278a7e6f0f08194e2e2dca4b6eb
openrisc: initial SMP support

This patch introduces the SMP support for the OpenRISC architecture.
The SMP architecture requires cores which have multi-core features which
have been introduced a few years back including:

 - New SPRS SPR_COREID SPR_NUMCORES
 - Shadow SPRs
 - Atomic Instructions
 - Cache Coherency
 - A wired in IPI controller

This patch adds all of the SMP specific changes to core infrastructure,
it looks big but it needs to go all together as its hard to split this
one up.

Boot loader spinning of second cpu is not supported yet, it's assumed
that Linux is booted straight after cpu reset.

The bulk of these changes are trivial changes to refactor to use per cpu
data structures throughout.  The addition of the smp.c and changes in
time.c are the changes.  Some specific notes:

MM changes
----------
The reason why this is created as an array, and not with DEFINE_PER_CPU
is that doing it this way, we'll save a load in the tlb-miss handler
(the load from __per_cpu_offset).

TLB Flush
---------
The SMP implementation of flush_tlb_* works by sending out a
function-call IPI to all the non-local cpus by using the generic
on_each_cpu() function.

Currently, all flush_tlb_* functions will result in a flush_tlb_all(),
which has always been the behaviour in the UP case.

CPU INFO
--------
This creates a per cpu cpuinfo struct and fills it out accordingly for
each activated cpu.  show_cpuinfo is also updated to reflect new version
information in later versions of the spec.

SMP API
-------
This imitates the arm64 implementation by having a smp_cross_call
callback that can be set by set_smp_cross_call to initiate an IPI and a
handle_IPI function that is expected to be called from an IPI irqchip
driver.

Signed-off-by: Stefan Kristiansson <stefan.kristiansson@saunalahti.fi>
[shorne@gmail.com: added cpu stop, checkpatch fixes, wrote commit message]
Signed-off-by: Stafford Horne <shorne@gmail.com>
19 files changed:
arch/openrisc/Kconfig
arch/openrisc/include/asm/cpuinfo.h
arch/openrisc/include/asm/mmu_context.h
arch/openrisc/include/asm/pgtable.h
arch/openrisc/include/asm/serial.h
arch/openrisc/include/asm/smp.h [new file with mode: 0644]
arch/openrisc/include/asm/spr_defs.h
arch/openrisc/include/asm/time.h [new file with mode: 0644]
arch/openrisc/include/asm/tlbflush.h
arch/openrisc/kernel/Makefile
arch/openrisc/kernel/dma.c
arch/openrisc/kernel/head.S
arch/openrisc/kernel/setup.c
arch/openrisc/kernel/smp.c [new file with mode: 0644]
arch/openrisc/kernel/time.c
arch/openrisc/lib/delay.c
arch/openrisc/mm/fault.c
arch/openrisc/mm/init.c
arch/openrisc/mm/tlb.c