rjw | 1f88458 | 2022-01-06 17:20:42 +0800 | [diff] [blame^] | 1 | LOCAL_DIR := $(GET_LOCAL_DIR) |
| 2 | |
| 3 | MODULE := $(LOCAL_DIR) |
| 4 | |
| 5 | WITH_SMP := 1 |
| 6 | #LK_HEAP_IMPLEMENTATION ?= dlmalloc |
| 7 | |
| 8 | MODULE_DEPS := \ |
| 9 | dev/timer/arm_generic \ |
| 10 | lib/cbuf |
| 11 | |
| 12 | |
| 13 | #lib/bio \ |
| 14 | lib/cbuf \ |
| 15 | lib/minip \ |
| 16 | dev/interrupt/arm_gic \ |
| 17 | dev/timer/arm_cortex_a9 |
| 18 | |
| 19 | MODULE_SRCS += \ |
| 20 | $(LOCAL_DIR)/gpio.c \ |
| 21 | $(LOCAL_DIR)/intc.c \ |
| 22 | $(LOCAL_DIR)/platform.c \ |
| 23 | |
| 24 | MEMBASE := 0x00000000 |
| 25 | |
| 26 | GLOBAL_DEFINES += \ |
| 27 | ARM_ARCH_WAIT_FOR_SECONDARIES=1 |
| 28 | |
| 29 | LINKER_SCRIPT += \ |
| 30 | $(BUILDDIR)/system-onesegment.ld |
| 31 | |
| 32 | ifeq ($(TARGET),rpi2) |
| 33 | ARCH := arm |
| 34 | ARM_CPU := cortex-a7 |
| 35 | # put our kernel at 0x80000000 |
| 36 | KERNEL_BASE = 0x80000000 |
| 37 | KERNEL_LOAD_OFFSET := 0x00008000 |
| 38 | MEMSIZE ?= 0x10000000 # 256MB |
| 39 | SMP_CPU_ID_BITS := 8 |
| 40 | GLOBAL_DEFINES += \ |
| 41 | BCM2836=1 |
| 42 | |
| 43 | MODULE_SRCS += \ |
| 44 | $(LOCAL_DIR)/uart.c |
| 45 | |
| 46 | else ifeq ($(TARGET),rpi3) |
| 47 | ARCH := arm64 |
| 48 | ARM_CPU := cortex-a53 |
| 49 | |
| 50 | KERNEL_LOAD_OFFSET := 0x00080000 |
| 51 | MEMSIZE ?= 0x40000000 # 1GB |
| 52 | |
| 53 | GLOBAL_DEFINES += \ |
| 54 | MEMBASE=$(MEMBASE) \ |
| 55 | MEMSIZE=$(MEMSIZE) \ |
| 56 | MMU_WITH_TRAMPOLINE=1 \ |
| 57 | BCM2837=1 |
| 58 | |
| 59 | MODULE_SRCS += \ |
| 60 | $(LOCAL_DIR)/miniuart.c |
| 61 | |
| 62 | MODULE_DEPS += \ |
| 63 | app/shell \ |
| 64 | app/tests \ |
| 65 | lib/fdt |
| 66 | |
| 67 | WITH_CPP_SUPPORT=true |
| 68 | |
| 69 | endif |
| 70 | |
| 71 | include make/module.mk |