Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f3573b8f authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge tag 'for-linus' of git://github.com/openrisc/linux

Pull OpenRISC updates from Stafford Horne:
 "The OpenRISC work is a bit more interesting this time, adding SMP
  support and a few general cleanups.

  Small Things:

   - Move OpenRISC docs into Documentation and clean them up

   - Document previously undocumented devicetree bindings

   - Update the or1ksim dts to use stdout-path

  OpenRISC SMP support details:

   - First the "use shadow registers" and "define CPU_BIG_ENDIAN as
     true" get the architecture ready for SMP.

   - The "add 1 and 2 byte cmpxchg support" and "use qspinlocks and
     qrwlocks" add the SMP locking infrastructure as needed. Using the
     qspinlocks and qrwlocks as suggested by Peter Z while reviewing the
     original spinlocks implementation.

   - The "support for ompic" adds a new irqchip device which is used for
     IPI communication to support SMP.

   - The "initial SMP support" adds smp.c and makes changes to all of
     the necessary data-structures to be per-cpu.

  The remaining patches are bug fixes and debug helpers which I wanted
  to keep separate from the "initial SMP support" in order to allow them
  to be reviewed on their own. This includes:

   - add cacheflush support to fix icache aliasing

   - fix initial preempt state for secondary cpu tasks

   - sleep instead of spin on secondary wait

   - support framepointers and STACKTRACE_SUPPORT

   - enable LOCKDEP_SUPPORT and irqflags tracing

   - timer sync: Add tick timer sync logic

   - fix possible deadlock in timer sync, pointed out by mips guys

  Note: the irqchip patch was reviewed with Marc and we agreed to push
  it together with these patches"

* tag 'for-linus' of git://github.com/openrisc/linux:
  openrisc: fix possible deadlock scenario during timer sync
  openrisc: pass endianness info to sparse
  openrisc: add tick timer multi-core sync logic
  openrisc: enable LOCKDEP_SUPPORT and irqflags tracing
  openrisc: support framepointers and STACKTRACE_SUPPORT
  openrisc: add simple_smp dts and defconfig for simulators
  openrisc: add cacheflush support to fix icache aliasing
  openrisc: sleep instead of spin on secondary wait
  openrisc: fix initial preempt state for secondary cpu tasks
  openrisc: initial SMP support
  irqchip: add initial support for ompic
  dt-bindings: add openrisc to vendor prefixes list
  openrisc: use qspinlocks and qrwlocks
  openrisc: add 1 and 2 byte cmpxchg support
  openrisc: use shadow registers to save regs on exception
  dt-bindings: openrisc: Add OpenRISC platform SoC
  Documentation: openrisc: Updates to README
  Documentation: Move OpenRISC docs out of arch/
  MAINTAINERS: Add OpenRISC pic maintainer
  openrisc: dts: or1ksim: Add stdout-path
parents 9e09d05c 610f01b9
Loading
Loading
Loading
Loading
+22 −0
Original line number Diff line number Diff line
Open Multi-Processor Interrupt Controller

Required properties:

- compatible : This should be "openrisc,ompic"
- reg : Specifies base physical address and size of the register space. The
  size is based on the number of cores the controller has been configured
  to handle, this should be set to 8 bytes per cpu core.
- interrupt-controller : Identifies the node as an interrupt controller.
- #interrupt-cells : This should be set to 0 as this will not be an irq
  parent.
- interrupts : Specifies the interrupt line to which the ompic is wired.

Example:

ompic: interrupt-controller@98000000 {
	compatible = "openrisc,ompic";
	reg = <0x98000000 16>;
	interrupt-controller;
	#interrupt-cells = <0>;
	interrupts = <1>;
};
+39 −0
Original line number Diff line number Diff line
OpenRISC Generic SoC
====================

Boards and FPGA SoC's which support the OpenRISC standard platform.  The
platform essentially follows the conventions of the OpenRISC architecture
specification, however some aspects, such as the boot protocol have been defined
by the Linux port.

Required properties
-------------------
 - compatible: Must include "opencores,or1ksim"

CPU nodes:
----------
A "cpus" node is required.  Required properties:
 - #address-cells: Must be 1.
 - #size-cells: Must be 0.
