From 26498694b94a4a3ac31dac56c7e2e6b6938be70f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20Fr=C3=B6schle?= Date: Tue, 29 Oct 2013 14:43:53 +0000 Subject: [PATCH] first steps to make Makefile machine independent --- BaS_gcc/Makefile | 2 +- BaS_gcc/bas.lk.in | 16 +++++++++++++--- BaS_gcc/include/firebee.h | 29 +++++++++++++++++++++++++++++ BaS_gcc/include/m5484l.h | 5 ++++- 4 files changed, 47 insertions(+), 5 deletions(-) diff --git a/BaS_gcc/Makefile b/BaS_gcc/Makefile index 514f38b..7582da2 100644 --- a/BaS_gcc/Makefile +++ b/BaS_gcc/Makefile @@ -129,7 +129,7 @@ $(BASFLASH_EXEC): MAPFILE=basflash.map # the final link stage (BaS in RAM and BaS in flash) $(FLASH_EXEC) $(RAM_EXEC): $(LIBBAS) $(LDCSRC) - $(CPP) -P -DTARGET_ADDRESS=$(TARGET_ADDRESS) -DFORMAT=$(FORMAT) $(LDCSRC) -o $(LDCFILE) + $(CPP) $(INCLUDE) -P -DTARGET_ADDRESS=$(TARGET_ADDRESS) -DFORMAT=$(FORMAT) -DMACHINE_M5484LITE $(LDCSRC) -o $(LDCFILE) $(LD) --oformat $(FORMAT) -Map $(MAPFILE) --cref -T $(LDCFILE) -o $@ ifeq ($(COMPILE_ELF),Y) $(OBJCOPY) -O srec $@ $@.s19 diff --git a/BaS_gcc/bas.lk.in b/BaS_gcc/bas.lk.in index 5693e76..bd0bb0f 100644 --- a/BaS_gcc/bas.lk.in +++ b/BaS_gcc/bas.lk.in @@ -1,10 +1,19 @@ +#ifdef MACHINE_FIREBEE +#include "firebee.h" +#endif /* MACHINE_FIREBEE */ + +#ifdef MACHINE_M5484LITE +#include "m5484l.h" +#endif /* MACHINE_M5484LITE */ + + MEMORY { bas_rom (RX) : ORIGIN = TARGET_ADDRESS, LENGTH = 0x00100000 /* * target to copy BaS data segment to. 20k should be enough for now */ - bas_ram (WX) : ORIGIN = 0x1FFFC000, LENGTH = 0x005000 + bas_ram (WX) : ORIGIN = 0x1FFFB000, LENGTH = 0x005000 } SECTIONS @@ -13,6 +22,7 @@ SECTIONS .text : { objs/startcf.o(.text) /* this one is the entry point so it must be the first */ + objs/sysinit.o(.text) objs/fault_vectors.o(.text) objs/init_fpga.o(.text) @@ -90,8 +100,8 @@ SECTIONS */ /* SDRAM Initialization @ 0000_0000 - 1FFF_FFFF 512Mbytes */ - ___SDRAM = 0x00000000; - ___SDRAM_SIZE = 0x20000000; + ___SDRAM = SDRAM_START; + ___SDRAM_SIZE = SDRAM_SIZE; _SDRAM_VECTOR_TABLE = ___SDRAM; /* ST-RAM */ diff --git a/BaS_gcc/include/firebee.h b/BaS_gcc/include/firebee.h index db9582b..5ee9196 100644 --- a/BaS_gcc/include/firebee.h +++ b/BaS_gcc/include/firebee.h @@ -1,8 +1,37 @@ #ifndef _FIREBEE_H_ #define _FIREBEE_H_ +/* + * firebee.h + * + * preprocessor definitions for the Firebee machine. This file should contain nothing but preprocessor + * definition that evaluate to numbers. It is intended for use in C sources as well as in linker control + * files, so care must be taken to not break the syntax of either one. + * + * This file is part of BaS_gcc. + * + * BaS_gcc is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * BaS_gcc is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with BaS_gcc. If not, see . + * + * Created on: 26.02.2013 + * Author: Markus Fröschle + */ + #define BOOTFLASH_BASE_ADDRESS 0xE0000000 #define BOOTFLASH_SIZE 0x800000 #define BOOTFLASH_BAM (BOOTFLASH_SIZE - 1) +#define SDRAM_START 0x00000000 /* start at address 0 */ +#define SDRAM_SIZE 0x20000000 /* 512 kb on the Firebee */ + #endif /* _FIREBEE_H_ */ diff --git a/BaS_gcc/include/m5484l.h b/BaS_gcc/include/m5484l.h index 45d460e..a5319eb 100644 --- a/BaS_gcc/include/m5484l.h +++ b/BaS_gcc/include/m5484l.h @@ -2,7 +2,10 @@ #define _M5484L_H_ #define BOOTFLASH_BASE_ADDRESS 0xE0000000 -#define BOOTFLASH_SIZE 0x400000 /* LITEKIT has 4Mb flash */ +#define BOOTFLASH_SIZE 0x400000 /* LITEKIT has 4MB flash */ #define BOOTFLASH_BAM (BOOTFLASH_SIZE - 1) +#define SDRAM_START 0x00000000 /* start at address 0 */ +#define SDRAM_SIZE 0x4000000 /* 64 MB on the LITEKIT */ + #endif /* _M5484L_H_ */