I don't think the processer is from there actually...
I guess you just need the broadcom SDK, dunno what you exactly want to do
I try to test the DSP Application Specific Extension (MIPS DSP ASE), which should be included in the BCM4704 chip based on MIPS architecture. This chip is the core of the router WL-500gP.
I compile my test function with MIPS DSP Built-in Functions by a cross-compiler on my PC with parameters for WL-500gP:
The compilation is OK. Then I try to run the compiled program on WL-500g Premium. It starts to run, but when the program comes to the DSP instruction, it stops with this message:Code:-march="mips32r2" -mtune="mips32r2" -mdsp ...
Does anybody know what to do? Shoud I first allow the DSP ASE, e.g. by configuring some register? Or does it mean that the DSP ASE, which is promised by Broadcom to be present, insn't available?Code:Illegal instruction
Last edited by electro.rob; 01-12-2008 at 20:30.
I don't think the processer is from there actually...
I guess you just need the broadcom SDK, dunno what you exactly want to do
electro.rob
Can you attach a small sample source?
Which toolchain you use?
I found the answer in the official MIPS documentation:
7.3 Software detection of the DSP ASE
You can find out if your core supports the DSP ASE by testing the Config3[DDSP] bit (see notes to Figure 2.4).
Then you need to enable use of instructions from the MIPS DSP ASE by setting Status[MX] to 1.
Programming the MIPS32® 24KE™ Core Family, p. 73
So I wanted to make detection, whether the DSP ASE is present on the chip, by reading the Config3 register:
dsp.c:
Makefile:Code:/* MIPS DSP ASE test */ #include <stdio.h> #include <stdlib.h> int main(int argc, char *argv[]){ unsigned int k; printf("\n\nDSP instructions test\n\n"); /* Get the contents of Config3 register (CP0[16,3]) */ printf("Trying to read Config3 register ...\n"); k=({ int __res; \ __asm__ __volatile__( \ "mfc0\t%0,$16,3\n\t" \ : "=r" (__res)); \ __res;}); printf("Config3 register: %x",k); exit(0); }
Compilation is OK, but when I try to run the program on my router, the message is still same:Code:TARGET = dsp SHELL = /bin/sh CCDIR = /opt/slug/optware/toolchain/mipsel-linux-uclibc/gcc-4.1.1-uclibc-0.9.28 MIPSCC = $(CCDIR)/bin/mipsel-linux-uclibc-gcc SOURCE = $(TARGET).c PARAMS = -march="mips32r2" -mtune="mips32r2" -mdsp -static $(TARGET) : $(SOURCE) $(MIPSCC) $(SOURCE) -o $(TARGET) $(PARAMS) @echo "OK." asm : $(SOURCE) $(MIPSCC) $(SOURCE) -o $(TARGET).asm $(PARAMS) -S @echo "ASM OK."
Illegal instruction
It is maybe more global problem. Should I have some special permission of the operating system?
I use Optware compiler (uClibc). I got it from nslu2-linux.org. Instalation instructions are in the middle of the page under heading And what if the program I need is not available in the existing packages?
My router runs on Oleg firmware.
Last edited by electro.rob; 10-12-2008 at 20:48.
I got same result - "Illegal instruction (core dumped)"
Result of preliminary analysis:
- Our CPU is 4KE, not 24KE
- read/write Config3 register isn't possible from user space (from kernel space on my Wl500gp V1 Config3=0x3ed96c82)
- Kernel 2.4 (ASUS & Oleg firmwares) can't init DSP, can't handle DSP registers on context switching, so you have to try 2.6 branch (DD-WRT, OpenWRT firmwares).
Last edited by lly; 13-12-2008 at 23:49.
Illy:
I think it must be 24KE, see: www.broadcom.com/products/Wireless-LAN/802.11-Wireless-LAN-Solutions/BCM47041. Our CPU is 4KE, not 24KE
I installed OpenWRT, but the result is still the same: Illegal instruction3. Kernel 2.4 (ASUS & Oleg firmwares) can't init DSP, can't handle DSP registers on context switching, so you have to try 2.6 branch (DD-WRT, OpenWRT firmwares).
The operating system doesn't know that it has DSP ASE. Never mind, but I cannot use any assembler instruction.
Unfortunately, you may be right. Do you know, how can I switch to kernel in my C program?2. read/write Config3 register isn't possible from user space (from kernel space on my Wl500gp V1 Config3=0x3ed96c82)
Too bad, I hope, it recognizes ASE
I don't know Linux kernel well yet. I simply patch arch/mips/kernel/cpu-probe.c with my code, prints out results with printk() and look at syslog (or system console if kernel crashes).Unfortunately, you may be right. Do you know, how can I switch to kernel in my C program?
Of course, firmware recompilation is required and, in case of total fail, firmware restoration by TFTP.
I found Czech resource on that reported DSP is present and working, have you contact them ?
http://www.microdesignum.cz/clanky/E...eployment.html
P.S. For others - same topic on OpenWRT forum: http://forum.openwrt.org/viewtopic.php?id=17898