ha7ilm / csdr

A simple DSP library and command-line tool for Software Defined Radio.
523 stars 171 forks source link

Support for AARCH64 (aka 64bit ARM) #43

Open MeFisto94 opened 5 years ago

MeFisto94 commented 5 years ago

I saw that the Makefile already tries to detect running on ARMv6, but not ARMv7/v8 or even AARCH64, so it would be a nice addition to support those.

Since on my device /proc/cpuinfo looks like

processor       : 0
BogoMIPS        : 38.40
Features        : fp asimd evtstrm crc32 cpuid
CPU implementer : 0x41
CPU architecture: 8
CPU variant     : 0x0
CPU part        : 0xd03
CPU revision    : 4

It would be better to change the detection to use uname -m anyway, to at least detect the platform properly.

11 could also apply here though, I'll see how far I get

Edit: According to https://stackoverflow.com/a/29891469 the following PARAMS should be enough for AARCH64 on a Raspberry Pi 3+: PARAMS_RASPI = -mcpu=cortex-a53 -mtune=cortex-a53 -funsafe-math-optimizations -Wformat=0

Edit2:

cat /proc/device-tree/model 
Raspberry Pi 3 Model B Plus Rev 1.3

That's another good detection method, just search for "Raspberry Pi" and then differ by architecture (and maybe also derive the cortex by that information)

MeFisto94 commented 5 years ago

See https://github.com/MeFisto94/csdr/tree/improve_arm_detection for an idea of how such a detection could look like (but it's not tested on all raspberry pis yet, so minor adjustments might have to be made)