Skip to contentSkip to conversation

m68k: add support for mcf5307 cpu

PATCH Superseded angelo 2 participants 5 messages Nov 4, 2012 – Nov 6, 2012 m68k architecture

v3 of 4 Superseded Latest is v4 →

lore
Share & tools
lore

angelo

author
#0 lore raw

PATCH v3 1/2 m68k: add support for mcf5307 cpu

Add support for freescale coldfire mcf5307 cpu.

---
Changes for v2:
- Add MAINTAINERS entry
- Add boards.cfg entry
Changes for v3:
- Fix code format issues

---
 MAINTAINERS                        |    4 +
 arch/m68k/cpu/mcf530x/Makefile     |   48 ++++
 arch/m68k/cpu/mcf530x/config.mk    |   30 +++
 arch/m68k/cpu/mcf530x/cpu.c        |   48 ++++
 arch/m68k/cpu/mcf530x/cpu.h        |   33 +++
 arch/m68k/cpu/mcf530x/cpu_init.c   |  160 +++++++++++++
 arch/m68k/cpu/mcf530x/interrupts.c |   43 ++++
 arch/m68k/cpu/mcf530x/speed.c      |   38 +++
 arch/m68k/cpu/mcf530x/start.S      |  263 +++++++++++++++++++++
 arch/m68k/include/asm/cache.h      |    3 +-
 arch/m68k/include/asm/immap.h      |   23 ++
 arch/m68k/include/asm/immap_5307.h |   78 +++++++
 arch/m68k/include/asm/m5307.h      |  127 +++++++++++
 arch/m68k/include/asm/timer.h      |    3 +-
 14 files changed, 899 insertions(+), 2 deletions(-)
MAINTAINERS +4 -0
index 2daee7d..5cb951f 100644
@@ -1118,6 +1118,10 @@ Wolfgang Wegner <[email protected]>
 
 	astro_mcf5373l	MCF5373L
 
+Angelo Dureghello <[email protected]>
+
+	amcore		mcf5307
+
 #########################################################################
 # AVR32 Systems:							#
 #									#
arch/m68k/cpu/mcf530x/Makefile new file +48 -0

48 lines not on this page · raw message

arch/m68k/cpu/mcf530x/config.mk new file +30 -0
new file mode 100644
index 0000000..f7b01c6
@@ -0,0 +1,30 @@
+#
+# 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
+
+cfg=$(shell grep configs $(OBJTREE)/include/config.h | sed 's/.*<\(configs.*\)>/\1/')
+is5307:=$(shell grep CONFIG_M5307 $(TOPDIR)/include/$(cfg))
+
+ifneq (,$(findstring CONFIG_M5307,$(is5307)))
+PLATFORM_CPPFLAGS += -mcpu=5307
+endif
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..1accfcc
@@ -0,0 +1,33 @@
+/*
+ *  cpu.h
+ *
+ *  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., 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 +160 -0

160 lines not on this page · raw message

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

43 lines not on this page · raw message

arch/m68k/cpu/mcf530x/speed.c new file +38 -0
new file mode 100644
index 0000000..42b55dd
@@ -0,0 +1,38 @@
+/*
+ * 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)
+{
+#if defined(CONFIG_M5307)
+	gd->cpu_clk = CONFIG_SYS_CLK;
+	gd->bus_clk = gd->cpu_clk / 2;
+#endif
+
+	return (0);
+}
arch/m68k/cpu/mcf530x/start.S new file +263 -0

263 lines not on this page · raw message

arch/m68k/include/asm/cache.h +2 -1
index f9e2d15..dd932c3 100644
@@ -31,7 +31,8 @@
 #define CONFIG_CF_V2
 #endif
 
-#if defined(CONFIG_MCF532x) || defined(CONFIG_MCF5301x)
+#if defined(CONFIG_MCF530x) || defined(CONFIG_MCF532x) || \
+    defined(CONFIG_MCF5301x)
 #define CONFIG_CF_V3
 #endif
 
arch/m68k/include/asm/immap.h +23 -0
index 2aab463..5cc81c2 100644
@@ -256,6 +256,29 @@
 #endif
 #endif				/* CONFIG_M5282 */
 
