From 870bf3ee60320b58f8970ffe3ddebda0e8ac62f7 Mon Sep 17 00:00:00 2001 From: Wolfgang Wegner Date: Wed, 9 Dec 2009 17:32:12 -0500 Subject: add include/asm-m68k/unaligned.h lib_generic/zlib.c needs include/asm/unaligned.h since commit cd514aeb996e2f7aefbe1f78481965d9d074aed4, which broke compilation for Coldfire/M68K. This patch adds the missing header for these architectures. Signed-off-by: Wolfgang Wegner --- include/asm-m68k/unaligned.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 include/asm-m68k/unaligned.h diff --git a/include/asm-m68k/unaligned.h b/include/asm-m68k/unaligned.h new file mode 100644 index 0000000000..328aa0c316 --- /dev/null +++ b/include/asm-m68k/unaligned.h @@ -0,0 +1,15 @@ +#ifndef _ASM_M68K_UNALIGNED_H +#define _ASM_M68K_UNALIGNED_H + +#ifdef CONFIG_COLDFIRE +#include +#else +#include +#endif + +#include + +#define get_unaligned __get_unaligned_be +#define put_unaligned __put_unaligned_be + +#endif /* _ASM_M68K_UNALIGNED_H */ -- cgit v1.2.1 From 992d7129500d239d684c15fa2d61e0a8f2e64457 Mon Sep 17 00:00:00 2001 From: Wolfgang Wegner Date: Wed, 28 Oct 2009 15:11:00 -0500 Subject: MCF532x: make icache_enable use CONFIG_SYS_SDRAM_SIZE in cpu/mcf532x/start.S, the function icache_enable enables the cache for a fixed 32MB region starting at the SDRAM start address; this patch changes the function to cover the region defined by CONFIG_SYS_SDRAM_SIZE Signed-off-by: Wolfgang Wegner --- cpu/mcf532x/start.S | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cpu/mcf532x/start.S b/cpu/mcf532x/start.S index a46c47adca..ff13a9f2dd 100644 --- a/cpu/mcf532x/start.S +++ b/cpu/mcf532x/start.S @@ -280,7 +280,7 @@ _int_handler: icache_enable: move.l #0x01000000, %d0 /* Invalidate cache cmd */ movec %d0, %CACR /* Invalidate cache */ - move.l #(CONFIG_SYS_SDRAM_BASE + 0x1c000), %d0 + move.l #(CONFIG_SYS_SDRAM_BASE + 0xc000 + ((CONFIG_SYS_SDRAM_SIZE & 0x1fe0) << 11)), %d0 movec %d0, %ACR0 /* Enable cache */ move.l #0x80000200, %d0 /* Setup cache mask */ -- cgit v1.2.1 From bb907ab51fd04255923b7ecf9dab352078808351 Mon Sep 17 00:00:00 2001 From: Richard Retanubun Date: Mon, 26 Oct 2009 14:19:17 -0400 Subject: MCF5271-only: Added a weak board_reset function to allow custom reset This patch adds a board_reset function to allow boards to specify their own custom reset sequence (e.g. resetting by timing out watchdog). Tested only on MCF5271, can be expanded if needed. Based on Mike Frysinger's suggestion on: http://article.gmane.org/gmane.comp.boot-loaders.u-boot/70304 Signed-off-by: Richard Retanubun --- cpu/mcf52x2/cpu.c | 6 ++++++ cpu/mcf52x2/cpu.h | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 39 insertions(+) create mode 100644 cpu/mcf52x2/cpu.h diff --git a/cpu/mcf52x2/cpu.c b/cpu/mcf52x2/cpu.c index 2cfe6311d0..c4c5d50604 100644 --- a/cpu/mcf52x2/cpu.c +++ b/cpu/mcf52x2/cpu.c @@ -33,6 +33,7 @@ #include #include #include +#include "cpu.h" DECLARE_GLOBAL_DATA_PTR; @@ -143,6 +144,11 @@ int checkcpu(void) int do_reset(cmd_tbl_t * cmdtp, bd_t * bd, int flag, int argc, char *argv[]) { + /* Call the board specific reset actions first. */ + if(board_reset) { + board_reset(); + } + mbar_writeByte(MCF_RCM_RCR, MCF_RCM_RCR_SOFTRST | MCF_RCM_RCR_FRCRSTOUT); return 0; diff --git a/cpu/mcf52x2/cpu.h b/cpu/mcf52x2/cpu.h new file mode 100644 index 0000000000..c1227eb1ce --- /dev/null +++ b/cpu/mcf52x2/cpu.h @@ -0,0 +1,33 @@ +/* + * cpu.h + * + * Copyright (c) 2009 Freescale Semiconductor, Inc. + * + * See file CREDITS for list of people who contributed to this + * project. + * + * This program 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 2 of + * the License, or (at your option) any later version. + * + * This program 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 this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, + * MA 02110-1301 USA + */ + +#ifndef _CPU_H_ +#define _CPU_H_ + +#include + +/* Use this to create board specific reset functions */ +void board_reset(void) __attribute__((__weak__)); + +#endif /* _CPU_H_ */ -- cgit v1.2.1 From c7de810c79a00aa6fc08900ee0bb57bd295db733 Mon Sep 17 00:00:00 2001 From: Wolfgang Wegner Date: Tue, 2 Mar 2010 10:59:20 +0100 Subject: allow MCF532x to use CONFIG_MONITOR_IS_IN_RAM CONFIG_MONITOR_IS_IN_RAM is broken for MCF532x. This patch fixes this by conditionally - removing the vector table at the beginning of code - not overwriting the vector base register - removing the code to re-set the PLL, which effectively disables SDRAM access Signed-off-by: Wolfgang Wegner --- cpu/mcf532x/speed.c | 3 +++ cpu/mcf532x/start.S | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/cpu/mcf532x/speed.c b/cpu/mcf532x/speed.c index 0d378e63d4..67f08c7602 100644 --- a/cpu/mcf532x/speed.c +++ b/cpu/mcf532x/speed.c @@ -204,6 +204,8 @@ int clock_pll(int fsys, int flags) fout = ((fref * mfd) / (BUSDIV * 4)); #endif +/* must not tamper with SDRAMC if running from SDRAM */ +#if !defined(CONFIG_MONITOR_IS_IN_RAM) /* * Check to see if the SDRAM has already been initialized. * If it has then the SDRAM needs to be put into self refresh @@ -254,6 +256,7 @@ int clock_pll(int fsys, int flags) /* wait for DQS logic to relock */ for (i = 0; i < 0x200; i++) ; +#endif /* !defined(CONFIG_MONITOR_IS_IN_RAM) */ return fout; } diff --git a/cpu/mcf532x/start.S b/cpu/mcf532x/start.S index ff13a9f2dd..5b134aa47c 100644 --- a/cpu/mcf532x/start.S +++ b/cpu/mcf532x/start.S @@ -45,6 +45,7 @@ addl #60,%sp; /* space for 15 regs */ \ rte; +#if !defined(CONFIG_MONITOR_IS_IN_RAM) .text /* * Vector table. This is used for initial platform startup. @@ -121,6 +122,7 @@ vector192_255: .long _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT .long _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT .long _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT +#endif /* !defined(CONFIG_MONITOR_IS_IN_RAM) */ .text @@ -130,9 +132,11 @@ _start: nop move.w #0x2700,%sr /* Mask off Interrupt */ +#if !defined(CONFIG_MONITOR_IS_IN_RAM) /* Set vector base register at the beginning of the Flash */ move.l #CONFIG_SYS_FLASH_BASE, %d0 movec %d0, %VBR +#endif move.l #(CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_RAM_CTRL), %d0 movec %d0, %RAMBAR1 -- cgit v1.2.1