Skip to contentSkip to conversation

add support for mcf5307 cpu

PATCH Superseded Angelo Dureghello 3 participants 3 messages Sep 10, 2011 – Oct 6, 2011 m68k architecture

v3 of 5 Superseded Latest is v5 →

lore
Share & tools
lore
#0 lore raw

PATCH v3 1/1 add support for mcf5307 cpu

Add support for mcf5307 coldfire cpu. This is the updated entire patch, tested on a mcf5307 based custom board. Only this new set of file has been added, no other files in the tree are involved.

---
 arch/m68k/cpu/mcf530x/Makefile     |   48 +++++++
 arch/m68k/cpu/mcf530x/config.mk    |   25 ++++
 arch/m68k/cpu/mcf530x/cpu.c        |   48 +++++++
 arch/m68k/cpu/mcf530x/cpu.h        |   33 +++++
 arch/m68k/cpu/mcf530x/cpu_init.c   |  164 +++++++++++++++++++++++
 arch/m68k/cpu/mcf530x/interrupts.c |   42 ++++++
 arch/m68k/cpu/mcf530x/speed.c      |   36 +++++
 arch/m68k/cpu/mcf530x/start.S      |  253 ++++++++++++++++++++++++++++++++++++
 arch/m68k/include/asm/immap_5307.h |   78 +++++++++++
 arch/m68k/include/asm/m5307.h      |  119 +++++++++++++++++
 10 files changed, 846 insertions(+), 0 deletions(-)
arch/m68k/cpu/mcf530x/Makefile new file +48 -0
new file mode 100644
index 0000000..3c5a1c2
@@ -0,0 +1,48 @@
+#
+# Copyright (c) 2011 Angelo Dureghello <[email protected]>
+#
+# 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., 59 Temple Place, Suite 330, Boston,
+# MA 02111-1307 USA
+#
+
+include $(TOPDIR)/config.mk
+
+# CFLAGS += -DET_DEBUG
+
+LIB	= $(obj)lib$(CPU).o
+
+START	= start.o
+COBJS	= interrupts.o cpu.o speed.o cpu_init.o
+
+SRCS	:= $(START:.o=.S) $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS	:= $(addprefix $(obj),$(SOBJS) $(COBJS))
+START	:= $(addprefix $(obj),$(START))
+
+all:	$(obj).depend $(START) $(LIB)
+
+$(LIB):	$(OBJS)
+	$(call cmd_link_o_target, $(OBJS))
+
+#########################################################################
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
+
+#########################################################################
arch/m68k/cpu/mcf530x/config.mk new file +25 -0
new file mode 100644
index 0000000..2ba1644
@@ -0,0 +1,25 @@
+#
+# Copyright (c) 2011 Angelo Dureghello <[email protected]>
+#
+# 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., 59 Temple Place, Suite 330, Boston,
+# MA 02111-1307 USA
+#
+
+PLATFORM_RELFLAGS += -ffixed-d7 -msep-data
+
+PLATFORM_CPPFLAGS += -m5307 -fPIC
arch/m68k/cpu/mcf530x/cpu.c new file +48 -0

48 lines not on this page · raw message

arch/m68k/cpu/mcf530x/cpu.h new file +33 -0
new file mode 100644
index 0000000..c1227eb
@@ -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 <command.h>
+
+/* Use this to create board specific reset functions */
+void board_reset(void) __attribute__((__weak__));
+
+#endif /* _CPU_H_ */
arch/m68k/cpu/mcf530x/cpu_init.c new file +164 -0

164 lines not on this page · raw message

arch/m68k/cpu/mcf530x/interrupts.c new file +42 -0

42 lines not on this page · raw message

arch/m68k/cpu/mcf530x/speed.c new file +36 -0
new file mode 100644
index 0000000..426bd9e
@@ -0,0 +1,36 @@
+/*
+ * Copyright (c) 2011 Angelo Dureghello <[email protected]>
+ *
+ * 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., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+#include <common.h>
+#include <asm/processor.h>
+#include <asm/immap.h>
+
+DECLARE_GLOBAL_DATA_PTR;
+
+/* get_clocks() fills in gd->cpu_clock and gd->bus_clk */
+int get_clocks (void)
+{
+	gd->cpu_clk = CONFIG_SYS_CLK;
+	gd->bus_clk = gd->cpu_clk / 2;
+
+	return (0);
+}
arch/m68k/cpu/mcf530x/start.S new file +253 -0