A CPU sub-node is also required for at least CPU 0.  Since the topology may
be probed via CPS, it is not necessary to specify secondary CPUs.  Required
properties:
 - compatible: Must be "opencores,or1200-rtlsvn481".
 - reg: CPU number.
 - clock-frequency: The CPU clock frequency in Hz.
Example:
	cpus {
		#address-cells = <1>;
		#size-cells = <0>;
		cpu@0 {
			compatible = "opencores,or1200-rtlsvn481";
			reg = <0>;
			clock-frequency = <20000000>;
		};
	};


Boot protocol
-------------
The bootloader may pass the following arguments to the kernel:
 - r3:  address of a flattened device-tree blob or 0x0.
+1 −0
Original line number Diff line number Diff line
@@ -246,6 +246,7 @@ onion Onion Corporation
onnn	ON Semiconductor Corp.
ontat	On Tat Industrial Company
opencores	OpenCores.org
openrisc	OpenRISC.io
option	Option NV
ORCL	Oracle Corporation
ortustech	Ortus Technology Co., Ltd.
+38 −27
Original line number Diff line number Diff line
@@ -7,13 +7,7 @@ target architecture, specifically, is the 32-bit OpenRISC 1000 family (or1k).
For information about OpenRISC processors and ongoing development:

	website		http://openrisc.io

For more information about Linux on OpenRISC, please contact South Pole AB.

	email:		info@southpole.se

	website:	http://southpole.se
			http://southpoleconsulting.com
	email		openrisc@lists.librecores.org

---------------------------------------------------------------------

@@ -24,37 +18,54 @@ In order to build and run Linux for OpenRISC, you'll need at least a basic
toolchain and, perhaps, the architectural simulator.  Steps to get these bits
in place are outlined here.

1)  The toolchain can be obtained from openrisc.io.  Instructions for building
a toolchain can be found at:
1) Toolchain

Toolchain binaries can be obtained from openrisc.io or our github releases page.
Instructions for building the different toolchains can be found on openrisc.io
or Stafford's toolchain build and release scripts.

	binaries	https://github.com/openrisc/or1k-gcc/releases
	toolchains	https://openrisc.io/software
	building	https://github.com/stffrdhrn/or1k-toolchain-build

https://github.com/openrisc/tutorials
2) Building

2) or1ksim (optional)
Build the Linux kernel as usual

or1ksim is the architectural simulator which will allow you to actually run
your OpenRISC Linux kernel if you don't have an OpenRISC processor at hand.
	make ARCH=openrisc defconfig
	make ARCH=openrisc

	git clone https://github.com/openrisc/or1ksim.git
3) Running on FPGA (optional)

	cd or1ksim
	./configure --prefix=$OPENRISC_PREFIX
	make
	make install
The OpenRISC community typically uses FuseSoC to manage building and programming
an SoC into an FPGA.  The below is an example of programming a De0 Nano
development board with the OpenRISC SoC.  During the build FPGA RTL is code
downloaded from the FuseSoC IP cores repository and built using the FPGA vendor
tools.  Binaries are loaded onto the board with openocd.

3)  Linux kernel
	git clone https://github.com/olofk/fusesoc
	cd fusesoc
	sudo pip install -e .

Build the kernel as usual
	fusesoc init
	fusesoc build de0_nano
	fusesoc pgm de0_nano

	make ARCH=openrisc defconfig
	make ARCH=openrisc
	openocd -f interface/altera-usb-blaster.cfg \
		-f board/or1k_generic.cfg

	telnet localhost 4444
	> init
	> halt; load_image vmlinux ; reset

4)  Run in architectural simulator
4) Running on a Simulator (optional)

Grab the or1ksim platform configuration file (from the or1ksim source) and
together with your freshly built vmlinux, run your kernel with the following
incantation:
QEMU is a processor emulator which we recommend for simulating the OpenRISC
platform.  Please follow the OpenRISC instructions on the QEMU website to get
Linux running on QEMU.  You can build QEMU yourself, but your Linux distribution
likely provides binary packages to support OpenRISC.

	sim -f arch/openrisc/or1ksim.cfg vmlinux
	qemu openrisc	https://wiki.qemu.org/Documentation/Platforms/OpenRISC

---------------------------------------------------------------------

+0 −0

File moved.

Loading