Skip to contentSkip to conversation

Add support for the Mobileye EyeQ5 SoC

PATCH Superseded Gregory CLEMENT 3 participants 23 messages Jan 18, 2024 – Feb 1, 2024

Subsystems (5)

v6 of 8 Superseded Latest is v8 →

lore
Share & tools
lore
author maintainer
#1 lore raw

PATCH v6 1/15 MIPS: spaces: Define a couple of handy macros

In reply to Gregory CLEMENT

Define KSEGX_SIZE to represent the size of each KSEG segment.

Introduce CKSEG0ADDR_OR_64BIT and CKSEG1ADDR_OR_64BIT to get an XPHYS address in 64bits and CKSEG[01]ADDR() in 32 bits mode.

---
 arch/mips/include/asm/addrspace.h           | 5 +++++
 arch/mips/include/asm/mach-generic/spaces.h | 4 ++++
 2 files changed, 9 insertions(+)
arch/mips/include/asm/addrspace.h +5 -0
index 59a48c60a065c..03a5e2c8b5dc9 100644
@@ -47,6 +47,11 @@
  */
 #define KSEGX(a)		((_ACAST32_(a)) & _ACAST32_(0xe0000000))
 
+/*
+ * Gives the size of each kernel segment
+ */
+#define KSEGX_SIZE		0x20000000
+
 /*
  * Returns the physical address of a CKSEGx / XKPHYS address
  */
arch/mips/include/asm/mach-generic/spaces.h +4 -0
index b247575c5e699..f8783d339fb0d 100644
@@ -49,6 +49,8 @@
 #define HIGHMEM_START		_AC(0x20000000, UL)
 #endif
 
+#define CKSEG0ADDR_OR_64BIT(x)	CKSEG0ADDR(x)
+#define CKSEG1ADDR_OR_64BIT(x)	CKSEG1ADDR(x)
 #endif /* CONFIG_32BIT */
 
 #ifdef CONFIG_64BIT
@@ -82,6 +84,8 @@
 #define TO_CAC(x)		(CAC_BASE   | ((x) & TO_PHYS_MASK))
 #define TO_UNCAC(x)		(UNCAC_BASE | ((x) & TO_PHYS_MASK))
 
+#define CKSEG0ADDR_OR_64BIT(x)	TO_CAC(x)
+#define CKSEG1ADDR_OR_64BIT(x)	TO_UNCAC(x)
 #endif /* CONFIG_64BIT */
 
 /*
Signature · 1 line
2.43.0
author maintainer
#3 lore raw

PATCH v6 3/15 MIPS: Allows relocation exception vectors everywhere

In reply to Gregory CLEMENT

From: Jiaxun Yang <[email protected]>

Now the exception vector for CPS systems are allocated on-fly with memblock as well.

It will try to allocate from KSEG1 first, and then try to allocate in low 4G if possible.

The main reset vector is now generated by uasm, to avoid tons of patches to the code. Other vectors are copied to the location later.

gc: use the new macro CKSEG[0A1]DDR_OR_64BIT()
move 64bits fix in an other patch
fix cache issue with mips_cps_core_entry
rewrite the patch to reduce the diff stat

---
 arch/mips/include/asm/mips-cm.h |   1 +
 arch/mips/include/asm/smp-cps.h |   4 +-
 arch/mips/kernel/cps-vec.S      |  48 ++-------
 arch/mips/kernel/smp-cps.c      | 171 +++++++++++++++++++++++++++-----
 4 files changed, 157 insertions(+), 67 deletions(-)
arch/mips/include/asm/mips-cm.h +1 -0
index 23c67c0871b17..15d8d69de4550 100644
@@ -311,6 +311,7 @@ GCR_CX_ACCESSOR_RW(32, 0x018, other)
 /* GCR_Cx_RESET_BASE - Configure where powered up cores will fetch from */
 GCR_CX_ACCESSOR_RW(32, 0x020, reset_base)
 #define CM_GCR_Cx_RESET_BASE_BEVEXCBASE		GENMASK(31, 12)
+#define CM_GCR_Cx_RESET_BASE_MODE		BIT(1)
 
 /* GCR_Cx_ID - Identify the current core */
 GCR_CX_ACCESSOR_RO(32, 0x028, id)
