Skip to contentSkip to conversation

openrisc: LiteX+mor1kx platform

PATCH In review Mateusz Holenko 2 participants 3 messages Oct 23, 2019 – Oct 24, 2019

Subsystems (3)
lore
Share & tools
lore

Mateusz Holenko

author maintainer
#0 lore raw

cover openrisc: LiteX+mor1kx platform

This patchset adds a new LiteX SoC-based platform
configured for mor1kx (OpenRISC) CPU coupled with
LiteUART serial device.

Details about LiteX can be found at
https://github.com/enjoy-digital/litex.

This platform is intended for further extension
once drivers for other LiteX devices are merged
to the kernel.

NOTE:
This requires another patchset to be merged first:
https://lore.kernel.org/patchwork/cover/1143352/

Filip Kokosinski (1):
openrisc: add support for LiteX

 MAINTAINERS                               |  1 +
 arch/openrisc/boot/dts/or1klitex.dts      | 49 +++++++++++++++++++++++
 arch/openrisc/configs/or1klitex_defconfig | 18 +++++++++
 3 files changed, 68 insertions(+)
 create mode 100644 arch/openrisc/boot/dts/or1klitex.dts
 create mode 100644 arch/openrisc/configs/or1klitex_defconfig
Signature · 1 line
2.23.0
author maintainer
#1 lore raw

PATCH 1/1 openrisc: add support for LiteX

From: Filip Kokosinski <[email protected]>

This adds support for a basic LiteX-based SoC with a mor1kx soft CPU.

---
 MAINTAINERS                               |  1 +
 arch/openrisc/boot/dts/or1klitex.dts      | 49 +++++++++++++++++++++++
 arch/openrisc/configs/or1klitex_defconfig | 18 +++++++++
 3 files changed, 68 insertions(+)
 create mode 100644 arch/openrisc/boot/dts/or1klitex.dts
 create mode 100644 arch/openrisc/configs/or1klitex_defconfig
MAINTAINERS +1 -0
index c24a37833e78..e84b2cb4c186 100644
@@ -9500,6 +9500,7 @@ S:	Maintained
 F:	include/linux/litex.h
 F:	Documentation/devicetree/bindings/*/litex,*.yaml
 F:	drivers/tty/serial/liteuart.c
+F:	arch/openrisc/boot/dts/or1klitex.dts
 
 LIVE PATCHING
 M:	Josh Poimboeuf <[email protected]>
arch/openrisc/boot/dts/or1klitex.dts new file +49 -0

49 lines not on this page · raw message

arch/openrisc/configs/or1klitex_defconfig new file +18 -0
new file mode 100644
index 000000000000..0e4c2e74451c
@@ -0,0 +1,18 @@
+CONFIG_BLK_DEV_INITRD=y
+CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC=y
+CONFIG_BUG_ON_DATA_CORRUPTION=y
+CONFIG_CC_OPTIMIZE_FOR_SIZE=y
+CONFIG_CROSS_COMPILE="or32-linux-"
+CONFIG_DEVTMPFS=y
+CONFIG_DEVTMPFS_MOUNT=y
+CONFIG_EMBEDDED=y
+CONFIG_HZ_100=y
+CONFIG_INITRAMFS_SOURCE="openrisc-rootfs.cpio.gz"
+CONFIG_OF_OVERLAY=y
+CONFIG_OPENRISC_BUILTIN_DTB="or1klitex"
+CONFIG_PANIC_ON_OOPS=y
+CONFIG_PRINTK_TIME=y
+CONFIG_SERIAL_LITEUART=y
+CONFIG_SERIAL_LITEUART_CONSOLE=y
+CONFIG_SOFTLOCKUP_DETECTOR=y
+CONFIG_TTY_PRINTK=y
Signature · 1 line
2.23.0
maintainer
#2 lore raw

Re: [PATCH 1/1] openrisc: add support for LiteX

Hello,

Quoted 3 lines · Mateusz Holenko

From: Filip Kokosinski <[email protected]>

This adds support for a basic LiteX-based SoC with a mor1kx soft CPU.

Thanks for getting these patches ready.

Quoted 38 lines
---
 MAINTAINERS                               |  1 +
 arch/openrisc/boot/dts/or1klitex.dts      | 49 +++++++++++++++++++++++
 arch/openrisc/configs/or1klitex_defconfig | 18 +++++++++
 3 files changed, 68 insertions(+)
 create mode 100644 arch/openrisc/boot/dts/or1klitex.dts
 create mode 100644 arch/openrisc/configs/or1klitex_defconfig
MAINTAINERS +1 -0
index c24a37833e78..e84b2cb4c186 100644
@@ -9500,6 +9500,7 @@ S:	Maintained
 F:	include/linux/litex.h
 F:	Documentation/devicetree/bindings/*/litex,*.yaml
 F:	drivers/tty/serial/liteuart.c
