CPU Bi-Endian support of RK3399
#1
Hello!

According to ARM the Endian support of the ARMv8 CPUs may vary depending on architecture/model/manufacturer. Therefore I would like to learn whether the RK3399 does support big-endian mode of operation before I decide to order that board. I have written a small test code (32bit ARM!):

Code:
#include <stdio.h>

int main(int argc, char**argv)
{
   (void)argc; (void)argv;

   int tmp = 0;

   printf("Trying to switch endianess\n");

   asm volatile("setend be; str %0, %1; setend le"::"r"(0xdeadbeef),"m"(tmp));

   printf("Value in tmp is %08x, written was %08x\n", tmp, 0xdeadbeef);

   return 0;
}

The code does nothing extraordinary, it just switches the CPU mode to BE, stores variable in memory and switches back to LE, which is most likely the default mode on RK3399. I would like someone to compile this code in 32bit mode and test. There, three things can happen:
1. The "setend" instruction is obsolete and CPU is told to throw an exception on that instruction. In that case sigsegv is thrown and program ends without any output on the console.
2. The "setend" instruction is executed but the CPU does not support BE mode. In that case "Value in tmp is deadbeef, written was deadbeef" will show on the console
3. The "setend" instruction is executed and the CPU supports BE mode. In that case "Value in tmp is efbeadde, written was deadbeef" will show on the console.

Thanks for the help.


Messages In This Thread
CPU Bi-Endian support of RK3399 - by mschulz - 02-15-2019, 07:12 AM
RE: CPU Bi-Endian support of RK3399 - by tuxd3v - 02-15-2019, 01:03 PM
RE: CPU Bi-Endian support of RK3399 - by mknawabi - 02-15-2019, 02:50 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  RK3399 PCIe enumeration jhadd 0 3,107 01-31-2024, 08:56 AM
Last Post: jhadd
  slarm64 (unofficial slackware) ROCKPro64 RK3399 (aarch64) mara 54 125,346 08-11-2023, 11:13 AM
Last Post: mara
  rk3399 and Visual Output Processor 2 (VOP2) swan 3 6,907 05-13-2023, 12:01 AM
Last Post: swan
  Can RockPRO64 support PCIe Endpoint? andrewg132 3 6,761 10-14-2022, 06:24 AM
Last Post: rwk-
Big Grin RETRO GAMING: UPDATED RECALBOX FOR THE RK3399 ROCKPRO64 Mrfixit2001 38 89,883 03-29-2020, 05:37 AM
Last Post: Crnppscls
  RockPro64 Official Kernel Support ASIC 23 46,114 08-29-2019, 05:39 PM
Last Post: tuxd3v
  RockPro64 alpha software support bavay 6 12,029 06-13-2019, 09:24 AM
Last Post: bavay
  Looking for support ghiromax 0 2,594 02-11-2019, 06:43 AM
Last Post: ghiromax
  WiFi support on RockPro64 tagyro 4 9,214 12-11-2018, 02:43 PM
Last Post: fosf0r
  RockPro64 and 802.1q support [Solved] divek 2 5,223 11-04-2018, 11:15 AM
Last Post: divek

Forum Jump:


Users browsing this thread: 1 Guest(s)