arch/mips/include/asm/smp-cps.h +1 -3
index 22a572b70fe31..39a602e5fecc4 100644
@@ -24,7 +24,7 @@ struct core_boot_config {
 
 extern struct core_boot_config *mips_cps_core_bootcfg;
 
-extern void mips_cps_core_entry(void);
+extern void mips_cps_core_boot(int cca, void __iomem *gcr_base);
 extern void mips_cps_core_init(void);
 
 extern void mips_cps_boot_vpes(struct core_boot_config *cfg, unsigned vpe);
@@ -32,8 +32,6 @@ extern void mips_cps_boot_vpes(struct core_boot_config *cfg, unsigned vpe);
 extern void mips_cps_pm_save(void);
 extern void mips_cps_pm_restore(void);
 
-extern void *mips_cps_core_entry_patch_end;
-
 #ifdef CONFIG_MIPS_CPS
 
 extern bool mips_cps_smp_in_use(void);
arch/mips/kernel/cps-vec.S +8 -40

102 lines not on this page · raw message

arch/mips/kernel/smp-cps.c +147 -24

232 lines not on this page · raw message

Signature · 1 line
2.43.0
author maintainer
#4 lore raw

PATCH v6 4/15 MIPS: traps: Give more explanations if ebase doesn't belong to KSEG0

In reply to Gregory CLEMENT

With the expanded support for placing the kernel in XPHYS rather than just KSEG0, scenarios where ebase doesn't belong to KSEG0 are more likely to occur. In such cases, we currently experience a substantial and perplexing stack dump without any accompanying explanation. To rectify this, we aim to replace the uninformative stack dump with a warning that offers a clear explanation of the issue.

---
 arch/mips/kernel/traps.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
arch/mips/kernel/traps.c +4 -1
index 355d0f0709de8..911d2233d6d0b 100644
@@ -2347,10 +2347,13 @@ void __init trap_init(void)
 		 * EVA is special though as it allows segments to be rearranged
 		 * and to become uncached during cache error handling.
 		 */
-		if (!IS_ENABLED(CONFIG_EVA) && !WARN_ON(ebase_pa >= 0x20000000))
+		if (!IS_ENABLED(CONFIG_EVA) && ebase_pa < 0x20000000)
 			ebase = CKSEG0ADDR(ebase_pa);
 		else
 			ebase = (unsigned long)phys_to_virt(ebase_pa);
+		if (ebase_pa >= 0x20000000)
+			pr_warn("ebase(%pa) should better be in KSeg0",
+				&ebase_pa);
 	}
 
 	if (cpu_has_mmips) {
Signature · 1 line
2.43.0
author maintainer
#6 lore raw

PATCH v6 5/15 MIPS: cps-vec: Use macros for 64bits access

In reply to Gregory CLEMENT

Some access are 32 bits only while they seems better to be done in 64bis for 64 bit kernel.

This was extract from an initial patch from Jiaxun

---
 arch/mips/kernel/cps-vec.S | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
arch/mips/kernel/cps-vec.S +3 -3
index df610c006b443..f876309130ad1 100644
@@ -396,7 +396,7 @@ LEAF(mips_cps_boot_vpes)
 	/* Calculate a pointer to the VPEs struct vpe_boot_config */
 	li	t0, VPEBOOTCFG_SIZE
 	mul	t0, t0, ta1
-	addu	t0, t0, ta3
+	PTR_ADDU t0, t0, ta3
 
 	/* Set the TC restart PC */
 	lw	t1, VPEBOOTCFG_PC(t0)
@@ -571,10 +571,10 @@ dcache_done:
 	lw	$1, TI_CPU(gp)
 	sll	$1, $1, LONGLOG
 	PTR_LA	\dest, __per_cpu_offset
-	addu	$1, $1, \dest
+	PTR_ADDU $1, $1, \dest
 	lw	$1, 0($1)
 	PTR_LA	\dest, cps_cpu_state
-	addu	\dest, \dest, $1
+	PTR_ADDU \dest, \dest, $1
 	.set	pop
 	.endm
 
Signature · 1 line
2.43.0

Gregory CLEMENT

author maintainer
#0 lore raw

v6 cover Add support for the Mobileye EyeQ5 SoC

Hello,

The EyeQ5 SoC from Mobileye is based on the MIPS I6500 architecture and features multiple controllers such as the classic UART, I2C, SPI, as well as CAN-FD, PCIe, Octal/Quad SPI Flash interface, Gigabit Ethernet, MIPI CSI-2, and eMMC 5.1. It also includes a Hardware Security Module, Functional Safety Hardware, and MJPEG encoder.

One peculiarity of this SoC is that the physical address of the DDDR exceeds 32 bits. Given that the architecture is 64 bits, this is not an issue, but it requires some changes in how the mips64 is currently managed during boot.

In this sixth version, I tried to fix the last two issues I found to merge the series. The first one is about using dedicated platform support while still reusing code as much as possible, following patches 13 and 14.The second point is about the "Fix kernel in XKPHYS" series I added, which has some issues reported by Thomas. At first, I only kept the necessary part for booting with XKPHYS, leaving out the clean-up and optimization. Then, I addressed two concerns in this series by adding an extra macro in the "MIPS: spaces: Define a couple of handy macros" patch. Lastly, I attempted to make the changes more concise and focus solely on a single purpose in the "MIPS: Allows relocation exception vectors everywhere" patch.

To build and test the kernel, we need to run the following commands:

make eyeq5_defconfig
make vmlinuz.itb

Changelog:

v5 -> v6:

- From series v5, patches 1 ("MIPS: Export higher/highest relocation functions in uasm") and 3 ("MIPS: genex: Fix except_vec_vi for kernel in XKPHYS)" have been removed as "MIPS:
Allow vectored interrupt handler to reside everywhere for 64bit" and "MIPS: Remove unused shadow GPR support from vector irq setup" address the same requirement.

- From series v5, patches 8 to 12 have been removed as they are not mandatory to support EyeQ5 SoCs.

- The 1st patch of series v6 ("MIPS: spaces: Define a couple of handy macros") has been modified to add the extra macros CKSEG[01]ADDR_OR_64BIT.

- Patch 3 ("MIPS: Allows relocation exception vectors everywhere") is a merge of patches 6 ("MIPS: Refactor mips_cps_core_entry implementation) and 7 ("MIPS: Fix cache issue with mips_cps_core_entry") from series v5. It has been rewritten to reduce the diff stat; the 64-bit fixes have been moved to patch 5 ("MIPS: cps-vec: Use macros for 64-bit access").

- Patch 13 ("MIPS: Share generic kernel code with other architecture)" is a new one allowing separate platform support in the patch ("MIPS: Add support for Mobileye EyeQ5").

v4 -> v5:

- Improve commit messages for patch 3, 5, 12 and 13.

- Fix style in patch 9

- Really enable SPARSMEM and use correct address in board-eyeq5.config in patch 21

v3 -> v4:

- Fix build warning in "MIPS: Get rid of CONFIG_NO_EXCEPT_FILL":
check that we are in 64bit mode before using KSEG0 that exist only in this mode.

- Modify "MIPS: spaces: Define a couple of handy macros" to be buildable in 32bit mode.

- Use correct format specifier to print address in "MIPS: traps: Give more explanations if ebase doesn't belong to KSEG0"

- In "MIPS: generic: Add support for Mobileye EyeQ5",remove CONFIG_ZBOOT_LOAD_ADDRESS from board-eyeq5.config, (as well as CONFIG_USE_XKPHYS that does not exist anymore) and add CONFIG_SPARSEMEM_MANUAL to enable SPARSMEM.

v2 -> v3

- Added more reviewed-by and acked-by tags

- Fix sorting for cpus entries in

- Fix indentation issue in Documentation/devicetree/bindings/mips/mobileye.yaml

v1 -> v2

- Added reviewed-by and acked-by tags

- Fix typos reported

- In patch 15 use 'img' vendor string instead of mti

- In patch 16 modify licence

- In patch 17 give more explanations about the block usage.

- In patch 18, remove _ in node names, don't use anymore CONFIG_BUILTIN_DTB in Makefile, remove macro, modify licence.

- In patch 19 remove most of the bootargs and only keeps earlycon. I also split the memory in 2 part in the device tree.

- Integrate the series from Jiaxun Yang
https://lore.kernel.org/linux-mips/[email protected]/

They are patches 2 to 6 and 8 to 12

Then I added patch 7 to fix the cache issue visible on the Mobileye platform, I also add patch 13 to improve warning message when ebase doesn't belong to KSEG0

Regards,

Gregory

Gregory CLEMENT (13):
MIPS: spaces: Define a couple of handy macros
MIPS: traps: Give more explanations if ebase doesn't belong to KSEG0
MIPS: cps-vec: Use macros for 64bits access
dt-bindings: Add vendor prefix for Mobileye Vision Technologies Ltd.
dt-bindings: mips: cpus: Sort the entries
dt-bindings: mips: cpu: Add I-Class I6500 Multiprocessor Core
dt-bindings: mips: Add bindings for Mobileye SoCs
dt-bindings: mfd: syscon: Document EyeQ5 OLB
MIPS: mobileye: Add EyeQ5 dtsi
MIPS: mobileye: Add EPM5 device tree
MIPS: Share generic kernel code with other architecture
MIPS: Add support for Mobileye EyeQ5
MAINTAINERS: Add entry for Mobileye MIPS SoCs

Jiaxun Yang (2):
MIPS: Fix set_uncached_handler for ebase in XKPHYS
MIPS: Allows relocation exception vectors everywhere

 .../devicetree/bindings/mfd/syscon.yaml       |   1 +
 .../devicetree/bindings/mips/cpus.yaml        |  13 +-
 .../devicetree/bindings/mips/mobileye.yaml    |  32 ++
 .../devicetree/bindings/vendor-prefixes.yaml  |   2 +
 MAINTAINERS                                   |  12 +
 arch/mips/Kbuild                              |   1 +
 arch/mips/Kbuild.platforms                    |   1 +
 arch/mips/Kconfig                             |  65 ++++
 arch/mips/boot/dts/Makefile                   |   1 +
 arch/mips/boot/dts/mobileye/Makefile          |   4 +
 arch/mips/boot/dts/mobileye/eyeq5-epm5.dts    |  24 ++
 .../boot/dts/mobileye/eyeq5-fixed-clocks.dtsi | 292 ++++++++++++++++++
 arch/mips/boot/dts/mobileye/eyeq5.dtsi        | 131 ++++++++
 arch/mips/configs/eyeq5_defconfig             | 109 +++++++
 arch/mips/generic/Makefile                    |   6 +-
 arch/mips/include/asm/addrspace.h             |   5 +
 arch/mips/include/asm/mach-generic/spaces.h   |   4 +
 arch/mips/include/asm/mips-cm.h               |   1 +
 arch/mips/include/asm/smp-cps.h               |   4 +-
 arch/mips/kernel/cps-vec.S                    |  54 +---
 arch/mips/kernel/smp-cps.c                    | 171 ++++++++--
 arch/mips/kernel/traps.c                      |   7 +-
 arch/mips/mobileye/Kconfig                    |  12 +
 arch/mips/mobileye/Platform                   |  16 +
 arch/mips/mobileye/board-epm5.its.S           |  24 ++
 arch/mips/mobileye/vmlinux.its.S              |  32 ++
 26 files changed, 943 insertions(+), 81 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/mips/mobileye.yaml
 create mode 100644 arch/mips/boot/dts/mobileye/Makefile
 create mode 100644 arch/mips/boot/dts/mobileye/eyeq5-epm5.dts
 create mode 100644 arch/mips/boot/dts/mobileye/eyeq5-fixed-clocks.dtsi
 create mode 100644 arch/mips/boot/dts/mobileye/eyeq5.dtsi
 create mode 100644 arch/mips/configs/eyeq5_defconfig
 create mode 100644 arch/mips/mobileye/Kconfig
 create mode 100644 arch/mips/mobileye/Platform
 create mode 100644 arch/mips/mobileye/board-epm5.its.S
 create mode 100644 arch/mips/mobileye/vmlinux.its.S
Signature · 1 line
2.43.0
author maintainer
#9 lore raw

PATCH v6 8/15 dt-bindings: mips: cpu: Add I-Class I6500 Multiprocessor Core

The MIPS Warrior I-class I6500 was announced by Imagination Technologies in 2016 and is used in the Mobileye SoC EyeQ5.

---
 Documentation/devicetree/bindings/mips/cpus.yaml | 1 +
 1 file changed, 1 insertion(+)
Documentation/devicetree/bindings/mips/cpus.yaml +1 -0
index 9bc47868d28b6..a85137add6689 100644
@@ -23,6 +23,7 @@ properties:
       - brcm,bmips4380
       - brcm,bmips5000
       - brcm,bmips5200
+      - img,i6500
       - ingenic,xburst-fpu1.0-mxu1.1
       - ingenic,xburst-fpu2.0-mxu2.0
       - ingenic,xburst-mxu1.0
Signature · 1 line
2.43.0
author maintainer
#2 lore raw

PATCH v6 2/15 MIPS: Fix set_uncached_handler for ebase in XKPHYS

In reply to Gregory CLEMENT

From: Jiaxun Yang <[email protected]>

ebase might reside in XKPHYS if memblock is unable to allocate memory within the KSEG0 physical range.

To map EBASE into uncached space, we convert it back to its physical address and utilize the new CKSEG1ADDR_OR_64BIT helper for mapping.

---
 arch/mips/kernel/traps.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/mips/kernel/traps.c +1 -1
index 0e3f2f2fa732b..355d0f0709de8 100644
@@ -2295,7 +2295,7 @@ static const char panic_null_cerr[] =
 void set_uncached_handler(unsigned long offset, void *addr,
 	unsigned long size)
 {
-	unsigned long uncached_ebase = CKSEG1ADDR(ebase);
+	unsigned long uncached_ebase = CKSEG1ADDR_OR_64BIT(__pa(ebase));
 
 	if (!addr)
 		panic(panic_null_cerr);
Signature · 1 line
2.43.0
author maintainer
#10 lore raw

PATCH v6 9/15 dt-bindings: mips: Add bindings for Mobileye SoCs

In reply to Gregory CLEMENT

Add the yaml bindings for Mobileye SoCs. Currently only EyeQ5 is supported

---
 .../devicetree/bindings/mips/mobileye.yaml    | 32 +++++++++++++++++++
 1 file changed, 32 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/mips/mobileye.yaml
Documentation/devicetree/bindings/mips/mobileye.yaml new file +32 -0
new file mode 100644
index 0000000000000..831975f6b479f
@@ -0,0 +1,32 @@
+# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
+# Copyright 2023 Mobileye Vision Technologies Ltd.
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/mips/mobileye.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Mobileye SoC series
+
+maintainers:
+  - Vladimir Kondratiev <[email protected]>
+  - Gregory CLEMENT <[email protected]>
+  - Théo Lebrun <[email protected]>
+
+description:
+  Boards with a Mobileye SoC shall have the following properties.
+
+properties:
+  $nodename:
+    const: '/'
+
+  compatible:
+    oneOf:
+      - description: Boards with Mobileye EyeQ5 SoC
+        items:
+          - enum:
+              - mobileye,eyeq5-epm5
+          - const: mobileye,eyeq5
+
+additionalProperties: true
+
+...
Signature · 1 line
2.43.0
author maintainer
#11 lore raw

PATCH v6 10/15 dt-bindings: mfd: syscon: Document EyeQ5 OLB

In reply to Gregory CLEMENT

Document Mobileye EyeQ5 compatibles for OLB registers that are miscellaneous SoC related registers.

It is used to expose SoC specific configuration such as for example reset, clock or pinctrl.

---
 Documentation/devicetree/bindings/mfd/syscon.yaml | 1 +
 1 file changed, 1 insertion(+)
Documentation/devicetree/bindings/mfd/syscon.yaml +1 -0
index 084b5c2a2a3c2..c90633460eeca 100644
@@ -55,6 +55,7 @@ properties:
               - mediatek,mt8135-pctl-a-syscfg
               - mediatek,mt8135-pctl-b-syscfg
               - mediatek,mt8365-syscfg
+              - mobileye,eyeq5-olb
               - microchip,lan966x-cpu-syscon
               - microchip,sparx5-cpu-syscon
               - mstar,msc313-pmsleep
Signature · 1 line
2.43.0
author maintainer
#13 lore raw

PATCH v6 11/15 MIPS: mobileye: Add EyeQ5 dtsi

In reply to Gregory CLEMENT

Add a device tree include file for the Mobileye EyeQ5 SoC.

Based on the work of Slava Samsonov <[email protected]>

---
 arch/mips/boot/dts/Makefile                   |   1 +
 .../boot/dts/mobileye/eyeq5-fixed-clocks.dtsi | 292 ++++++++++++++++++
 arch/mips/boot/dts/mobileye/eyeq5.dtsi        | 131 ++++++++
 3 files changed, 424 insertions(+)
 create mode 100644 arch/mips/boot/dts/mobileye/eyeq5-fixed-clocks.dtsi
 create mode 100644 arch/mips/boot/dts/mobileye/eyeq5.dtsi
arch/mips/boot/dts/Makefile +1 -0
index 928f38a79dff9..efff87cb33a9e 100644
@@ -8,6 +8,7 @@ subdir-$(CONFIG_LANTIQ)			+= lantiq
 subdir-$(CONFIG_MACH_LOONGSON64)	+= loongson
 subdir-$(CONFIG_SOC_VCOREIII)		+= mscc
 subdir-$(CONFIG_MIPS_MALTA)		+= mti
+subdir-$(CONFIG_MACH_EYEQ5)		+= mobileye
 subdir-$(CONFIG_LEGACY_BOARD_SEAD3)	+= mti
 subdir-$(CONFIG_FIT_IMAGE_FDT_NI169445)	+= ni
 subdir-$(CONFIG_MACH_PIC32)		+= pic32
arch/mips/boot/dts/mobileye/eyeq5-fixed-clocks.dtsi new file +292 -0

292 lines not on this page · raw message

arch/mips/boot/dts/mobileye/eyeq5.dtsi new file +131 -0

131 lines not on this page · raw message

Signature · 1 line
2.43.0
author maintainer
#7 lore raw

PATCH v6 6/15 dt-bindings: Add vendor prefix for Mobileye Vision Technologies Ltd.

In reply to Gregory CLEMENT

Mobileye Vision Technologies Ltd. is a company developing autonomous driving technologies and advanced driver-assistance systems (ADAS) including cameras, computer chips and software.

---
 Documentation/devicetree/bindings/vendor-prefixes.yaml | 2 ++
 1 file changed, 2 insertions(+)
Documentation/devicetree/bindings/vendor-prefixes.yaml +2 -0
index 309b94c328c84..b45279bc97c14 100644
@@ -897,6 +897,8 @@ patternProperties:
     description: Miyoo
   "^mntre,.*":
     description: MNT Research GmbH
+  "^mobileye,.*":
+    description: Mobileye Vision Technologies Ltd.
   "^modtronix,.*":
     description: Modtronix Engineering
   "^moortec,.*":
Signature · 1 line
2.43.0
author maintainer
#15 lore raw

PATCH v6 12/15 MIPS: mobileye: Add EPM5 device tree

In reply to Gregory CLEMENT

Add a device tree for the Mobileye EPM5 evaluation board.

---
 arch/mips/boot/dts/mobileye/Makefile       |  4 ++++
 arch/mips/boot/dts/mobileye/eyeq5-epm5.dts | 24 ++++++++++++++++++++++
 2 files changed, 28 insertions(+)
 create mode 100644 arch/mips/boot/dts/mobileye/Makefile
 create mode 100644 arch/mips/boot/dts/mobileye/eyeq5-epm5.dts
arch/mips/boot/dts/mobileye/Makefile new file +4 -0
new file mode 100644
index 0000000000000..01c01c3aad81d
@@ -0,0 +1,4 @@
+# SPDX-License-Identifier: GPL-2.0-only
+# Copyright 2023 Mobileye Vision Technologies Ltd.
+
+dtb-$(CONFIG_MACH_EYEQ5)		+= eyeq5-epm5.dtb
arch/mips/boot/dts/mobileye/eyeq5-epm5.dts new file +24 -0
new file mode 100644
index 0000000000000..ff16c3c760a19
@@ -0,0 +1,24 @@
+// SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+/*
+ * Copyright 2023 Mobileye Vision Technologies Ltd.
+ */
+
+/dts-v1/;
+
+#include "eyeq5.dtsi"
+
+/ {
+	compatible = "mobileye,eyeq5-epm5", "mobileye,eyeq5";
+	model = "Mobile EyeQ5 MP5 Evaluation board";
+
+	chosen {
+		bootargs = "earlycon";
+		stdout-path = "serial2:115200n8";
+	};
+
+	memory@0 {
+		device_type = "memory";
+		reg = <0x0 0x08000000 0x0 0x08000000>,
+		      <0x8 0x00000000 0x0 0x78000000>;
+	};
+};
Signature · 1 line
2.43.0
author maintainer
#8 lore raw

PATCH v6 7/15 dt-bindings: mips: cpus: Sort the entries

In reply to Gregory CLEMENT

The entries were nearly sorted but there were still some entries at the wrong places. Let's fix it.

---
 Documentation/devicetree/bindings/mips/cpus.yaml | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
Documentation/devicetree/bindings/mips/cpus.yaml +6 -6
index cf382dea3922c..9bc47868d28b6 100644
@@ -23,22 +23,22 @@ properties:
       - brcm,bmips4380
       - brcm,bmips5000
       - brcm,bmips5200
-      - ingenic,xburst-mxu1.0
       - ingenic,xburst-fpu1.0-mxu1.1
       - ingenic,xburst-fpu2.0-mxu2.0
+      - ingenic,xburst-mxu1.0
       - ingenic,xburst2-fpu2.1-mxu2.1-smt
       - loongson,gs264
       - mips,m14Kc
-      - mips,mips4Kc
-      - mips,mips4KEc
-      - mips,mips24Kc
+      - mips,mips1004Kc
       - mips,mips24KEc
+      - mips,mips24Kc
+      - mips,mips4KEc
+      - mips,mips4Kc
       - mips,mips74Kc
-      - mips,mips1004Kc
       - mti,interaptiv
-      - mti,mips24KEc
       - mti,mips14KEc
       - mti,mips14Kc
+      - mti,mips24KEc
 
   reg:
     maxItems: 1
Signature · 1 line
2.43.0
author maintainer
#18 lore raw

PATCH v6 13/15 MIPS: Share generic kernel code with other architecture

In reply to Gregory CLEMENT

Some architectures might seek to utilize a significant portion of the generic kernel code while maintaining independence from the generic kernel due to specific peculiarities.

This patch allows for the reuse of core code, preventing unnecessary duplication.

---
 arch/mips/Kbuild           | 1 +
 arch/mips/Kconfig          | 3 +++
 arch/mips/generic/Makefile | 6 +++---
 3 files changed, 7 insertions(+), 3 deletions(-)
arch/mips/Kbuild +1 -0
index af2967bffb73d..d683993ed331c 100644
@@ -17,6 +17,7 @@ obj- := $(platform-y)
 # mips object files
 # The object files are linked as core-y files would be linked
 
+obj-y += generic/
 obj-y += kernel/
 obj-y += mm/
 obj-y += net/
arch/mips/Kconfig +3 -0
index 797ae590ebdba..5549d26448941 100644
@@ -109,6 +109,9 @@ config MIPS_FIXUP_BIGPHYS_ADDR
 config MIPS_GENERIC
 	bool
 
+config MACH_GENERIC_CORE
+	bool
+
 config MACH_INGENIC
 	bool
 	select SYS_SUPPORTS_32BIT_KERNEL
arch/mips/generic/Makefile +3 -3
index e37a59bae0a62..56011d738441f 100644
@@ -4,9 +4,9 @@
 # Author: Paul Burton <[email protected]>
 #
 
-obj-y += init.o
-obj-y += irq.o
-obj-y += proc.o
+obj-$(CONFIG_MACH_GENERIC_CORE) += init.o
+obj-$(CONFIG_MACH_GENERIC_CORE) += irq.o
+obj-$(CONFIG_MACH_GENERIC_CORE) += proc.o
 
 obj-$(CONFIG_YAMON_DT_SHIM)		+= yamon-dt.o
 obj-$(CONFIG_LEGACY_BOARD_SEAD3)	+= board-sead3.o
Signature · 1 line
2.43.0
author maintainer
#19 lore raw

PATCH v6 14/15 MIPS: Add support for Mobileye EyeQ5

In reply to Gregory CLEMENT

Introduce support for the MIPS based Mobileye EyeQ5 SoCs.

---
 arch/mips/Kbuild.platforms          |   1 +
 arch/mips/Kconfig                   |  62 ++++++++++++++++
 arch/mips/configs/eyeq5_defconfig   | 109 ++++++++++++++++++++++++++++
 arch/mips/mobileye/Kconfig          |  12 +++
 arch/mips/mobileye/Platform         |  16 ++++
 arch/mips/mobileye/board-epm5.its.S |  24 ++++++
 arch/mips/mobileye/vmlinux.its.S    |  32 ++++++++
 7 files changed, 256 insertions(+)
 create mode 100644 arch/mips/configs/eyeq5_defconfig
 create mode 100644 arch/mips/mobileye/Kconfig
 create mode 100644 arch/mips/mobileye/Platform
 create mode 100644 arch/mips/mobileye/board-epm5.its.S
 create mode 100644 arch/mips/mobileye/vmlinux.its.S
arch/mips/Kbuild.platforms +1 -0
index a2311c4bce6a6..5c145b67d3bf4 100644
@@ -17,6 +17,7 @@ platform-$(CONFIG_MACH_LOONGSON2EF)	+= loongson2ef/
 platform-$(CONFIG_MACH_LOONGSON32)	+= loongson32/
 platform-$(CONFIG_MACH_LOONGSON64)	+= loongson64/
 platform-$(CONFIG_MIPS_MALTA)		+= mti-malta/
+platform-$(CONFIG_MACH_EYEQ5)		+= mobileye/
 platform-$(CONFIG_MACH_NINTENDO64)	+= n64/
 platform-$(CONFIG_PIC32MZDA)		+= pic32/
 platform-$(CONFIG_RALINK)		+= ralink/
arch/mips/Kconfig +62 -0

68 lines not on this page · raw message

arch/mips/configs/eyeq5_defconfig new file +109 -0

109 lines not on this page · raw message

arch/mips/mobileye/Kconfig new file +12 -0
new file mode 100644
index 0000000000000..781007542422d
@@ -0,0 +1,12 @@
+# SPDX-License-Identifier: GPL-2.0
+if MACH_EYEQ5
+
+config BOARD_EYEQ5
+	bool "Support EyeQ5 platform"
+	select WEAK_ORDERING
+	select WEAK_REORDERING_BEYOND_LLSC
+	default n
+	help
+	  This enables support for EyeQ5 platform.
+
+endif
arch/mips/mobileye/Platform new file +16 -0
new file mode 100644
index 0000000000000..43b6f4644592f
@@ -0,0 +1,16 @@
+#
+# Copyright (C) 2016 Imagination Technologies
+# Author: Paul Burton <[email protected]>
+#
+# This program is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the
+# Free Software Foundation;  either version 2 of the  License, or (at your
+# option) any later version.
+#
+
+load-$(CONFIG_MACH_EYEQ5)	= 0xa800000808000000
+all-$(CONFIG_MACH_EYEQ5)	+= vmlinux.gz.itb
+
+its-y					:= vmlinux.its.S
+its-$(CONFIG_FIT_IMAGE_FDT_EPM5)	+= board-epm5.its.S
+
arch/mips/mobileye/board-epm5.its.S new file +24 -0
new file mode 100644
index 0000000000000..08e8c4f183d63
@@ -0,0 +1,24 @@
+/* SPDX-License-Identifier: (GPL-2.0 OR MIT) */
+/ {
+	images {
+		fdt-mobileye-epm5 {
+			description = "Mobileeye MP5 Device Tree";
+			data = /incbin/("boot/dts/mobileye/eyeq5-epm5.dtb");
+			type = "flat_dt";
+			arch = "mips";
+			compression = "none";
+			hash {
+				algo = "sha1";
+			};
+		};
+	};
+
+    configurations {
+		default = "conf-1";
+		conf-1 {
+			description = "Mobileye EPM5 Linux kernel";
+			kernel = "kernel";
+			fdt = "fdt-mobileye-epm5";
+		};
+	};
+};
arch/mips/mobileye/vmlinux.its.S new file +32 -0
new file mode 100644
index 0000000000000..3e254676540f4
@@ -0,0 +1,32 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+/dts-v1/;
+
+/ {
+	description = KERNEL_NAME;
+	#address-cells = <ADDR_CELLS>;
+
+	images {
+		kernel {
+			description = KERNEL_NAME;
+			data = /incbin/(VMLINUX_BINARY);
+			type = "kernel";
+			arch = "mips";
+			os = "linux";
+			compression = VMLINUX_COMPRESSION;
+			load = /bits/ ADDR_BITS <VMLINUX_LOAD_ADDRESS>;
+			entry = /bits/ ADDR_BITS <VMLINUX_ENTRY_ADDRESS>;
+			hash {
+				algo = "sha1";
+			};
+		};
+	};
+
+	configurations {
+		default = "conf-default";
+
+		conf-default {
+			description = "Generic Linux kernel";
+			kernel = "kernel";
+		};
+	};
+};
Signature · 1 line
2.43.0
author maintainer
#21 lore raw

PATCH v6 15/15 MAINTAINERS: Add entry for Mobileye MIPS SoCs

In reply to Gregory CLEMENT

Add Vlad, Théo and myself as co-maintainers for the Mobileye MIPS SoCs.

---
 MAINTAINERS | 12 ++++++++++++
 1 file changed, 12 insertions(+)
MAINTAINERS +12 -0
index b3444c8c6512e..b18f328ee8ee7 100644
@@ -14546,6 +14546,18 @@ W:	https://linuxtv.org
 Q:	http://patchwork.linuxtv.org/project/linux-media/list/
 F:	drivers/media/dvb-frontends/mn88473*
 
+MOBILEYE MIPS SOCS
+M:	Vladimir Kondratiev <[email protected]>
+M:	Gregory CLEMENT <[email protected]>
+M:	Théo Lebrun <[email protected]>
+L:	[email protected]
+S:	Maintained
+F:	Documentation/devicetree/bindings/mips/mobileye.yaml
+F:	arch/mips/boot/dts/mobileye/
+F:	arch/mips/configs/eyeq5_defconfig
+F:	arch/mips/mobileye/board-epm5.its.S
+F:	include/dt-bindings/soc/mobileye,eyeq5.h
+
 MODULE SUPPORT
 M:	Luis Chamberlain <[email protected]>
 L:	[email protected]
Signature · 1 line
2.43.0
#20 lore raw

Re: [PATCH v6 14/15] MIPS: Add support for Mobileye EyeQ5

In reply to Gregory CLEMENT
Quoted 3 lines · Gregory CLEMENT

Introduce support for the MIPS based Mobileye EyeQ5 SoCs.

Hi Gregory,

Thanks for your reversion!
See my comments below.

Quoted 32 lines
---
  arch/mips/Kbuild.platforms          |   1 +
  arch/mips/Kconfig                   |  62 ++++++++++++++++
  arch/mips/configs/eyeq5_defconfig   | 109 ++++++++++++++++++++++++++++
  arch/mips/mobileye/Kconfig          |  12 +++
  arch/mips/mobileye/Platform         |  16 ++++
  arch/mips/mobileye/board-epm5.its.S |  24 ++++++
  arch/mips/mobileye/vmlinux.its.S    |  32 ++++++++
  7 files changed, 256 insertions(+)

create mode 100644 arch/mips/configs/eyeq5_defconfig create mode 100644 arch/mips/mobileye/Kconfig create mode 100644 arch/mips/mobileye/Platform create mode 100644 arch/mips/mobileye/board-epm5.its.S create mode 100644 arch/mips/mobileye/vmlinux.its.S

arch/mips/Kbuild.platforms +1 -0
index a2311c4bce6a6..5c145b67d3bf4 100644
@@ -17,6 +17,7 @@ platform-$(CONFIG_MACH_LOONGSON2EF)	+= loongson2ef/
  platform-$(CONFIG_MACH_LOONGSON32)	+= loongson32/
  platform-$(CONFIG_MACH_LOONGSON64)	+= loongson64/
  platform-$(CONFIG_MIPS_MALTA)		+= mti-malta/
+platform-$(CONFIG_MACH_EYEQ5)		+= mobileye/
  platform-$(CONFIG_MACH_NINTENDO64)	+= n64/
  platform-$(CONFIG_PIC32MZDA)		+= pic32/
  platform-$(CONFIG_RALINK)		+= ralink/
arch/mips/Kconfig +0 -0
index 5549d26448941..e4f624adffee8 100644

arch/mips/Kconfig config MACH_PIC32 · line 577

Quoted 9 lines
arch/mips/Kconfig +6 -0
@@ -569,6 +569,68 @@ config MACH_PIC32
  	  Microchip PIC32 is a family of general-purpose 32 bit MIPS core
  	  microcontrollers.
 
+config MACH_EYEQ5
+	bool "Mobileye EyeQ5 SoC"
+	select MACH_GENERIC_CORE
+	select ARM_AMBA
+	select WEAK_ORDERING
+	select WEAK_REORDERING_BEYOND_LLSC

^ Those should be selected for MIPS_CPS, as I mentioned before.

Quoted 12 lines
arch/mips/Kconfig +12 -0
+	select PHYSICAL_START_BOOL
+	select ARCH_SPARSEMEM_DEFAULT if 64BIT
+	select BOOT_RAW
+	select BUILTIN_DTB
+	select CEVT_R4K
+	select CLKSRC_MIPS_GIC
+	select COMMON_CLK
+	select CPU_MIPSR2_IRQ_EI
+	select CPU_MIPSR2_IRQ_VI
+	select CSRC_R4K
+	select DMA_NONCOHERENT
+	select HAVE_PCI

arch/mips/Kconfig config MACH_PIC32 · line 599

Quoted 10 lines
arch/mips/Kconfig +10 -0
+	select IRQ_MIPS_CPU
+	select MIPS_AUTO_PFN_OFFSET
+	select MIPS_CPU_SCACHE
+	select MIPS_GIC
+	select MIPS_L1_CACHE_SHIFT_7
+	select PCI_DRIVERS_GENERIC
+	select SMP_UP if SMP
+	select SWAP_IO_SPACE
+	select SYS_HAS_CPU_MIPS64_R6
+	select SYS_SUPPORTS_32BIT_KERNEL

^ I don't think you can build 32bit kernel due to your address space limitation.

arch/mips/Kconfig config MACH_PIC32 · line 601

Quoted 2 lines
arch/mips/Kconfig +2 -0
+	select SYS_SUPPORTS_64BIT_KERNEL
+	select SYS_SUPPORTS_BIG_ENDIAN

^ Does it support big endian mode?
For I6500 endian pin is driven by external circuit. You shouldn't select it unless you have physical endian pin or reset and set register at SoC level.

arch/mips/Kconfig config MACH_PIC32 · line 605

Quoted 4 lines
arch/mips/Kconfig +4 -0
+	select SYS_SUPPORTS_HIGHMEM
+	select SYS_SUPPORTS_LITTLE_ENDIAN
+	select SYS_SUPPORTS_MICROMIPS
+	select SYS_SUPPORTS_MIPS16

^ Both MICROMIPS and MIPS16 are not available on MIPS R6.

arch/mips/Kconfig config MACH_PIC32 · line 607

Quoted 2 lines
arch/mips/Kconfig +2 -0
+	select SYS_SUPPORTS_MIPS_CPS
+	select SYS_SUPPORTS_MULTITHREADING

^ MT is not possible on R6, we do have VP on R6.

arch/mips/Kconfig config MACH_PIC32 · line 609

Quoted 2 lines
arch/mips/Kconfig +2 -0
+	select SYS_SUPPORTS_RELOCATABLE
+	select SYS_SUPPORTS_SMARTMIPS

^ SMARTMIPS is deprecated on R6.

Quoted 132 lines
arch/mips/Kconfig +24 -0
+	select SYS_SUPPORTS_ZBOOT
+	select UHI_BOOT
+	select USB_EHCI_BIG_ENDIAN_DESC if CPU_BIG_ENDIAN
+	select USB_EHCI_BIG_ENDIAN_MMIO if CPU_BIG_ENDIAN
+	select USB_OHCI_BIG_ENDIAN_DESC if CPU_BIG_ENDIAN
+	select USB_OHCI_BIG_ENDIAN_MMIO if CPU_BIG_ENDIAN
+	select USB_UHCI_BIG_ENDIAN_DESC if CPU_BIG_ENDIAN
+	select USB_UHCI_BIG_ENDIAN_MMIO if CPU_BIG_ENDIAN
+	select USE_OF
+	help
+	  Select this to build a kernel supporting EyeQ5 SoC from Mobileye.
+
+	bool
+
+config FIT_IMAGE_FDT_EPM5
+	bool "Include FDT for Mobileye EyeQ5 development platforms"
+	depends on MACH_EYEQ5
+	default n
+	help
+	  Enable this to include the FDT for the EyeQ5 development platforms
+	  from Mobileye in the FIT kernel image.
+	  This requires u-boot on the platform.
+
+
  config MACH_NINTENDO64
  	bool "Nintendo 64 console"
  	select CEVT_R4K
arch/mips/configs/eyeq5_defconfig new file +99 -0
new file mode 100644
index 0000000000000..653fb11b1580d
@@ -0,0 +1,109 @@
+CONFIG_SYSVIPC=y
+CONFIG_NO_HZ_IDLE=y
+CONFIG_HIGH_RES_TIMERS=y
+CONFIG_BPF_SYSCALL=y
+CONFIG_TASKSTATS=y
+CONFIG_IKCONFIG=y
+CONFIG_IKCONFIG_PROC=y
+CONFIG_MEMCG=y
+CONFIG_BLK_CGROUP=y
+CONFIG_CFS_BANDWIDTH=y
+CONFIG_RT_GROUP_SCHED=y
+CONFIG_CGROUP_PIDS=y
+CONFIG_CGROUP_FREEZER=y
+CONFIG_CPUSETS=y
+CONFIG_CGROUP_DEVICE=y
+CONFIG_CGROUP_CPUACCT=y
+CONFIG_NAMESPACES=y
+CONFIG_USER_NS=y
+CONFIG_SCHED_AUTOGROUP=y
+CONFIG_BLK_DEV_INITRD=y
+CONFIG_EXPERT=y
+CONFIG_MACH_EYEQ5=y
+CONFIG_FIT_IMAGE_FDT_EPM5=y
+CONFIG_CPU_LITTLE_ENDIAN=y
+CONFIG_64BIT=y
+CONFIG_PAGE_SIZE_16KB=y
+CONFIG_MIPS_CPS=y
+CONFIG_CPU_HAS_MSA=y
+CONFIG_NR_CPUS=16
+CONFIG_JUMP_LABEL=y
+CONFIG_COMPAT_32BIT_TIME=y
+CONFIG_MODULES=y
+CONFIG_MODULE_UNLOAD=y
+CONFIG_TRIM_UNUSED_KSYMS=y
+# CONFIG_COMPAT_BRK is not set
+CONFIG_SPARSEMEM_MANUAL=y
+CONFIG_USERFAULTFD=y
+CONFIG_NET=y
+CONFIG_PACKET=y
+CONFIG_UNIX=y
+CONFIG_NET_KEY=y
+CONFIG_INET=y
+CONFIG_IP_PNP=y
+CONFIG_IP_PNP_DHCP=y
+CONFIG_NETFILTER=y
+CONFIG_CAN=y
+CONFIG_PCI=y
+CONFIG_PCI_MSI=y
+CONFIG_PCI_DEBUG=y
+CONFIG_PCI_ENDPOINT=y
+CONFIG_DEVTMPFS=y
+CONFIG_DEVTMPFS_MOUNT=y
+CONFIG_CONNECTOR=y
+CONFIG_MTD=y
+CONFIG_MTD_UBI=y
+CONFIG_MTD_UBI_BLOCK=y
+CONFIG_SCSI=y
+CONFIG_NETDEVICES=y
+CONFIG_MACVLAN=y
+CONFIG_IPVLAN=y
+CONFIG_MACB=y
+CONFIG_MARVELL_PHY=y
+CONFIG_MICREL_PHY=y
+CONFIG_CAN_M_CAN=y
+CONFIG_SERIAL_AMBA_PL011=y
+CONFIG_SERIAL_AMBA_PL011_CONSOLE=y
+CONFIG_HW_RANDOM=y
+# CONFIG_PTP_1588_CLOCK is not set
+CONFIG_PINCTRL=y
+CONFIG_MFD_SYSCON=y
+CONFIG_HID_A4TECH=y
+CONFIG_HID_BELKIN=y
+CONFIG_HID_CHERRY=y
+CONFIG_HID_CYPRESS=y
+CONFIG_HID_EZKEY=y
+CONFIG_HID_ITE=y
+CONFIG_HID_KENSINGTON=y
+CONFIG_HID_REDRAGON=y
+CONFIG_HID_MICROSOFT=y
+CONFIG_HID_MONTEREY=y
+CONFIG_MMC=y
+CONFIG_MMC_SDHCI=y
+# CONFIG_IOMMU_SUPPORT is not set
+CONFIG_RESET_CONTROLLER=y
+# CONFIG_NVMEM is not set
+CONFIG_EXT4_FS=y
+CONFIG_EXT4_FS_POSIX_ACL=y
+CONFIG_EXT4_FS_SECURITY=y
+CONFIG_FS_ENCRYPTION=y
+CONFIG_FUSE_FS=y
+CONFIG_CUSE=y
+CONFIG_MSDOS_FS=y
+CONFIG_VFAT_FS=y
+CONFIG_TMPFS=y
+CONFIG_TMPFS_POSIX_ACL=y
+CONFIG_UBIFS_FS=y
+CONFIG_NFS_FS=y
+CONFIG_NFS_V3_ACL=y
+CONFIG_NFS_V4=y

arch/mips/configs/eyeq5_defconfig line 109

Quoted 10 lines
arch/mips/configs/eyeq5_defconfig new file +10 -0
+CONFIG_NFS_V4_1=y
+CONFIG_NFS_V4_2=y
+CONFIG_ROOT_NFS=y
+CONFIG_CRYPTO_CRC32_MIPS=y
+CONFIG_FRAME_WARN=1024
+CONFIG_DEBUG_FS=y
+# CONFIG_RCU_TRACE is not set
+# CONFIG_FTRACE is not set
+CONFIG_CMDLINE_BOOL=y
+CONFIG_CMDLINE="earlycon"

^ Better not overriding cmdline here, you can leave it in chosen node.

Quoted 6 lines
arch/mips/mobileye/Kconfig new file +0 -0
new file mode 100644
index 0000000000000..781007542422d

arch/mips/mobileye/Kconfig line 10

Quoted 10 lines
arch/mips/mobileye/Kconfig new file +10 -0
@@ -0,0 +1,12 @@
+# SPDX-License-Identifier: GPL-2.0
+if MACH_EYEQ5
+
+config BOARD_EYEQ5
+	bool "Support EyeQ5 platform"
+	select WEAK_ORDERING
+	select WEAK_REORDERING_BEYOND_LLSC
+	default n
+	help
+	  This enables support for EyeQ5 platform.

^ Do you need this board option, given that you can build a generic kernel for all EyeQ5 systems?

Thanks
- Jiaxun

Quoted 92 lines
arch/mips/mobileye/Kconfig new file +2 -0
+
+endif
arch/mips/mobileye/Platform new file +16 -0
new file mode 100644
index 0000000000000..43b6f4644592f
@@ -0,0 +1,16 @@
+#
+# Copyright (C) 2016 Imagination Technologies
+# Author: Paul Burton <[email protected]>
+#
+# This program is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the
+# Free Software Foundation;  either version 2 of the  License, or (at your
+# option) any later version.
+#
+
+load-$(CONFIG_MACH_EYEQ5)	= 0xa800000808000000
+all-$(CONFIG_MACH_EYEQ5)	+= vmlinux.gz.itb
+
+its-y					:= vmlinux.its.S
+its-$(CONFIG_FIT_IMAGE_FDT_EPM5)	+= board-epm5.its.S
+
arch/mips/mobileye/board-epm5.its.S new file +24 -0
new file mode 100644
index 0000000000000..08e8c4f183d63
@@ -0,0 +1,24 @@
+/* SPDX-License-Identifier: (GPL-2.0 OR MIT) */
+/ {
+	images {
+		fdt-mobileye-epm5 {
+			description = "Mobileeye MP5 Device Tree";
+			data = /incbin/("boot/dts/mobileye/eyeq5-epm5.dtb");
+			type = "flat_dt";
+			arch = "mips";
+			compression = "none";
+			hash {
+				algo = "sha1";
+			};
+		};
+	};
+
+    configurations {
+		default = "conf-1";
+		conf-1 {
+			description = "Mobileye EPM5 Linux kernel";
+			kernel = "kernel";
+			fdt = "fdt-mobileye-epm5";
+		};
+	};
+};
arch/mips/mobileye/vmlinux.its.S new file +32 -0
new file mode 100644
index 0000000000000..3e254676540f4
@@ -0,0 +1,32 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+/dts-v1/;
+
+/ {
+	description = KERNEL_NAME;
+	#address-cells = <ADDR_CELLS>;
+
+	images {
+		kernel {
+			description = KERNEL_NAME;
+			data = /incbin/(VMLINUX_BINARY);
+			type = "kernel";
+			arch = "mips";
+			os = "linux";
+			compression = VMLINUX_COMPRESSION;
+			load = /bits/ ADDR_BITS <VMLINUX_LOAD_ADDRESS>;
+			entry = /bits/ ADDR_BITS <VMLINUX_ENTRY_ADDRESS>;
+			hash {
+				algo = "sha1";
+			};
+		};
+	};
+
+	configurations {
+		default = "conf-default";
+
+		conf-default {
+			description = "Generic Linux kernel";
+			kernel = "kernel";
+		};
+	};
+};
Signature · 2 lines
---
Jiaxun Yang
Reviewed-by on v6 4/15
#5 lore raw

Re: [PATCH v6 04/15] MIPS: traps: Give more explanations if ebase doesn't belong to KSEG0

In reply to Gregory CLEMENT
Quoted 8 lines · Gregory CLEMENT

With the expanded support for placing the kernel in XPHYS rather than just KSEG0, scenarios where ebase doesn't belong to KSEG0 are more likely to occur. In such cases, we currently experience a substantial and perplexing stack dump without any accompanying explanation. To rectify this, we aim to replace the uninformative stack dump with a warning that offers a clear explanation of the issue.

Quoted 23 lines
---
  arch/mips/kernel/traps.c | 5 ++++-
  1 file changed, 4 insertions(+), 1 deletion(-)
arch/mips/kernel/traps.c +4 -1
index 355d0f0709de8..911d2233d6d0b 100644
@@ -2347,10 +2347,13 @@ void __init trap_init(void)
  		 * EVA is special though as it allows segments to be rearranged
  		 * and to become uncached during cache error handling.
  		 */
-		if (!IS_ENABLED(CONFIG_EVA) && !WARN_ON(ebase_pa >= 0x20000000))
+		if (!IS_ENABLED(CONFIG_EVA) && ebase_pa < 0x20000000)
  			ebase = CKSEG0ADDR(ebase_pa);
  		else
  			ebase = (unsigned long)phys_to_virt(ebase_pa);
+		if (ebase_pa >= 0x20000000)
+			pr_warn("ebase(%pa) should better be in KSeg0",
+				&ebase_pa);
  	}
 
  	if (cpu_has_mmips) {
Signature · 2 lines
---
Jiaxun Yang
Reviewed-by on v6 12/15
#16 lore raw

Re: [PATCH v6 12/15] MIPS: mobileye: Add EPM5 device tree

In reply to Gregory CLEMENT
Quoted 3 lines · Gregory CLEMENT

Add a device tree for the Mobileye EPM5 evaluation board.

Quoted 47 lines
---
  arch/mips/boot/dts/mobileye/Makefile       |  4 ++++
  arch/mips/boot/dts/mobileye/eyeq5-epm5.dts | 24 ++++++++++++++++++++++
  2 files changed, 28 insertions(+)

create mode 100644 arch/mips/boot/dts/mobileye/Makefile create mode 100644 arch/mips/boot/dts/mobileye/eyeq5-epm5.dts

arch/mips/boot/dts/mobileye/Makefile new file +4 -0
new file mode 100644
index 0000000000000..01c01c3aad81d
@@ -0,0 +1,4 @@
+# SPDX-License-Identifier: GPL-2.0-only
+# Copyright 2023 Mobileye Vision Technologies Ltd.
+
+dtb-$(CONFIG_MACH_EYEQ5)		+= eyeq5-epm5.dtb
arch/mips/boot/dts/mobileye/eyeq5-epm5.dts new file +24 -0
new file mode 100644
index 0000000000000..ff16c3c760a19
@@ -0,0 +1,24 @@
+// SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+/*
+ * Copyright 2023 Mobileye Vision Technologies Ltd.
+ */
+
+/dts-v1/;
+
+#include "eyeq5.dtsi"
+
+/ {
+	compatible = "mobileye,eyeq5-epm5", "mobileye,eyeq5";
+	model = "Mobile EyeQ5 MP5 Evaluation board";
+
+	chosen {
+		bootargs = "earlycon";
+		stdout-path = "serial2:115200n8";
+	};
+
+	memory@0 {
+		device_type = "memory";
+		reg = <0x0 0x08000000 0x0 0x08000000>,
+		      <0x8 0x00000000 0x0 0x78000000>;
+	};
+};
Signature · 2 lines
---
Jiaxun Yang
author maintainer
#22 lore raw
In reply to Gregory CLEMENT

Gregory CLEMENT <[email protected]> writes:

Hello Thomas,

Quoted 13 lines

Hello,

The EyeQ5 SoC from Mobileye is based on the MIPS I6500 architecture and features multiple controllers such as the classic UART, I2C, SPI, as well as CAN-FD, PCIe, Octal/Quad SPI Flash interface, Gigabit Ethernet, MIPI CSI-2, and eMMC 5.1. It also includes a Hardware Security Module, Functional Safety Hardware, and MJPEG encoder.

One peculiarity of this SoC is that the physical address of the DDDR exceeds 32 bits. Given that the architecture is 64 bits, this is not an issue, but it requires some changes in how the mips64 is currently managed during boot.

Quoted 11 lines

In this sixth version, I tried to fix the last two issues I found to merge the series. The first one is about using dedicated platform support while still reusing code as much as possible, following patches 13 and 14.The second point is about the "Fix kernel in XKPHYS" series I added, which has some issues reported by Thomas. At first, I only kept the necessary part for booting with XKPHYS, leaving out the clean-up and optimization. Then, I addressed two concerns in this series by adding an extra macro in the "MIPS: spaces: Define a couple of handy macros" patch. Lastly, I attempted to make the changes more concise and focus solely on a single purpose in the "MIPS: Allows relocation exception vectors everywhere" patch.

What do you think of these series? Does it match your requirements? I am about to send a new version, taking into account the remarks from Jiaxun about the configuration. However, before doing this, I would like to know if more changes are needed.

Thanks,

Gregory

Quoted 160 lines

To build and test the kernel, we need to run the following commands:

make eyeq5_defconfig
make vmlinuz.itb

Changelog:

v5 -> v6:

- From series v5, patches 1 ("MIPS: Export higher/highest relocation functions in uasm") and 3 ("MIPS: genex: Fix except_vec_vi for kernel in XKPHYS)" have been removed as "MIPS:
Allow vectored interrupt handler to reside everywhere for 64bit" and "MIPS: Remove unused shadow GPR support from vector irq setup" address the same requirement.

- From series v5, patches 8 to 12 have been removed as they are not mandatory to support EyeQ5 SoCs.

- The 1st patch of series v6 ("MIPS: spaces: Define a couple of handy macros") has been modified to add the extra macros CKSEG[01]ADDR_OR_64BIT.

- Patch 3 ("MIPS: Allows relocation exception vectors everywhere") is a merge of patches 6 ("MIPS: Refactor mips_cps_core_entry implementation) and 7 ("MIPS: Fix cache issue with mips_cps_core_entry") from series v5. It has been rewritten to reduce the diff stat; the 64-bit fixes have been moved to patch 5 ("MIPS: cps-vec: Use macros for 64-bit access").

- Patch 13 ("MIPS: Share generic kernel code with other architecture)" is a new one allowing separate platform support in the patch ("MIPS: Add support for Mobileye EyeQ5").

v4 -> v5:

- Improve commit messages for patch 3, 5, 12 and 13.

- Fix style in patch 9

- Really enable SPARSMEM and use correct address in board-eyeq5.config in patch 21

v3 -> v4:

- Fix build warning in "MIPS: Get rid of CONFIG_NO_EXCEPT_FILL":
check that we are in 64bit mode before using KSEG0 that exist only in this mode.

- Modify "MIPS: spaces: Define a couple of handy macros" to be buildable in 32bit mode.

- Use correct format specifier to print address in "MIPS: traps: Give more explanations if ebase doesn't belong to KSEG0"

- In "MIPS: generic: Add support for Mobileye EyeQ5",remove CONFIG_ZBOOT_LOAD_ADDRESS from board-eyeq5.config, (as well as CONFIG_USE_XKPHYS that does not exist anymore) and add CONFIG_SPARSEMEM_MANUAL to enable SPARSMEM.

v2 -> v3

- Added more reviewed-by and acked-by tags

- Fix sorting for cpus entries in

- Fix indentation issue in Documentation/devicetree/bindings/mips/mobileye.yaml

v1 -> v2

- Added reviewed-by and acked-by tags

- Fix typos reported

- In patch 15 use 'img' vendor string instead of mti

- In patch 16 modify licence

- In patch 17 give more explanations about the block usage.

- In patch 18, remove _ in node names, don't use anymore CONFIG_BUILTIN_DTB in Makefile, remove macro, modify licence.

- In patch 19 remove most of the bootargs and only keeps earlycon. I also split the memory in 2 part in the device tree.

- Integrate the series from Jiaxun Yang
https://lore.kernel.org/linux-mips/[email protected]/

They are patches 2 to 6 and 8 to 12

Then I added patch 7 to fix the cache issue visible on the Mobileye platform, I also add patch 13 to improve warning message when ebase doesn't belong to KSEG0

Regards,

Gregory

Gregory CLEMENT (13):
MIPS: spaces: Define a couple of handy macros
MIPS: traps: Give more explanations if ebase doesn't belong to KSEG0
MIPS: cps-vec: Use macros for 64bits access
dt-bindings: Add vendor prefix for Mobileye Vision Technologies Ltd.
dt-bindings: mips: cpus: Sort the entries
dt-bindings: mips: cpu: Add I-Class I6500 Multiprocessor Core
dt-bindings: mips: Add bindings for Mobileye SoCs
dt-bindings: mfd: syscon: Document EyeQ5 OLB
MIPS: mobileye: Add EyeQ5 dtsi
MIPS: mobileye: Add EPM5 device tree
MIPS: Share generic kernel code with other architecture
MIPS: Add support for Mobileye EyeQ5
MAINTAINERS: Add entry for Mobileye MIPS SoCs

Jiaxun Yang (2):
MIPS: Fix set_uncached_handler for ebase in XKPHYS
MIPS: Allows relocation exception vectors everywhere

 .../devicetree/bindings/mfd/syscon.yaml       |   1 +
 .../devicetree/bindings/mips/cpus.yaml        |  13 +-
 .../devicetree/bindings/mips/mobileye.yaml    |  32 ++
 .../devicetree/bindings/vendor-prefixes.yaml  |   2 +
 MAINTAINERS                                   |  12 +
 arch/mips/Kbuild                              |   1 +
 arch/mips/Kbuild.platforms                    |   1 +
 arch/mips/Kconfig                             |  65 ++++
 arch/mips/boot/dts/Makefile                   |   1 +
 arch/mips/boot/dts/mobileye/Makefile          |   4 +
 arch/mips/boot/dts/mobileye/eyeq5-epm5.dts    |  24 ++
 .../boot/dts/mobileye/eyeq5-fixed-clocks.dtsi | 292 ++++++++++++++++++
 arch/mips/boot/dts/mobileye/eyeq5.dtsi        | 131 ++++++++
 arch/mips/configs/eyeq5_defconfig             | 109 +++++++
 arch/mips/generic/Makefile                    |   6 +-
 arch/mips/include/asm/addrspace.h             |   5 +
 arch/mips/include/asm/mach-generic/spaces.h   |   4 +
 arch/mips/include/asm/mips-cm.h               |   1 +
 arch/mips/include/asm/smp-cps.h               |   4 +-
 arch/mips/kernel/cps-vec.S                    |  54 +---
 arch/mips/kernel/smp-cps.c                    | 171 ++++++++--
 arch/mips/kernel/traps.c                      |   7 +-
 arch/mips/mobileye/Kconfig                    |  12 +
 arch/mips/mobileye/Platform                   |  16 +
 arch/mips/mobileye/board-epm5.its.S           |  24 ++
 arch/mips/mobileye/vmlinux.its.S              |  32 ++
 26 files changed, 943 insertions(+), 81 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/mips/mobileye.yaml
 create mode 100644 arch/mips/boot/dts/mobileye/Makefile
 create mode 100644 arch/mips/boot/dts/mobileye/eyeq5-epm5.dts
 create mode 100644 arch/mips/boot/dts/mobileye/eyeq5-fixed-clocks.dtsi
 create mode 100644 arch/mips/boot/dts/mobileye/eyeq5.dtsi
 create mode 100644 arch/mips/configs/eyeq5_defconfig
 create mode 100644 arch/mips/mobileye/Kconfig
 create mode 100644 arch/mips/mobileye/Platform
 create mode 100644 arch/mips/mobileye/board-epm5.its.S
 create mode 100644 arch/mips/mobileye/vmlinux.its.S
Signature · 1 line
2.43.0
Signature · 3 lines
Gregory Clement, Bootlin
Embedded Linux and Kernel engineering
http://bootlin.com
#14 lore raw

Re: [PATCH v6 11/15] MIPS: mobileye: Add EyeQ5 dtsi

In reply to Gregory CLEMENT
Quoted 6 lines · Gregory CLEMENT

Add a device tree include file for the Mobileye EyeQ5 SoC.

Based on the work of Slava Samsonov <[email protected]>

---

...

Quoted 28 lines
arch/mips/boot/dts/mobileye/eyeq5.dtsi new file +28 -0
+
+	soc: soc {
+		#address-cells = <2>;
+		#size-cells = <2>;
+		ranges;
+		compatible = "simple-bus";
+
+		uart0: serial@800000 {
+			compatible = "arm,pl011", "arm,primecell";
+			reg = <0 0x800000 0x0 0x1000>;
+			reg-io-width = <4>;
+			interrupt-parent = <&gic>;
+			interrupts = <GIC_SHARED 6 IRQ_TYPE_LEVEL_HIGH>;
+			clocks  = <&uart_clk>, <&occ_periph>;
+			clock-names = "uartclk", "apb_pclk";
+		};
+
+		uart1: serial@900000 {
+			compatible = "arm,pl011", "arm,primecell";
+			reg = <0 0x900000 0x0 0x1000>;
+			reg-io-width = <4>;
+			interrupt-parent = <&gic>;
+			interrupts = <GIC_SHARED 6 IRQ_TYPE_LEVEL_HIGH>;
+			clocks  = <&uart_clk>, <&occ_periph>;
+			clock-names = "uartclk", "apb_pclk";
+		};
+
+		uart2: serial@a00000 {

arch/mips/boot/dts/mobileye/eyeq5.dtsi line 103

Quoted 10 lines
arch/mips/boot/dts/mobileye/eyeq5.dtsi new file +10 -0
+			compatible = "arm,pl011", "arm,primecell";
+			reg = <0 0xa00000 0x0 0x1000>;
+			reg-io-width = <4>;
+			interrupt-parent = <&gic>;
+			interrupts = <GIC_SHARED 6 IRQ_TYPE_LEVEL_HIGH>;
+			clocks  = <&uart_clk>, <&occ_periph>;
+			clock-names = "uartclk", "apb_pclk";
+		};
+
+		olb: olb@e00000 {

That's not a correct name. Please do not send knowingly incorrect DTS.

arch/mips/boot/dts/mobileye/eyeq5.dtsi line 106

Quoted 3 lines
arch/mips/boot/dts/mobileye/eyeq5.dtsi new file +3 -0
+			compatible = "mobileye,eyeq5-olb", "syscon", "simple-mfd";
+			reg = <0 0xe00000 0x0 0x400>;
+			reg-io-width = <4>;

That's not needed property here.

Quoted 15 lines
arch/mips/boot/dts/mobileye/eyeq5.dtsi new file +15 -0
+		};
+
+		gic: interrupt-controller@140000 {
+			compatible = "mti,gic";
+			reg = <0x0 0x140000 0x0 0x20000>;
+			interrupt-controller;
+			#interrupt-cells = <3>;
+
+			/*
+			* Declare the interrupt-parent even though the mti,gic
+			* binding doesn't require it, such that the kernel can
+			* figure out that cpu_intc is the root interrupt
+			* controller & should be probed first.
+			*/
+			interrupt-parent = <&cpu_intc>;

arch/mips/boot/dts/mobileye/eyeq5.dtsi line 131

Quoted 10 lines
arch/mips/boot/dts/mobileye/eyeq5.dtsi new file +10 -0
+
+			timer {
+				compatible = "mti,gic-timer";
+				interrupts = <GIC_LOCAL 1 IRQ_TYPE_NONE>;
+				clocks = <&core0_clk>;
+			};
+		};
+	};
+};
+

Stray blank line.

Best regards,
Krzysztof

#12 lore raw

Re: [PATCH v6 10/15] dt-bindings: mfd: syscon: Document EyeQ5 OLB

In reply to Gregory CLEMENT
Quoted 7 lines · Gregory CLEMENT

Document Mobileye EyeQ5 compatibles for OLB registers that are miscellaneous SoC related registers.

It is used to expose SoC specific configuration such as for example reset, clock or pinctrl.

No, please drop.

Quoted 10 lines
---
 Documentation/devicetree/bindings/mfd/syscon.yaml | 1 +
 1 file changed, 1 insertion(+)
Documentation/devicetree/bindings/mfd/syscon.yaml +0 -0
index 084b5c2a2a3c2..c90633460eeca 100644

Documentation/devicetree/bindings/mfd/syscon.yaml properties: · line 58

Quoted 4 lines
Documentation/devicetree/bindings/mfd/syscon.yaml +1 -0
@@ -55,6 +55,7 @@ properties:
               - mediatek,mt8135-pctl-a-syscfg
               - mediatek,mt8135-pctl-b-syscfg
               - mediatek,mt8365-syscfg
+              - mobileye,eyeq5-olb

Please work with your colleague to avoid posting contradictory patches.

This is something else.

NAK

Best regards,
Krzysztof

#17 lore raw

Re: [PATCH v6 12/15] MIPS: mobileye: Add EPM5 device tree

In reply to Gregory CLEMENT
Quoted 31 lines · Gregory CLEMENT

Add a device tree for the Mobileye EPM5 evaluation board.

---
 arch/mips/boot/dts/mobileye/Makefile       |  4 ++++
 arch/mips/boot/dts/mobileye/eyeq5-epm5.dts | 24 ++++++++++++++++++++++
 2 files changed, 28 insertions(+)
 create mode 100644 arch/mips/boot/dts/mobileye/Makefile
 create mode 100644 arch/mips/boot/dts/mobileye/eyeq5-epm5.dts
arch/mips/boot/dts/mobileye/Makefile new file +4 -0
new file mode 100644
index 0000000000000..01c01c3aad81d
@@ -0,0 +1,4 @@
+# SPDX-License-Identifier: GPL-2.0-only
+# Copyright 2023 Mobileye Vision Technologies Ltd.
+
+dtb-$(CONFIG_MACH_EYEQ5)		+= eyeq5-epm5.dtb
arch/mips/boot/dts/mobileye/eyeq5-epm5.dts new file +5 -0
new file mode 100644
index 0000000000000..ff16c3c760a19
@@ -0,0 +1,24 @@
+// SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+/*
+ * Copyright 2023 Mobileye Vision Technologies Ltd.
+ */
+

arch/mips/boot/dts/mobileye/eyeq5-epm5.dts line 15

Quoted 10 lines
arch/mips/boot/dts/mobileye/eyeq5-epm5.dts new file +10 -0
+/dts-v1/;
+
+#include "eyeq5.dtsi"
+
+/ {
+	compatible = "mobileye,eyeq5-epm5", "mobileye,eyeq5";
+	model = "Mobile EyeQ5 MP5 Evaluation board";
+
+	chosen {
+		bootargs = "earlycon";

Still not suitable for mainline. Drop.

Best regards,
Krzysztof