253 lines not on this page · raw message

arch/m68k/include/asm/immap_5307.h new file +78 -0

78 lines not on this page · raw message

arch/m68k/include/asm/m5307.h new file +119 -0

119 lines not on this page · raw message

#1 lore raw

PATCH v3 1/1 add support for mcf5307 cpu

Quoted 8 lines

-----Original Message-----
From: u-boot-bounces at lists.denx.de [mailto:u-boot-bounces at lists.denx.de] On Behalf Of Angelo Dureghello
Sent: Sunday, September 11, 2011 12:32 AM
To: U-Boot at lists.denx.de
Cc: Jin Zhengxiong-R64188
Subject: [U-Boot] [PATCH 1/1 V3] add support for mcf5307 cpu

Quoted 4 lines

Add support for mcf5307 coldfire cpu. This is the updated entire patch, tested on a mcf5307 based custom board. Only this new set of file has been added, no other files in the tree are involved.

[Jin Zhengxiong-R64188] We at least need to update the Makefile or boards.cfg for the new added cpu/board? Or add some descriptions for how to configure and build the board? Thanks.

Quoted 13 lines
---
 arch/m68k/cpu/mcf530x/Makefile     |   48 +++++++
 arch/m68k/cpu/mcf530x/config.mk    |   25 ++++
 arch/m68k/cpu/mcf530x/cpu.c        |   48 +++++++
 arch/m68k/cpu/mcf530x/cpu.h        |   33 +++++
 arch/m68k/cpu/mcf530x/cpu_init.c   |  164 +++++++++++++++++++++++
 arch/m68k/cpu/mcf530x/interrupts.c |   42 ++++++
 arch/m68k/cpu/mcf530x/speed.c      |   36 +++++
 arch/m68k/cpu/mcf530x/start.S      |  253 ++++++++++++++++++++++++++++++++++++
 arch/m68k/include/asm/immap_5307.h |   78 +++++++++++
 arch/m68k/include/asm/m5307.h      |  119 +++++++++++++++++
 10 files changed, 846 insertions(+), 0 deletions(-)

[Jin Zhengxiong-R64188] Please try to use checkpatch to clean up the patch, there are a lot of coding style warnings and errors. Thanks.

Best Regards,
Jason

#2 lore raw

PATCH v3 1/1 add support for mcf5307 cpu

In reply to Angelo Dureghello

Dear Angelo Dureghello,

Quoted 5 lines · In message <[email protected]> you wrote:

Add support for mcf5307 coldfire cpu. This is the updated entire patch, tested on a mcf5307 based custom board. Only this new set of file has been added, no other files in the tree are involved.

Quoted 12 lines
---
 arch/m68k/cpu/mcf530x/Makefile     |   48 +++++++
 arch/m68k/cpu/mcf530x/config.mk    |   25 ++++
 arch/m68k/cpu/mcf530x/cpu.c        |   48 +++++++
 arch/m68k/cpu/mcf530x/cpu.h        |   33 +++++
 arch/m68k/cpu/mcf530x/cpu_init.c   |  164 +++++++++++++++++++++++
 arch/m68k/cpu/mcf530x/interrupts.c |   42 ++++++
 arch/m68k/cpu/mcf530x/speed.c      |   36 +++++
 arch/m68k/cpu/mcf530x/start.S      |  253 ++++++++++++++++++++++++++++++++++++
 arch/m68k/include/asm/immap_5307.h |   78 +++++++++++
 arch/m68k/include/asm/m5307.h      |  119 +++++++++++++++++
 10 files changed, 846 insertions(+), 0 deletions(-)

Checkpatch says:

total: 34 errors, 31 warnings, 846 lines checked

Please clean up and resubmit. Thanks.

Best regards,

Wolfgang Denk

Signature · 5 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
I wish I had a bronze torc for every user who didn't read the manual.
                             - Terry Pratchett, _The Light Fantastic_