Coder Social home page Coder Social logo

rpi-3-aarch64-demo's Introduction

This repository contains a simple AArch64 test for the Raspberry Pi 3. It relies on the VideoCore firmware providing a suitable 64-bit ARM stub. As of 20160406, the released version doesn't, but a pre-release is available at raspberrypi/firmware#579 (comment).

If you want to experiment with changes to the ARM stub code, find the source at: https://github.com/raspberrypi/tools/tree/master/armstubs. You can copy armstub8.bin to the boot partition on the SD card, and the FW will use that file rather than the built-in version.

Some of the application code is stolen from U-Boot, including some from my recently upstreamed AArch32 port of U-Boot to the Raspberry Pi 3:

  • git://git.denx.de/u-boot.git
  • git://github.com/swarren/u-boot.git

To build, simply run ./build.sh. This was tested on Ubuntu 16.04. You will need an aarch64-linux-gnu-gcc binary (i.e. gcc-aarch64-linux-gnu package) or equivalent.

To make a bootable SD card, start with a recent Raspbian image, update all the firmware files to a version that includes the 64-bit ARM stub, and:

  • Copy config.txt to the boot partition.
  • Delete armstub*.bin from the boot partition.
  • Delete kernel*.img from the boot partition.
  • Copy app.bin to the boot partition as kernel8.img.

You'll need a serial console running at 115200 baud to observe the code running.

If you want to use the PL011 UART instead of the mini UART, you'll need to perform at least the following steps:

  • Modify app.c's UART IO routines.
  • run mkknlimg on app.bin rather than using it raw. This tells the VC FW to process DT overlays, and doing so is required to switch between UARTs.
  • Add "dtoverlay=pi3-miniuart-bt" to config.txt.

rpi-3-aarch64-demo's People

Contributors

swarren avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

rpi-3-aarch64-demo's Issues

Compilation error in main.c

I fixed (sukantoghosh@03d941e) the following compilation error in main.c when compiled with Linaro gcc 4.8.2 ($ aarch64-linux-gnu-gcc --version
aarch64-linux-gnu-gcc (crosstool-NG linaro-1.13.1-4.8-2013.08 - Linaro GCC 2013.08) 4.8.2 20130805 (prerelease))

+ aarch64-linux-gnu-gcc -c -o main.o main.c
main.c: In function ‘dbg_puthex32’:
main.c:77:2: error: ‘for’ loop initial declarations are only allowed in C99 mode
  for (int i = 28; i >= 0; i -= 4)
  ^
main.c:77:2: note: use option -std=c99 or -std=gnu99 to compile your code

test.bin or test to kernel7.img?

Hi, thank you for your work!

The readme says:

Copy test.bin to the boot partition as kernel7.img

Is it really be test.bin, not the file test? Reason: test.bin is not recognized as aarch64, but test is:

sander@haring:~/git/rpi-3-aarch64-demo$ file test
test: ELF 64-bit LSB  executable, ARM aarch64, version 1 (SYSV), statically linked, not stripped

sander@haring:~/git/rpi-3-aarch64-demo$ file test.bin
test.bin: data

I have no Raspi3 at hand to test it, so I'm asking here.

FWIW: build process on my Ubuntu 14.04:


sander@haring:~/git/rpi-3-aarch64-demo$ ./build.sh 
./build.sh: line 7: aarch64-linux-gnu-gcc: command not found

sander@haring:~/git/rpi-3-aarch64-demo$ sudo apt-get install gcc-aarch64-linux-gnu

sander@haring:~/git/rpi-3-aarch64-demo$ ./build.sh 

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.