blob: 47b527b0746460ec3642f6d43671a57d2155adf8 [file] [log] [blame]
rjw1f884582022-01-06 17:20:42 +08001LOCAL_DIR := $(GET_LOCAL_DIR)
2
3MODULE := $(LOCAL_DIR)
4
5# ROMBASE, MEMBASE, and MEMSIZE are required for the linker script
6ROMBASE := 0x80000
7MEMBASE := 0x20000000
8
9ARCH := arm
10ARM_CPU := cortex-m3
11
12ifeq ($(SAM_CHIP),sam3x8h)
13GLOBAL_DEFINES += \
14 __SAM3X8H__=1 \
15 SAM3XA=1
16MEMSIZE ?= 98304
17MEMBASE := 0x20070000
18endif
19
20ifeq ($(MEMSIZE),)
21$(error need to define MEMSIZE)
22endif
23
24MODULE_SRCS += \
25 $(LOCAL_DIR)/init.c \
26 $(LOCAL_DIR)/debug.c \
27 $(LOCAL_DIR)/vectab.c \
28 $(LOCAL_DIR)/timer.c \
29
30# $(LOCAL_DIR)/debug.c \
31 $(LOCAL_DIR)/interrupts.c \
32 $(LOCAL_DIR)/platform_early.c \
33 $(LOCAL_DIR)/platform.c \
34 $(LOCAL_DIR)/timer.c \
35 $(LOCAL_DIR)/init_clock.c \
36 $(LOCAL_DIR)/init_clock_48mhz.c \
37 $(LOCAL_DIR)/mux.c \
38 $(LOCAL_DIR)/emac_dev.c
39
40# use a two segment memory layout, where all of the read-only sections
41# of the binary reside in rom, and the read/write are in memory. The
42# ROMBASE, MEMBASE, and MEMSIZE make variables are required to be set
43# for the linker script to be generated properly.
44#
45LINKER_SCRIPT += \
46 $(BUILDDIR)/system-twosegment.ld
47
48MODULE_DEPS += \
49 arch/arm/arm-m/systick \
50 lib/cbuf
51
52include $(LOCAL_DIR)/cmsis/sam3x/rules.mk $(LOCAL_DIR)/drivers/rules.mk
53
54include make/module.mk