+F:	arch/openrisc/boot/dts/or1klitex.dts
 
 LIVE PATCHING
 M:	Josh Poimboeuf <[email protected]>
arch/openrisc/boot/dts/or1klitex.dts new file +10 -0
new file mode 100644
index 000000000000..63399398002d
@@ -0,0 +1,49 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * LiteX-based System on Chip
+ *
+ * Copyright (C) 2019 Antmicro Ltd <www.antmicro.com>
+ */
+
+/dts-v1/;
+/ {
+	compatible = "opencores,or1ksim";

arch/openrisc/boot/dts/or1klitex.dts line 20

Quoted 10 lines
arch/openrisc/boot/dts/or1klitex.dts new file +10 -0
+	#address-cells = <1>;
+	#size-cells = <1>;
+	interrupt-parent = <&pic>;
+
+	aliases {
+		serial0 = &serial0;
+	};
+
+	chosen {
+		bootargs = "console=liteuart";

As this depents on litex uart I will wait to queue this until it looks like the uart patches are accepted for 5.5 merge window.

Quoted 35 lines
arch/openrisc/boot/dts/or1klitex.dts new file +29 -0
+	};
+
+	memory at 0 {
+		device_type = "memory";
+		reg = <0x00000000 0x10000000>;
+	};
+
+	cpus {
+		#address-cells = <1>;
+		#size-cells = <0>;
+		cpu at 0 {
+			compatible = "opencores,or1200-rtlsvn481";
+			reg = <0>;
+			clock-frequency = <100000000>;
+		};
+	};
+
+	pic: pic {
+		compatible = "opencores,or1k-pic";
+		#interrupt-cells = <1>;
+		interrupt-controller;
+	};
+
+	serial0: serial at e0001800 {
+		device_type = "serial";
+		compatible = "litex,liteuart";
+		reg = <0xe0001800 0x100>;
+	};
+};
arch/openrisc/configs/or1klitex_defconfig new file +0 -0
new file mode 100644
index 000000000000..0e4c2e74451c

arch/openrisc/configs/or1klitex_defconfig line 5

Quoted 5 lines
arch/openrisc/configs/or1klitex_defconfig new file +5 -0
@@ -0,0 +1,18 @@
+CONFIG_BLK_DEV_INITRD=y
+CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC=y
+CONFIG_BUG_ON_DATA_CORRUPTION=y
+CONFIG_CC_OPTIMIZE_FOR_SIZE=y
+CONFIG_CROSS_COMPILE="or32-linux-"

We use or1k-linux- now. Is this what you really use?

arch/openrisc/configs/or1klitex_defconfig line 16

Quoted 11 lines
arch/openrisc/configs/or1klitex_defconfig new file +11 -0
+CONFIG_DEVTMPFS=y
+CONFIG_DEVTMPFS_MOUNT=y
+CONFIG_EMBEDDED=y
+CONFIG_HZ_100=y
+CONFIG_INITRAMFS_SOURCE="openrisc-rootfs.cpio.gz"
+CONFIG_OF_OVERLAY=y
+CONFIG_OPENRISC_BUILTIN_DTB="or1klitex"
+CONFIG_PANIC_ON_OOPS=y
+CONFIG_PRINTK_TIME=y
+CONFIG_SERIAL_LITEUART=y
+CONFIG_SERIAL_LITEUART_CONSOLE=y

Note, Litex uart dependency lookds fine nere.

Quoted 5 lines
arch/openrisc/configs/or1klitex_defconfig new file +2 -0
+CONFIG_SOFTLOCKUP_DETECTOR=y
+CONFIG_TTY_PRINTK=y
Signature · 1 line
2.23.0

-Stafford