+#ifdef CONFIG_M5307
+#include <asm/immap_5307.h>
+#include <asm/m5307.h>
+
+#define CONFIG_SYS_UART_BASE            (MMAP_UART0 + \
+					(CONFIG_SYS_UART_PORT * 0x40))
+#define CONFIG_SYS_INTR_BASE            (MMAP_INTC)
+#define CONFIG_SYS_NUM_IRQS             (64)
+
+/* Timer */
+#ifdef CONFIG_MCFTMR
+#define CONFIG_SYS_UDELAY_BASE          (MMAP_DTMR0)
+#define CONFIG_SYS_TMR_BASE             (MMAP_DTMR1)
+#define CONFIG_SYS_TMRPND_REG           (mbar_readLong(MCFSIM_IPR))
+#define CONFIG_SYS_TMRINTR_NO           (31)
+#define CONFIG_SYS_TMRINTR_MASK		(0x00000400)
+#define CONFIG_SYS_TMRINTR_PEND		(CONFIG_SYS_TMRINTR_MASK)
+#define CONFIG_SYS_TMRINTR_PRI          (MCFSIM_ICR_AUTOVEC | \
+					 MCFSIM_ICR_LEVEL7 | MCFSIM_ICR_PRI3)
+#define CONFIG_SYS_TIMER_PRESCALER      (((gd->bus_clk / 1000000) - 1) << 8)
+#endif
+#endif                          /* CONFIG_M5307 */
+
 #if defined(CONFIG_MCF5301x)
 #include <asm/immap_5301x.h>
 #include <asm/m5301x.h>
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 +127 -0

127 lines not on this page · raw message

