about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorMartin Sundhaug <martinsundhaug@gmail.com>2023-12-14 21:34:20 +0100
committerGitHub <noreply@github.com>2023-12-14 21:34:20 +0100
commit9b7b91651de28bb5b95cef6e07e4e4f3f333c30c (patch)
treef7eaaffda6e7f2bd81a861020e58e99bff10f8a0
parent6ecfe5e1415acefc26c4f6af1ee91e7cd83854a1 (diff)
downloadbox64-9b7b91651de28bb5b95cef6e07e4e4f3f333c30c.tar.gz
box64-9b7b91651de28bb5b95cef6e07e4e4f3f333c30c.zip
Raspberry Pi 5 support (#1138)
* Basic RPi5 support

* Split RPi5 in 16k page-size variant and not

* Update COMPILE.md

Add documentation about 16K page support
-rw-r--r--.github/workflows/manual.yml1
-rw-r--r--.github/workflows/release.yml2
-rw-r--r--CMakeLists.txt16
-rw-r--r--docs/COMPILE.md6
4 files changed, 21 insertions, 4 deletions
diff --git a/.github/workflows/manual.yml b/.github/workflows/manual.yml
index 00f9cef3..c300b17b 100644
--- a/.github/workflows/manual.yml
+++ b/.github/workflows/manual.yml
@@ -17,6 +17,7 @@ on:
         - RK3399
         - RK3588
         - RPI4ARM64
+        - RPI5ARM64
         - SD845
         - SD888
         - ADLINK
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index a5d82aeb..4c72d736 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -27,7 +27,7 @@ jobs:
     strategy:
       fail-fast: false
       matrix:
-        platform: [X64, OTHER_ARM, RISCV, RPI4ARM64, RK3326, RK3399, RK3588, PHYTIUM, SD845, SD888, ADLINK, ARM64, ANDROID]
+        platform: [X64, OTHER_ARM, RISCV, RPI4ARM64, RPI5ARM64, RK3326, RK3399, RK3588, PHYTIUM, SD845, SD888, ADLINK, ARM64, ANDROID]
         type: [Release, Trace]
         os: [ubuntu-latest]
         include:
diff --git a/CMakeLists.txt b/CMakeLists.txt
index bbad8677..a01daa8f 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -7,6 +7,8 @@ SET(CMAKE_CXX_FLAGS_DEBUG  "-O0 -g")
 
 option(RPI3ARM64 "Set to ON if targeting an RaspberryPI3 device with multiarch arm64 and armhf" ${RPI3ARM64})
 option(RPI4ARM64 "Set to ON if targeting an RaspberryPI4 device with multiarch arm64 and armhf" ${RPI4ARM64})
+option(RPI5ARM64 "Set to ON if targeting an RaspberryPi5 device with multiarch arm64 and armhf" ${RPI5ARM64})
+option(RPI5ARM64 "Set to ON if targeting an RaspberryPi5 device with multiarch arm64, armhf, and 16k pages" ${RPI5ARM64PS16K})
 option(RK3326 "Set to ON if targeting an Rockchip RK3326 based device" ${RK3326})
 option(RK3399 "Set to ON if targeting an Rockchip RK3399 based device" ${RK3399})
 option(RK3588 "Set to ON if targeting an Rockchip RK3588(S) based device" ${RK3588})
@@ -59,7 +61,10 @@ if(PPC64LE)
     set(RV64_DYNAREC OFF CACHE BOOL "")
     set(PAGE16K OFF CACHE BOOL "")
 endif()
-if(RK3399 OR RK3588 OR ODROIDN2 OR RPI3ARM64 OR RPI4ARM64 OR RK3326 OR TEGRAX1 OR PHYTIUM OR SD845 OR SD888 OR SD8G2 OR LX2160A OR M1 OR ARM64 OR ADLINK)
+if(RPI5ARM64PS16K)
+    set(RPI5ARM64 ON CACHE BOOL "")
+endif()
+if(RK3399 OR RK3588 OR ODROIDN2 OR RPI3ARM64 OR RPI4ARM64 OR RPI5ARM64 OR RK3326 OR TEGRAX1 OR PHYTIUM OR SD845 OR SD888 OR SD8G2 OR LX2160A OR M1 OR ARM64 OR ADLINK)
     set(LD80BITS OFF CACHE BOOL "")
     set(NOALIGN OFF CACHE BOOL "")
     set(ARM_DYNAREC ON CACHE BOOL "")
@@ -68,13 +73,13 @@ endif()
 if(RK3399 OR RK3588 OR ODROIDN2 OR RPI3ARM64 OR RPI4ARM64 OR RK3326 OR TEGRAX1 OR PHYTIUM OR SD845 OR SD888 OR SD8G2 OR LX2160A OR ADLINK)
     set(PAGE16K OFF CACHE BOOL "")
 endif()
-if(RK3399 OR ODROIDN2 OR RPI3ARM64 OR RPI4ARM64)
+if(RK3399 OR ODROIDN2 OR RPI3ARM64 OR RPI4ARM64 OR RPI5ARM64)
     set(SAVE_MEM ON CACHE BOOL "")
 endif()
 if(RK3588)
     set(BAD_SIGNAL ON CACHE BOOL "")
 endif()
-if(M1 OR LARCH64)
+if(M1 OR LARCH64 OR RPI5ARM64PS16K)
     set(PAGE16K ON CACHE BOOL "")
 endif()
 if(SW64)
@@ -135,6 +140,11 @@ elseif(RPI4ARM64)
     add_definitions(-DRPI4ARM64)
     add_definitions(-pipe -march=armv8-a+crc -mtune=cortex-a72)
     set(CMAKE_ASM_FLAGS  "-pipe -march=armv8-a+crc -mtune=cortex-a72")
+elseif(RPI5ARM64)
+    add_definitions(-DRPI)
+    add_definitions(-DRPI5ARM64)
+    add_definitions(-pipe -march=armv8.2-a+crc+crypto+fp16+rcpc+dotprod -mtune=cortex-a76)
+    set(CMAKE_ASM_FLAGS  "-pipe -march=armv8.2-a+crc+crypto+fp16+rcpc+dotprod -mtune=cortex-a76")
 elseif(RK3326)
     add_definitions(-DRK3326)
     add_definitions(-pipe -march=armv8-a+crc+simd+crypto -mcpu=cortex-a35+crypto)
diff --git a/docs/COMPILE.md b/docs/COMPILE.md
index 11073348..b36cf475 100644
--- a/docs/COMPILE.md
+++ b/docs/COMPILE.md
@@ -78,6 +78,12 @@ Warning, you need a 64bit OS:
 -D RPI4ARM64=1 -D CMAKE_BUILD_TYPE=RelWithDebInfo

 ```

 

+#### for Raspberry Pi 5

+

+```

+-D RPI5ARM64=1 -D CMAKE_BUILD_TYPE=RelWithDebInfo #RPI5ARM64PS16K for operating-systems like Raspberry Pi OS that use 16K pages

+```

+

 #### for TEGRA X1

 

 Using a 64bit OS: