From 21eab7d106315e8612fa19f12d825bb5723a05e9 Mon Sep 17 00:00:00 2001 From: mahi Date: Mon, 3 Sep 2012 23:24:01 +0200 Subject: [PATCH] PPC:SRAM size cleanup. Close #974 --- arch/ppc/crt0.sx | 10 ++++------ boards/mpc5516it/build_config.mk | 2 ++ boards/mpc5516it/memory.ldf | 2 +- boards/mpc551xsim/build_config.mk | 3 +++ boards/mpc551xsim/memory.ldf | 2 +- boards/mpc5554sim/build_config.mk | 2 ++ boards/mpc5554sim/memory.ldf | 2 +- boards/mpc5567qrtech/build_config.mk | 3 +++ boards/mpc5604b_trk/build_config.mk | 5 +++++ boards/mpc5606s_xpc560s/build_config.mk | 3 +++ boards/mpc5668_gkit/build_config.mk | 2 ++ 11 files changed, 27 insertions(+), 9 deletions(-) diff --git a/arch/ppc/crt0.sx b/arch/ppc/crt0.sx index b1a01732..484fed07 100644 --- a/arch/ppc/crt0.sx +++ b/arch/ppc/crt0.sx @@ -95,13 +95,11 @@ _start: /* Clear all SRAM */ init_RAM: LOAD_ADDR_32(11,0x40000000) -#if (CFG_MPC560X) - li r12,384 # loop counter to get all of SRAM; - /* 48k/4 bytes/32 GPRs = 384, only 48k ram for MPC5606s */ -#else - li r12,640 # loop counter to get all of SRAM; - /* 80k/4 bytes/32 GPRs = 640 */ +#if !defined(SRAM_SIZE) +#error SRAM_SIZE not defined. Add it to board//build_config.mk #endif + + LOAD_ADDR_32(r4,SRAM_SIZE/(32*4)) mtctr r12 init_ram_loop: diff --git a/boards/mpc5516it/build_config.mk b/boards/mpc5516it/build_config.mk index fdde1b88..880b8279 100644 --- a/boards/mpc5516it/build_config.mk +++ b/boards/mpc5516it/build_config.mk @@ -26,3 +26,5 @@ MOD_USE += MCU KERNEL ECUM DET # Default cross compiler DEFAULT_CROSS_COMPILE = /opt/powerpc-eabispe/bin/powerpc-eabispe- +# Defines +def-y += SRAM_SIZE=0x14000 diff --git a/boards/mpc5516it/memory.ldf b/boards/mpc5516it/memory.ldf index 99c95163..054172f4 100644 --- a/boards/mpc5516it/memory.ldf +++ b/boards/mpc5516it/memory.ldf @@ -8,4 +8,4 @@ flash(R) : ORIGIN = 0x00000000, LENGTH = 0x100000 * 5517S,5516G,5516E, 64K RAM * 5517G,E , 80K RAM */ -ram(RW) : ORIGIN = 0x40000000, LENGTH = 0x00c000 +ram(RW) : ORIGIN = 0x40000000, LENGTH = SRAM_SIZE diff --git a/boards/mpc551xsim/build_config.mk b/boards/mpc551xsim/build_config.mk index dcc942c0..4f622079 100644 --- a/boards/mpc551xsim/build_config.mk +++ b/boards/mpc551xsim/build_config.mk @@ -24,3 +24,6 @@ MOD_USE += MCU KERNEL ECUM DET # Default cross compiler DEFAULT_CROSS_COMPILE = /opt/powerpc-eabispe/bin/powerpc-eabispe- + +# Defines +def-y += SRAM_SIZE=0x14000 diff --git a/boards/mpc551xsim/memory.ldf b/boards/mpc551xsim/memory.ldf index f05baae5..f813887c 100644 --- a/boards/mpc551xsim/memory.ldf +++ b/boards/mpc551xsim/memory.ldf @@ -3,4 +3,4 @@ flash(R) : ORIGIN = 0x00000000, LENGTH = 1M * 5517S,5516G,5516E, 64K RAM * 5517G,E , 80K RAM */ -ram(RW) : ORIGIN = 0x40000000, LENGTH = 0x100000 +ram(RW) : ORIGIN = 0x40000000, LENGTH = SRAM_SIZE diff --git a/boards/mpc5554sim/build_config.mk b/boards/mpc5554sim/build_config.mk index 25de833b..1cea54c9 100644 --- a/boards/mpc5554sim/build_config.mk +++ b/boards/mpc5554sim/build_config.mk @@ -26,3 +26,5 @@ MOD_USE += MCU KERNEL ECUM DET # Default cross compiler DEFAULT_CROSS_COMPILE = /opt/powerpc-eabispe/bin/powerpc-eabispe- +# Defines +def-y += SRAM_SIZE=0x14000 diff --git a/boards/mpc5554sim/memory.ldf b/boards/mpc5554sim/memory.ldf index 8a447b38..06401c89 100644 --- a/boards/mpc5554sim/memory.ldf +++ b/boards/mpc5554sim/memory.ldf @@ -7,4 +7,4 @@ flash(R) : ORIGIN = 0x00000008, LENGTH = 2M * 5517S,5516G,5516E, 64K RAM * 5517G,E , 80K RAM */ -ram(RW) : ORIGIN = 0x40000000, LENGTH = 0x100000 +ram(RW) : ORIGIN = 0x40000000, LENGTH = SRAM_SIZE diff --git a/boards/mpc5567qrtech/build_config.mk b/boards/mpc5567qrtech/build_config.mk index 03448362..5fea51eb 100644 --- a/boards/mpc5567qrtech/build_config.mk +++ b/boards/mpc5567qrtech/build_config.mk @@ -29,3 +29,6 @@ MOD_USE += MCU KERNEL ECUM DET # Default cross compiler DEFAULT_CROSS_COMPILE = /opt/powerpc-eabispe/bin/powerpc-eabispe- +# Defines +def-y += SRAM_SIZE=0x14000 + diff --git a/boards/mpc5604b_trk/build_config.mk b/boards/mpc5604b_trk/build_config.mk index dcde8fe7..a63dbb7a 100644 --- a/boards/mpc5604b_trk/build_config.mk +++ b/boards/mpc5604b_trk/build_config.mk @@ -27,3 +27,8 @@ MOD_USE += MCU KERNEL ECUM DET COMPILER?=cw DEFAULT_CROSS_COMPILE = /opt/powerpc-eabispe/bin/powerpc-eabispe- DEFAULT_CW_COMPILE= /opt/cw + +# Defines +def-y += SRAM_SIZE=0xc000 + + diff --git a/boards/mpc5606s_xpc560s/build_config.mk b/boards/mpc5606s_xpc560s/build_config.mk index fe5f666a..6ff58e0a 100644 --- a/boards/mpc5606s_xpc560s/build_config.mk +++ b/boards/mpc5606s_xpc560s/build_config.mk @@ -27,3 +27,6 @@ MOD_USE += MCU KERNEL ECUM DET COMPILER?=cw DEFAULT_CROSS_COMPILE = /opt/powerpc-eabispe/bin/powerpc-eabispe- DEFAULT_CW_COMPILE= /opt/cw + +# Defines +def-y += SRAM_SIZE=0xc000 diff --git a/boards/mpc5668_gkit/build_config.mk b/boards/mpc5668_gkit/build_config.mk index fb8c54da..3f896e29 100644 --- a/boards/mpc5668_gkit/build_config.mk +++ b/boards/mpc5668_gkit/build_config.mk @@ -28,3 +28,5 @@ MOD_USE += MCU KERNEL ECUM DET # Default cross compiler DEFAULT_CROSS_COMPILE = /opt/powerpc-eabispe/bin/powerpc-eabispe- +# Defines +def-y += SRAM_SIZE=0x94000 -- 2.39.2