arch/m68k/include/asm/timer.h +2 -1
index 1a5de05..2638574 100644
@@ -33,7 +33,8 @@
 /****************************************************************************/
 /* DMA Timer module registers */
 typedef struct dtimer_ctrl {
-#if defined(CONFIG_M5249) || defined(CONFIG_M5253) || defined(CONFIG_M5272)
+#if defined(CONFIG_M5307) || defined(CONFIG_M5249) || \
+    defined(CONFIG_M5253) || defined(CONFIG_M5272)
 	u16 tmr;		/* 0x00 Mode register */
 	u16 res1;		/* 0x02 */
 	u16 trr;		/* 0x04 Reference register */
#1 lore raw

PATCH v3 1/2 m68k: add support for mcf5307 cpu

Dear angelo,

Quoted 1 line · In message <20121104195901.GA5141@angel3> you wrote:

Add support for freescale coldfire mcf5307 cpu.

...

Quoted 2 lines
arch/m68k/cpu/mcf530x/cpu_init.c new file +0 -0

...

arch/m68k/cpu/mcf530x/cpu_init.c line 45

Quoted 2 lines
arch/m68k/cpu/mcf530x/cpu_init.c new file +2 -0
+#define MCF5307_SP_ERR_FIX(cs_base,mask) \
+        if((cs_base+(mask&0xffff0000))>=0xffff0000)mask|=0x20

Please never do this. Please ALWAYS use the standard "do { ... } while (0)" construct to make sure such macros can be used savely in any call envionment.

arch/m68k/cpu/mcf530x/cpu_init.c line 49

Quoted 3 lines
arch/m68k/cpu/mcf530x/cpu_init.c new file +3 -0
+void init_csm(void)
+{
+	volatile csm_t *csm = (csm_t *) (MMAP_CSM);

NAK. Please so not use volatile. Hey, did you run your ptches through checkpatch? What did it say?

arch/m68k/cpu/mcf530x/cpu_init.c line 56

Quoted 6 lines
arch/m68k/cpu/mcf530x/cpu_init.c new file +6 -0
+#if (defined(CONFIG_SYS_CS0_BASE) && defined(CONFIG_SYS_CS0_MASK) \
+     && defined(CONFIG_SYS_CS0_CTRL))
+	csm->csar0 = (CONFIG_SYS_CS0_BASE>>16);
+	csm->cscr0 = CONFIG_SYS_CS0_CTRL;
+	csm->csmr0 = CONFIG_SYS_CS0_MASK;
+	MCF5307_SP_ERR_FIX(CONFIG_SYS_CS0_BASE,csm->csmr0);

We do not allow accesses to device registers through plain (even volatile) pointers. Please make sure to use proper I/O accessors instead.

...

Quoted 30 lines
arch/m68k/cpu/mcf530x/cpu_init.c new file +30 -0
+/*
+ *	Define the 5249 SIM register set addresses.
+ */
+
+/*
+ ***** MBAR  *****
+ */
+#define MCFSIM_RSR		0x00	/* Reset Status reg (r/w) */
+#define MCFSIM_SYPCR		0x01	/* System Protection reg (r/w) */
+#define MCFSIM_SWIVR		0x02	/* SW Watchdog intr reg (r/w) */
+#define MCFSIM_SWSR		0x03	/* SW Watchdog service (r/w) */
+#define MCFSIM_PAR		0x04    /* Parallel pin assignment reg */
+#define MCFSIM_PLLCR		0x08	/* PLL Control register */
+#define MCFSIM_MPARK		0x0c	/* Bus master park register (r/w) */
+
+#define MCFSIM_SIMR		0x00	/* SIM Config reg (r/w) */
+#define MCFSIM_ICR0		0x4c	/* Intr Ctrl reg 0 (r/w) */
+#define MCFSIM_ICR1		0x4d	/* Intr Ctrl reg 1 (r/w) */
+#define MCFSIM_ICR2		0x4e	/* Intr Ctrl reg 2 (r/w) */
+#define MCFSIM_ICR3		0x4f	/* Intr Ctrl reg 3 (r/w) */
+#define MCFSIM_ICR4		0x50	/* Intr Ctrl reg 4 (r/w) */
+#define MCFSIM_ICR5		0x51	/* Intr Ctrl reg 5 (r/w) */
+#define MCFSIM_ICR6		0x52	/* Intr Ctrl reg 6 (r/w) */
+#define MCFSIM_ICR7		0x53	/* Intr Ctrl reg 7 (r/w) */
+#define MCFSIM_ICR8		0x54	/* Intr Ctrl reg 8 (r/w) */
+#define MCFSIM_ICR9		0x55	/* Intr Ctrl reg 9 (r/w) */
+#define MCFSIM_ICR10		0x56	/* Intr Ctrl reg 10 (r/w) */
+#define MCFSIM_ICR11		0x57	/* Intr Ctrl reg 11 (r/w) */
+
+#define MCFSIM_IPR		0x40	/* Interrupt Pend reg (r/w) */

arch/m68k/cpu/mcf530x/cpu_init.c

Quoted 10 lines
arch/m68k/cpu/mcf530x/cpu_init.c new file +10 -0
+#define MCFSIM_IMR		0x44	/* Interrupt Mask reg (r/w) */
+
+#define MCFSIM_DCR		0x100	/* DRAM Control reg (r/w) */
+#define MCFSIM_DACR0		0x108	/* DRAM 0 Addr and Ctrl (r/w) */
+#define MCFSIM_DMR0		0x10c	/* DRAM 0 Mask reg (r/w) */
+#define MCFSIM_DACR1		0x110	/* DRAM 1 Addr and Ctrl (r/w) */
+#define MCFSIM_DMR1		0x114	/* DRAM 1 Mask reg (r/w) */
+
+#define MCFSIM_PADDR		0x244   /* Parallel data direction reg */
+#define MCFSIM_PADAT		0x248   /* Parallel data direction reg */

We don't allow any base address + offset notation. Please define a proper C structure instead.

Please fix globally.

arch/m68k/cpu/mcf530x/cpu_init.c

Quoted 3 lines
arch/m68k/cpu/mcf530x/cpu_init.c new file +2 -1
-#if defined(CONFIG_M5249) || defined(CONFIG_M5253) || defined(CONFIG_M5272)
+#if defined(CONFIG_M5307) || defined(CONFIG_M5249) || \
+    defined(CONFIG_M5253) || defined(CONFIG_M5272)

Please keep the list sorted.

Best regards,

Wolfgang Denk

Signature · 7 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 believe you find life such a problem because you  think  there  are
the  good  people  and the bad people. You're wrong, of course. There
are, always and only, the bad people, but some of them are  on  oppo-
site sides.                      - Terry Pratchett, _Guards! Guards!_
#2 lore raw

PATCH v3 1/2 m68k: add support for mcf5307 cpu

Hi Wolfgang,

thanks for reviewing.
See my comments blow.

Quoted 11 lines · Wolfgang Denk

Dear angelo,

Quoted 1 line · In message <20121104195901.GA5141@angel3> you wrote:

Add support for freescale coldfire mcf5307 cpu.

...

Quoted 2 lines
arch/m68k/cpu/mcf530x/cpu_init.c new file +0 -0

...

Quoted 2 lines
arch/m68k/cpu/mcf530x/cpu_init.c new file +2 -0
+#define MCF5307_SP_ERR_FIX(cs_base,mask) \
+        if((cs_base+(mask&0xffff0000))>=0xffff0000)mask|=0x20

Done.

Quoted 10 lines

Please never do this. Please ALWAYS use the standard "do { ... } while (0)" construct to make sure such macros can be used savely in any call envionment.

arch/m68k/cpu/mcf530x/cpu_init.c line 49

Quoted 3 lines
arch/m68k/cpu/mcf530x/cpu_init.c new file +3 -0
+void init_csm(void)
+{
+	volatile csm_t *csm = (csm_t *) (MMAP_CSM);

NAK. Please so not use volatile. Hey, did you run your ptches through checkpatch? What did it say?

Ok, i forgot pass through checkpatch, will do it always.

Quoted 11 lines

arch/m68k/cpu/mcf530x/cpu_init.c line 56

Quoted 7 lines
arch/m68k/cpu/mcf530x/cpu_init.c new file +6 -0
+#if (defined(CONFIG_SYS_CS0_BASE) && defined(CONFIG_SYS_CS0_MASK) \
+     && defined(CONFIG_SYS_CS0_CTRL))
+	csm->csar0 = (CONFIG_SYS_CS0_BASE>>16);
+	csm->cscr0 = CONFIG_SYS_CS0_CTRL;
+	csm->csmr0 = CONFIG_SYS_CS0_MASK;
+	MCF5307_SP_ERR_FIX(CONFIG_SYS_CS0_BASE,csm->csmr0);

We do not allow accesses to device registers through plain (even volatile) pointers. Please make sure to use proper I/O accessors instead.

Done.

Quoted 45 lines

...

Quoted 30 lines
arch/m68k/cpu/mcf530x/cpu_init.c new file +30 -0
+/*
+ *	Define the 5249 SIM register set addresses.
+ */
+
+/*
+ ***** MBAR  *****
+ */
+#define MCFSIM_RSR		0x00	/* Reset Status reg (r/w) */
+#define MCFSIM_SYPCR		0x01	/* System Protection reg (r/w) */
+#define MCFSIM_SWIVR		0x02	/* SW Watchdog intr reg (r/w) */
+#define MCFSIM_SWSR		0x03	/* SW Watchdog service (r/w) */
+#define MCFSIM_PAR		0x04    /* Parallel pin assignment reg */
+#define MCFSIM_PLLCR		0x08	/* PLL Control register */
+#define MCFSIM_MPARK		0x0c	/* Bus master park register (r/w) */
+
+#define MCFSIM_SIMR		0x00	/* SIM Config reg (r/w) */
+#define MCFSIM_ICR0		0x4c	/* Intr Ctrl reg 0 (r/w) */
+#define MCFSIM_ICR1		0x4d	/* Intr Ctrl reg 1 (r/w) */
+#define MCFSIM_ICR2		0x4e	/* Intr Ctrl reg 2 (r/w) */
+#define MCFSIM_ICR3		0x4f	/* Intr Ctrl reg 3 (r/w) */
+#define MCFSIM_ICR4		0x50	/* Intr Ctrl reg 4 (r/w) */
+#define MCFSIM_ICR5		0x51	/* Intr Ctrl reg 5 (r/w) */
+#define MCFSIM_ICR6		0x52	/* Intr Ctrl reg 6 (r/w) */
+#define MCFSIM_ICR7		0x53	/* Intr Ctrl reg 7 (r/w) */
+#define MCFSIM_ICR8		0x54	/* Intr Ctrl reg 8 (r/w) */
+#define MCFSIM_ICR9		0x55	/* Intr Ctrl reg 9 (r/w) */
+#define MCFSIM_ICR10		0x56	/* Intr Ctrl reg 10 (r/w) */
+#define MCFSIM_ICR11		0x57	/* Intr Ctrl reg 11 (r/w) */
+
+#define MCFSIM_IPR		0x40	/* Interrupt Pend reg (r/w) */

arch/m68k/cpu/mcf530x/cpu_init.c

Quoted 10 lines
arch/m68k/cpu/mcf530x/cpu_init.c new file +10 -0
+#define MCFSIM_IMR		0x44	/* Interrupt Mask reg (r/w) */
+
+#define MCFSIM_DCR		0x100	/* DRAM Control reg (r/w) */
+#define MCFSIM_DACR0		0x108	/* DRAM 0 Addr and Ctrl (r/w) */
+#define MCFSIM_DMR0		0x10c	/* DRAM 0 Mask reg (r/w) */
+#define MCFSIM_DACR1		0x110	/* DRAM 1 Addr and Ctrl (r/w) */
+#define MCFSIM_DMR1		0x114	/* DRAM 1 Mask reg (r/w) */
+
+#define MCFSIM_PADDR		0x244   /* Parallel data direction reg */
+#define MCFSIM_PADAT		0x248   /* Parallel data direction reg */

We don't allow any base address + offset notation. Please define a proper C structure instead.

Quoted 1 line

Please fix globally.

Clear, will fix it.

Quoted 8 lines

arch/m68k/cpu/mcf530x/cpu_init.c

Quoted 5 lines
arch/m68k/cpu/mcf530x/cpu_init.c new file +2 -1
-#if defined(CONFIG_M5249) || defined(CONFIG_M5253) || defined(CONFIG_M5272)
+#if defined(CONFIG_M5307) || defined(CONFIG_M5249) || \
+    defined(CONFIG_M5253) || defined(CONFIG_M5272)

Please keep the list sorted.

Done.

Quoted 12 lines

Best regards,

Wolfgang Denk

Signature · 7 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 believe you find life such a problem because you  think  there  are
the  good  people  and the bad people. You're wrong, of course. There
are, always and only, the bad people, but some of them are  on  oppo-
site sides.                      - Terry Pratchett, _Guards! Guards!_
#3 lore raw

PATCH v3 1/2 m68k: add support for mcf5307 cpu

In reply to Wolfgang Denk

Hi Wolfgang,

i have still a question here, please see below.

Quoted 79 lines · Wolfgang Denk

Dear angelo,

Quoted 1 line · In message <20121104195901.GA5141@angel3> you wrote:

Add support for freescale coldfire mcf5307 cpu.

...

Quoted 2 lines
arch/m68k/cpu/mcf530x/cpu_init.c new file +0 -0

...

arch/m68k/cpu/mcf530x/cpu_init.c line 45

Quoted 2 lines
arch/m68k/cpu/mcf530x/cpu_init.c new file +2 -0
+#define MCF5307_SP_ERR_FIX(cs_base,mask) \
+        if((cs_base+(mask&0xffff0000))>=0xffff0000)mask|=0x20

Please never do this. Please ALWAYS use the standard "do { ... } while (0)" construct to make sure such macros can be used savely in any call envionment.

arch/m68k/cpu/mcf530x/cpu_init.c line 49

Quoted 3 lines
arch/m68k/cpu/mcf530x/cpu_init.c new file +3 -0
+void init_csm(void)
+{
+	volatile csm_t *csm = (csm_t *) (MMAP_CSM);

NAK. Please so not use volatile. Hey, did you run your ptches through checkpatch? What did it say?

arch/m68k/cpu/mcf530x/cpu_init.c line 56

Quoted 6 lines
arch/m68k/cpu/mcf530x/cpu_init.c new file +6 -0
+#if (defined(CONFIG_SYS_CS0_BASE) && defined(CONFIG_SYS_CS0_MASK) \
+     && defined(CONFIG_SYS_CS0_CTRL))
+	csm->csar0 = (CONFIG_SYS_CS0_BASE>>16);
+	csm->cscr0 = CONFIG_SYS_CS0_CTRL;
+	csm->csmr0 = CONFIG_SYS_CS0_MASK;
+	MCF5307_SP_ERR_FIX(CONFIG_SYS_CS0_BASE,csm->csmr0);

We do not allow accesses to device registers through plain (even volatile) pointers. Please make sure to use proper I/O accessors instead.

...

Quoted 30 lines
arch/m68k/cpu/mcf530x/cpu_init.c new file +30 -0
+/*
+ *	Define the 5249 SIM register set addresses.
+ */
+
+/*
+ ***** MBAR  *****
+ */
+#define MCFSIM_RSR		0x00	/* Reset Status reg (r/w) */
+#define MCFSIM_SYPCR		0x01	/* System Protection reg (r/w) */
+#define MCFSIM_SWIVR		0x02	/* SW Watchdog intr reg (r/w) */
+#define MCFSIM_SWSR		0x03	/* SW Watchdog service (r/w) */
+#define MCFSIM_PAR		0x04    /* Parallel pin assignment reg */
+#define MCFSIM_PLLCR		0x08	/* PLL Control register */
+#define MCFSIM_MPARK		0x0c	/* Bus master park register (r/w) */
+
+#define MCFSIM_SIMR		0x00	/* SIM Config reg (r/w) */
+#define MCFSIM_ICR0		0x4c	/* Intr Ctrl reg 0 (r/w) */
+#define MCFSIM_ICR1		0x4d	/* Intr Ctrl reg 1 (r/w) */
+#define MCFSIM_ICR2		0x4e	/* Intr Ctrl reg 2 (r/w) */
+#define MCFSIM_ICR3		0x4f	/* Intr Ctrl reg 3 (r/w) */
+#define MCFSIM_ICR4		0x50	/* Intr Ctrl reg 4 (r/w) */
+#define MCFSIM_ICR5		0x51	/* Intr Ctrl reg 5 (r/w) */
+#define MCFSIM_ICR6		0x52	/* Intr Ctrl reg 6 (r/w) */
+#define MCFSIM_ICR7		0x53	/* Intr Ctrl reg 7 (r/w) */
+#define MCFSIM_ICR8		0x54	/* Intr Ctrl reg 8 (r/w) */
+#define MCFSIM_ICR9		0x55	/* Intr Ctrl reg 9 (r/w) */
+#define MCFSIM_ICR10		0x56	/* Intr Ctrl reg 10 (r/w) */
+#define MCFSIM_ICR11		0x57	/* Intr Ctrl reg 11 (r/w) */
+
+#define MCFSIM_IPR		0x40	/* Interrupt Pend reg (r/w) */

arch/m68k/cpu/mcf530x/cpu_init.c

Quoted 10 lines
arch/m68k/cpu/mcf530x/cpu_init.c new file +10 -0
+#define MCFSIM_IMR		0x44	/* Interrupt Mask reg (r/w) */
+
+#define MCFSIM_DCR		0x100	/* DRAM Control reg (r/w) */
+#define MCFSIM_DACR0		0x108	/* DRAM 0 Addr and Ctrl (r/w) */
+#define MCFSIM_DMR0		0x10c	/* DRAM 0 Mask reg (r/w) */
+#define MCFSIM_DACR1		0x110	/* DRAM 1 Addr and Ctrl (r/w) */
+#define MCFSIM_DMR1		0x114	/* DRAM 1 Mask reg (r/w) */
+
+#define MCFSIM_PADDR		0x244   /* Parallel data direction reg */
+#define MCFSIM_PADAT		0x248   /* Parallel data direction reg */

We don't allow any base address + offset notation. Please define a proper C structure instead.

Quoted 2 lines

Please fix globally.

I used this approach looking all other coldfire cpu files, and this notation seems accepted.
I started m5307.h looking those files (i.e. m5249.h) maintaing the same scheme.

Let me know how i have to proceed.

Best Regards,
Angelo Dureghello

#4 lore raw

PATCH v3 1/2 m68k: add support for mcf5307 cpu

Dear Angelo,

Quoted 3 lines · In message <20121105205220.GA24682@angel3> you wrote:
Quoted 3 lines

We don't allow any base address + offset notation. Please define a proper C structure instead.

...

Quoted 5 lines

I used this approach looking all other coldfire cpu files, and this notation seems accepted.
I started m5307.h looking those files (i.e. m5249.h) maintaing the same scheme.

Let me know how i have to proceed.

We have been less strict in the past, but we learned a lesson and moved on.

Best regards,

Wolfgang Denk

Signature · 4 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
The existence of god implies a violation of causality.