Travis Geiselbrecht | 1d0df69 | 2008-09-01 02:26:09 -0700 | [diff] [blame] | 1 | # |
| 2 | # The TARGET is expected to indicate which *specific* AT91SAM7 chip |
| 3 | # is being used, since features and memory vary from chip to chip |
| 4 | # |
| 5 | # chip ram rom EMAC CAN |
| 6 | # AT91CHIP := sam7s64 16k 64k N N |
| 7 | # AT91CHIP := sam7s256 64k 256k N N |
| 8 | # AT91CHIP := sam7x256 64k 256k Y Y |
| 9 | # |
| 10 | |
| 11 | # ROMBASE, MEMBASE, and MEMSIZE are required for the linker script |
| 12 | ROMBASE := 0x0 |
| 13 | MEMBASE := 0x200000 |
| 14 | |
| 15 | TMP_CFG := bad |
| 16 | ifeq ($(AT91CHIP), sam7x256) |
| 17 | DEFINES += AT91_SAM7X=1 |
| 18 | DEFINES += AT91_RAMSIZE=65536 |
| 19 | DEFINES += AT91_ROMSIZE=262144 |
| 20 | MEMSIZE := 65536 |
| 21 | TMP_CFG := ok |
| 22 | endif |
| 23 | ifeq ($(AT91CHIP), sam7s256) |
| 24 | DEFINES += AT91_SAM7S=1 |
| 25 | DEFINES += AT91_RAMSIZE=65536 |
| 26 | DEFINES += AT91_ROMSIZE=262144 |
| 27 | MEMSIZE := 65536 |
| 28 | TMP_CFG := ok |
| 29 | endif |
| 30 | ifeq ($(AT91CHIP), sam7s64) |
| 31 | DEFINES += AT91_SAM7S=1 |
| 32 | DEFINES += AT91_RAMSIZE=16384 |
| 33 | DEFINES += AT91_ROMSIZE=65536 |
| 34 | MEMSIZE := 16384 |
| 35 | TMP_CFG := ok |
| 36 | endif |
| 37 | |
| 38 | ifeq ($(TMP_CFG), bad) |
| 39 | $(error The AT91SAM7 platform requires AT91CHIP be set by the target) |
| 40 | endif |
| 41 | |
| 42 | LOCAL_DIR := $(GET_LOCAL_DIR) |
| 43 | |
| 44 | ARCH := arm |
| 45 | ARM_CPU := arm7tdmi |
| 46 | |
| 47 | DEFINES += AT91_MCK_MHZ=48000000 |
| 48 | |
| 49 | INCLUDES += \ |
| 50 | -I$(LOCAL_DIR)/include |
| 51 | |
| 52 | OBJS += \ |
| 53 | $(LOCAL_DIR)/debug.o \ |
| 54 | $(LOCAL_DIR)/interrupts.o \ |
| 55 | $(LOCAL_DIR)/platform_early.o \ |
| 56 | $(LOCAL_DIR)/platform.o \ |
| 57 | $(LOCAL_DIR)/timer.o \ |
| 58 | $(LOCAL_DIR)/init_clock.o \ |
| 59 | $(LOCAL_DIR)/init_clock_48mhz.o \ |
| 60 | $(LOCAL_DIR)/mux.o \ |
| 61 | $(LOCAL_DIR)/emac_dev.o |
| 62 | |
| 63 | # use a two segment memory layout, where all of the read-only sections |
| 64 | # of the binary reside in rom, and the read/write are in memory. The |
| 65 | # ROMBASE, MEMBASE, and MEMSIZE make variables are required to be set |
| 66 | # for the linker script to be generated properly. |
| 67 | # |
| 68 | LINKER_SCRIPT += \ |
| 69 | $(BUILDDIR)/system-twosegment.ld |
| 70 | |