Skip to content

Commit

Permalink
Add linux.aarch64 target. (#413)
Browse files Browse the repository at this point in the history
Add 64-bit ARM Linux as a OpenMRN target.   Initially supporting my Banana Pi M64 (Allwinner A64 SBC with a Raspberry Pi B+ form factor, including the Raspberry Pi 40-pin GPIO header.  I'm guessing this will also support a 'Pi 4 or really any 64-bit ARM Linux SBC running a 64-bit (aarch64) Linux O/S.

This is *lightly* tested -- I built and tested the hub application.  Not sure how to run more detailed tests.

Authored-by: Robert Heller <[email protected]>
  • Loading branch information
RobertPHeller authored Aug 7, 2020
1 parent a2dee1e commit 57f2812
Show file tree
Hide file tree
Showing 13 changed files with 73 additions and 0 deletions.
3 changes: 3 additions & 0 deletions applications/hub/targets/linux.aarch64/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
-include ../../config.mk
include $(OPENMRNPATH)/etc/prog.mk

45 changes: 45 additions & 0 deletions etc/linux.aarch64.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Get the toolchain paths for openmrn
include $(OPENMRNPATH)/etc/path.mk


ifndef TOOLPATH
#TOOLPATHCOMMAND := $(shell \
#sh -c "which aarch64-linux-gnu-gcc" \
#)
TOOLPATH := $(AARCH64LINUXGCCPATH)
endif

$(info armv7alinux toolpath '$(TOOLPATH)')

# Get the $(CFLAGSENV), $(CXXFLAGSENV), $(LDFLAGSENV)
include $(OPENMRNPATH)/etc/env.mk

CC = $(TOOLPATH)/aarch64-linux-gnu-gcc
CXX = $(TOOLPATH)/aarch64-linux-gnu-g++
AR = $(TOOLPATH)/aarch64-linux-gnu-ar
LD = $(TOOLPATH)/aarch64-linux-gnu-g++
OBJDUMP = $(TOOLPATH)/aarch64-linux-gnu-objdump

AROPTS=D

HOST_TARGET := 1

STARTGROUP := -Wl,--start-group
ENDGROUP := -Wl,--end-group

ARCHOPTIMIZATION = -g3 -O0 -march=armv8-a

CSHAREDFLAGS = -c $(ARCHOPTIMIZATION) -Wall -Werror -Wno-unknown-pragmas \
-MD -MP -fno-stack-protector -D_GNU_SOURCE

CFLAGS = $(CSHAREDFLAGS) -std=gnu99

CXXFLAGS = $(CSHAREDFLAGS) -std=c++0x -D__STDC_FORMAT_MACROS \
-D__STDC_LIMIT_MACROS -D__USE_LIBSTDCPP__

LDFLAGS = $(ARCHOPTIMIZATION) -Wl,-Map="$(@:%=%.map)"
SYSLIB_SUBDIRS +=
SYSLIBRARIES = -lrt -lpthread

EXTENTION =

11 changes: 11 additions & 0 deletions etc/path.mk
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,17 @@ ARMLINUXGCCPATH:=$(TRYPATH)
endif
endif #ARMLINUXGCCPATH

################### AARCH64-LINUX GCC PATH #####################
ifndef AARCH64LINUXGCCPATH
SEARCHPATH := \
/usr/bin \

TRYPATH:=$(call findfirst,aarch64-linux-gnu-gcc,$(SEARCHPATH))
ifneq ($(TRYPATH),)
AARCH64LINUXGCCPATH:=$(TRYPATH)
endif
endif #AARCH64LINUXGCCPATH

################### TI-CC3200-SDK #####################
ifndef TICC3200SDKPATH
SEARCHPATH := \
Expand Down
1 change: 1 addition & 0 deletions targets/linux.aarch64/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
include $(OPENMRNPATH)/etc/core_target.mk
3 changes: 3 additions & 0 deletions targets/linux.aarch64/console/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
OPENMRNPATH ?= $(realpath ../../..)
include $(OPENMRNPATH)/etc/lib.mk

1 change: 1 addition & 0 deletions targets/linux.aarch64/cue/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
include $(OPENMRNPATH)/etc/lib.mk
1 change: 1 addition & 0 deletions targets/linux.aarch64/dcc/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
include $(OPENMRNPATH)/etc/lib.mk
1 change: 1 addition & 0 deletions targets/linux.aarch64/executor/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
include $(OPENMRNPATH)/etc/lib.mk
1 change: 1 addition & 0 deletions targets/linux.aarch64/lib/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
include $(OPENMRNPATH)/etc/target_lib.mk
1 change: 1 addition & 0 deletions targets/linux.aarch64/openlcb/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
include $(OPENMRNPATH)/etc/lib.mk
3 changes: 3 additions & 0 deletions targets/linux.aarch64/os/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
OPENMRNPATH ?= $(realpath ../../..)
include $(OPENMRNPATH)/etc/lib.mk

1 change: 1 addition & 0 deletions targets/linux.aarch64/utils/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
include $(OPENMRNPATH)/etc/lib.mk
1 change: 1 addition & 0 deletions targets/linux.aarch64/withrottle/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
include $(OPENMRNPATH)/etc/lib.mk

0 comments on commit 57f2812

Please sign in to comment.