Re: Re: DSP support

From: Mori Hiroki <yamori813_at_yahoo.co.jp>
Date: Mon, 01 Aug 2022 06:07:15 UTC
Hi

Thanks for your reply.

First I do fixed crash bug by DSP instraction on 74K.

diff --git a/sys/mips/include/trap.h b/sys/mips/include/trap.h
index a88784f869c5..613df63c47e0 100644
--- a/sys/mips/include/trap.h
+++ b/sys/mips/include/trap.h
@@ -69,6 +69,7 @@
 #define T_C2E                   18      /* Exception from coprocessor 2 */
 #define        T_DWATCH                23      /* Data Watch address reference */
 #define T_MCHECK                24      /* Received an MCHECK */
+#define T_DSP                   26      /* Not enable DSP ASE */
 #define        T_VCED                  31      /* Virtual coherency data */
 
 #define        T_USER                  0x20    /* user-mode flag or'ed with type */
diff --git a/sys/mips/mips/trap.c b/sys/mips/mips/trap.c
index 50747ff85dd2..fb92c8dd0f24 100644
--- a/sys/mips/mips/trap.c
+++ b/sys/mips/mips/trap.c
@@ -894,6 +894,7 @@ trap(struct trapframe *trapframe)
                }
 
        case T_RES_INST + T_USER:
+       case T_DSP + T_USER:
                {
                        InstFmt inst;
                        inst = *(InstFmt *)(intptr_t)trapframe->pc;


----- Original Message -----

From: "Warner Losh" <imp@bsdimp.com>
To: "や もり" <yamori813@yahoo.co.jp>
Cc: "freebsd-mips@freebsd.org" <freebsd-mips@freebsd.org>
Date: 2022/05/13 金 03:56
Subject: Re: DSP support




On Thu, May 12, 2022 at 7:32 AM Mori Hiroki <yamori813@yahoo.co.jp> wrote:
Hi
 
 I want DSP support to FreeBSD 12.
 
 Ralink 24K have DPS v1.
 
 Ralink and Atheros 74k have DSP v1 and v2.
 
 I seem NetBSD support DPS on userland.
 
 Do you have advice something, please let me know.

At the highest level, if you want to use the DSP, you need to save and restore
its state when it's being used. NetBSD should have some code to snag for that.
I'm not familiar enough with toolchains to know the extent to which you'd need
userland changes. But you can likely snag those from NetBSD as well, though
you may need to use an external toolchain to get support for DSP, since it's
a bit of a niche part of the architecture.

Warner 

I seem gcc 4.2.1 support mdsp option but not support mdspr2 option.

binutil 2.17.50 support dsp and dspr2 instruction.

I think not need external toolchain if we use only as by dsp and dpsr2.

Thanks

Hiroki Mori