Changes for 68000 code integration.
Subsystems (2)
PATCH 1/1 Changes for 68000 code integration.
In reply to a message not in the archiveHi all,
This is the first of a pack of patches to support the original 68000 cpu. This adds:
-MC68000 cpu as a choice in the config menu.
-Alcetronics M68K board (uses this cpu).
What I have changed:
-CONFIG_M68000 was being used by 68328 CPUs.
Renamed to CONFIG_M68XXX. Now the 68000 and all CPU32 CPUs use this flag for common configurations.
-Modified all 68[VZ|EZ]328 to select CONFIG_MCPU32
-Modified CONFIG_MCPU32 to select CONFIG_M68XXX.
-Modified CONFIG_M68360 to select CONFIG_M68XXX (I think it was missing some settings). -Modified some files to use CONFIG_M68XXX instead of CONFIG_M68000/CONFIG_MCPU32
Regards,
Luis Alves
--- arch/m68k/Kconfig.cpu | 29 ++++++++++++++++++----------- arch/m68k/Kconfig.machine | 6 ++++++ arch/m68k/Makefile | 9 ++++++--- arch/m68k/include/asm/bitops.h | 2 +- arch/m68k/include/asm/delay.h | 2 +- arch/m68k/lib/memcpy.c | 4 ++-- arch/m68k/lib/memset.c | 2 +- arch/m68k/lib/muldi3.c | 2 +- 8 files changed, 36 insertions(+), 20 deletions(-)
arch/m68k/Kconfig.cpu +18 -11
@@ -32,26 +32,33 @@ endchoice if M68KCLASSIC -config M68000 + +config M68XXX bool select CPU_HAS_NO_BITFIELDS select CPU_HAS_NO_MULDIV64 select GENERIC_CSUM help - The Freescale (was Motorola) 68000 CPU is the first generation of - the well known M68K family of processors. The CPU core as well as - being available as a stand alone CPU was also used in many - System-On-Chip devices (eg 68328, 68302, etc). It does not contain - a paging MMU. + Common features for the first generation of M68K CPUs. It + includes the original MC68000 and CPU32 core. + config MCPU32 bool - select CPU_HAS_NO_BITFIELDS + select M68XXX help The Freescale (was then Motorola) CPU32 is a CPU core that is based on the 68020 processor. For the most part it is used in System-On-Chip parts, and does not contain a paging MMU. +config M68000 + bool "MC68000" + select M68XXX + help + The Freescale (was Motorola) 68000 CPU is the first generation of + the well known M68K family of processors. It does not contain + a paging MMU. + config M68020 bool "68020 support" depends on MMU
@@ -96,28 +103,28 @@ config M68060 config M68328 bool "MC68328" depends on !MMU - select M68000 + select MCPU32 help Motorola 68328 processor support. config M68EZ328 bool "MC68EZ328" depends on !MMU - select M68000 + select MCPU32 help Motorola 68EX328 processor support. config M68VZ328 bool "MC68VZ328" depends on !MMU - select M68000 + select MCPU32 help Motorola 68VZ328 processor support. config M68360 bool "MC68360" depends on !MMU - select MCPU32 + select M68XXX help Motorola 68360 processor support.
arch/m68k/Kconfig.machine +6 -0
@@ -134,6 +134,12 @@ config SUN3 endif # M68KCLASSIC +config ALCE68K + bool "Alcetronics M68K board support" + depends on M68000 + help + Support for the Alcetronics M68K board. + config PILOT bool
arch/m68k/Makefile +6 -3
@@ -32,8 +32,9 @@ cpuflags-$(CONFIG_M68040) := -m68040 endif cpuflags-$(CONFIG_M68030) := cpuflags-$(CONFIG_M68020) := -cpuflags-$(CONFIG_M68360) := -m68332 cpuflags-$(CONFIG_M68000) := -m68000 +cpuflags-$(CONFIG_MCPU32) := -m68000 +cpuflags-$(CONFIG_M68360) := -m68332 cpuflags-$(CONFIG_M54xx) := $(call cc-option,-mcpu=5475,-m5200) cpuflags-$(CONFIG_M5407) := $(call cc-option,-mcpu=5407,-m5200) cpuflags-$(CONFIG_M532x) := $(call cc-option,-mcpu=532x,-m5307)
@@ -88,8 +89,9 @@ endif # head-y := arch/m68k/kernel/head.o head-$(CONFIG_SUN3) := arch/m68k/kernel/sun3-head.o +head-$(CONFIG_M68000) := arch/m68k/platform/68000/head.o head-$(CONFIG_M68360) := arch/m68k/platform/68360/head.o -head-$(CONFIG_M68000) := arch/m68k/platform/68328/head.o +head-$(CONFIG_MCPU32) := arch/m68k/platform/68328/head.o head-$(CONFIG_COLDFIRE) := arch/m68k/platform/coldfire/head.o core-y += arch/m68k/kernel/ arch/m68k/mm/
@@ -111,7 +113,8 @@ core-$(CONFIG_M68040) += arch/m68k/fpsp040/ core-$(CONFIG_M68060) += arch/m68k/ifpsp060/ core-$(CONFIG_M68KFPU_EMU) += arch/m68k/math-emu/ core-$(CONFIG_M68360) += arch/m68k/platform/68360/ -core-$(CONFIG_M68000) += arch/m68k/platform/68328/ +core-$(CONFIG_M68000) += arch/m68k/platform/68000/ +core-$(CONFIG_MCPU32) += arch/m68k/platform/68328/ core-$(CONFIG_M68EZ328) += arch/m68k/platform/68EZ328/ core-$(CONFIG_M68VZ328) += arch/m68k/platform/68VZ328/ core-$(CONFIG_COLDFIRE) += arch/m68k/platform/coldfire/
arch/m68k/include/asm/bitops.h +1 -1
@@ -457,7 +457,7 @@ static inline unsigned long ffz(unsigned long word)* generic functions for those. */ #if (defined(__mcfisaaplus__) || defined(__mcfisac__)) && \ - !defined(CONFIG_M68000 ) && !defined(CONFIG_MCPU32 ) + !defined(CONFIG_M68XXX )static inline int __ffs (int x) { __asm__ __volatile__ ("bitrev %0; ff1 %0"
arch/m68k/include/asm/delay.h +1 -1
@@ -43,7 +43,7 @@ static inline void __delay(unsigned long loops)extern void __bad_udelay (void ); -#if defined(CONFIG_M68000 ) || defined(CONFIG_COLDFIRE ) +#if defined(CONFIG_M68XXX ) || defined(CONFIG_COLDFIRE )/* * The simpler m68k and ColdFire processors do not have a 32*32->64 * multiply instruction. So we need to handle them a little differently.
arch/m68k/lib/memcpy.c +2 -2
@@ -22,7 +22,7 @@ void *memcpy(void *to, const void *from, size_t n) from = cfrom; n--; } -#if defined(CONFIG_M68000 ) +#if defined(CONFIG_M68XXX )if ((long )from &1 ) {char *cto = to;const char *cfrom = from;
@@ -43,7 +43,7 @@ void *memcpy(void *to, const void *from, size_t n)if (temp) {long *lto = to;const long *lfrom = from; -#if defined(CONFIG_M68000 ) || defined(CONFIG_COLDFIRE ) +#if defined(CONFIG_M68XXX ) || defined(CONFIG_COLDFIRE )for (; temp; temp--) *lto++ = *lfrom++;#else
arch/m68k/lib/memset.c +1 -1
@@ -32,7 +32,7 @@ void *memset(void *s, int c, size_t count) temp = count >>2 ;if (temp) {long *ls = s; -#if defined(CONFIG_M68000 ) || defined(CONFIG_COLDFIRE ) +#if defined(CONFIG_M68XXX ) || defined(CONFIG_COLDFIRE )for (; temp; temp--) *ls++ = c;#else
arch/m68k/lib/muldi3.c +1 -1
@@ -19,7 +19,7 @@ along with GNU CC; see the file COPYING. If not, write tothe Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#if defined(CONFIG_M68000 ) || defined(CONFIG_COLDFIRE ) +#if defined(CONFIG_M68XXX ) || defined(CONFIG_COLDFIRE )#define SI_TYPE_SIZE 32#define __BITS4 (SI_TYPE_SIZE / 4)
Signature · 1 line
1.7.5.4
Hi Luis,
Quoted 4 lines · Luis Alves
This is the first of a pack of patches to support the original 68000 cpu. This adds:
-MC68000 cpu as a choice in the config menu.
-Alcetronics M68K board (uses this cpu).
Nice!
Quoted 4 lines
What I have changed:
-CONFIG_M68000 was being used by 68328 CPUs.
Renamed toCONFIG_M68XXX. Now the 68000 and all CPU32 CPUs use this flag for common configurations.
-Modified all 68[VZ|EZ]328 to selectCONFIG_MCPU32
The CONFIG_CPU32 designator is not correct for 68x328 parts, they do not have a CPU32 core. They are standard 68000 cores internally.
Quoted 3 lines
-Modified
CONFIG_MCPU32to selectCONFIG_M68XXX.
-ModifiedCONFIG_M68360to selectCONFIG_M68XXX(I think it was missing some settings). -Modified some files to useCONFIG_M68XXXinstead of CONFIG_M68000/CONFIG_MCPU32
Although there was no true 68000 part supported before the intention of the CONFIG_M68000 define was for that CPU - or any SoC type part that contained a true 68000 CPU core. And it would be good to keep that naming so it is consistent with the other 680x0 cores.
Regards
Greg
Quoted 216 lines
--- arch/m68k/Kconfig.cpu | 29 ++++++++++++++++++----------- arch/m68k/Kconfig.machine | 6 ++++++ arch/m68k/Makefile | 9 ++++++--- arch/m68k/include/asm/bitops.h | 2 +- arch/m68k/include/asm/delay.h | 2 +- arch/m68k/lib/memcpy.c | 4 ++-- arch/m68k/lib/memset.c | 2 +- arch/m68k/lib/muldi3.c | 2 +- 8 files changed, 36 insertions(+), 20 deletions(-)arch/m68k/Kconfig.cpu +18
-11@@ -32,26 +32,33 @@ endchoice if M68KCLASSIC -config M68000 + +config M68XXX bool select CPU_HAS_NO_BITFIELDS select CPU_HAS_NO_MULDIV64 select GENERIC_CSUM help - The Freescale (was Motorola) 68000 CPU is the first generation of - the well known M68K family of processors. The CPU core as well as - being available as a stand alone CPU was also used in many - System-On-Chip devices (eg 68328, 68302, etc). It does not contain - a paging MMU. + Common features for the first generation of M68K CPUs. It + includes the original MC68000 and CPU32 core. + config MCPU32 bool - select CPU_HAS_NO_BITFIELDS + select M68XXX help The Freescale (was then Motorola) CPU32 is a CPU core that is based on the 68020 processor. For the most part it is used in System-On-Chip parts, and does not contain a paging MMU. +config M68000 + bool "MC68000" + select M68XXX + help + The Freescale (was Motorola) 68000 CPU is the first generation of + the well known M68K family of processors. It does not contain + a paging MMU. + config M68020 bool "68020 support" depends on MMU@@ -96,28 +103,28 @@ config M68060 config M68328 bool "MC68328" depends on !MMU - select M68000 + select MCPU32 help Motorola 68328 processor support. config M68EZ328 bool "MC68EZ328" depends on !MMU - select M68000 + select MCPU32 help Motorola 68EX328 processor support. config M68VZ328 bool "MC68VZ328" depends on !MMU - select M68000 + select MCPU32 help Motorola 68VZ328 processor support. config M68360 bool "MC68360" depends on !MMU - select MCPU32 + select M68XXX help Motorola 68360 processor support.arch/m68k/Kconfig.machine +6
-0@@ -134,6 +134,12 @@ config SUN3 endif # M68KCLASSIC +config ALCE68K + bool "Alcetronics M68K board support" + depends on M68000 + help + Support for the Alcetronics M68K board. + config PILOT boolarch/m68k/Makefile +6
-3@@ -32,8 +32,9 @@ cpuflags-$(CONFIG_M68040) := -m68040 endif cpuflags-$(CONFIG_M68030) := cpuflags-$(CONFIG_M68020) := -cpuflags-$(CONFIG_M68360) := -m68332 cpuflags-$(CONFIG_M68000) := -m68000 +cpuflags-$(CONFIG_MCPU32) := -m68000 +cpuflags-$(CONFIG_M68360) := -m68332 cpuflags-$(CONFIG_M54xx) := $(call cc-option,-mcpu=5475,-m5200) cpuflags-$(CONFIG_M5407) := $(call cc-option,-mcpu=5407,-m5200) cpuflags-$(CONFIG_M532x) := $(call cc-option,-mcpu=532x,-m5307)@@ -88,8 +89,9 @@ endif # head-y := arch/m68k/kernel/head.o head-$(CONFIG_SUN3) := arch/m68k/kernel/sun3-head.o +head-$(CONFIG_M68000) := arch/m68k/platform/68000/head.o head-$(CONFIG_M68360) := arch/m68k/platform/68360/head.o -head-$(CONFIG_M68000) := arch/m68k/platform/68328/head.o +head-$(CONFIG_MCPU32) := arch/m68k/platform/68328/head.o head-$(CONFIG_COLDFIRE) := arch/m68k/platform/coldfire/head.o core-y += arch/m68k/kernel/ arch/m68k/mm/@@ -111,7 +113,8 @@ core-$(CONFIG_M68040) += arch/m68k/fpsp040/ core-$(CONFIG_M68060) += arch/m68k/ifpsp060/ core-$(CONFIG_M68KFPU_EMU) += arch/m68k/math-emu/ core-$(CONFIG_M68360) += arch/m68k/platform/68360/ -core-$(CONFIG_M68000) += arch/m68k/platform/68328/ +core-$(CONFIG_M68000) += arch/m68k/platform/68000/ +core-$(CONFIG_MCPU32) += arch/m68k/platform/68328/ core-$(CONFIG_M68EZ328) += arch/m68k/platform/68EZ328/ core-$(CONFIG_M68VZ328) += arch/m68k/platform/68VZ328/ core-$(CONFIG_COLDFIRE) += arch/m68k/platform/coldfire/arch/m68k/include/asm/bitops.h +1
-1@@ -457,7 +457,7 @@ static inline unsigned long ffz(unsigned long word)* generic functions for those. */ #if (defined(__mcfisaaplus__) || defined(__mcfisac__))&& \ - !defined(CONFIG_M68000 )&& !defined(CONFIG_MCPU32 ) + !defined(CONFIG_M68XXX )static inline int __ffs (int x) { __asm__ __volatile__ ("bitrev %0; ff1 %0"arch/m68k/include/asm/delay.h +1
-1@@ -43,7 +43,7 @@ static inline void __delay(unsigned long loops)extern void __bad_udelay (void ); -#if defined(CONFIG_M68000 ) || defined(CONFIG_COLDFIRE ) +#if defined(CONFIG_M68XXX ) || defined(CONFIG_COLDFIRE )/* * The simpler m68k and ColdFire processors do not have a 32*32->64 * multiply instruction. So we need to handle them a little differently. arch/m68k/lib/memcpy.c +2
-2@@ -22,7 +22,7 @@ void *memcpy(void *to, const void *from, size_t n) from = cfrom; n--; } -#if defined(CONFIG_M68000 ) +#if defined(CONFIG_M68XXX )if ((long )from&1 ) {char *cto = to;const char *cfrom = from;@@ -43,7 +43,7 @@ void *memcpy(void *to, const void *from, size_t n)if (temp) {long *lto = to;const long *lfrom = from; -#if defined(CONFIG_M68000 ) || defined(CONFIG_COLDFIRE ) +#if defined(CONFIG_M68XXX ) || defined(CONFIG_COLDFIRE )for (; temp; temp--) *lto++ = *lfrom++;#else arch/m68k/lib/memset.c +1
-1@@ -32,7 +32,7 @@ void *memset(void *s, int c, size_t count) temp = count>>2 ;if (temp) {long *ls = s; -#if defined(CONFIG_M68000 ) || defined(CONFIG_COLDFIRE ) +#if defined(CONFIG_M68XXX ) || defined(CONFIG_COLDFIRE )for (; temp; temp--) *ls++ = c;#else arch/m68k/lib/muldi3.c +1
-1@@ -19,7 +19,7 @@ along with GNU CC; see the file COPYING. If not, write tothe Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#if defined(CONFIG_M68000 ) || defined(CONFIG_COLDFIRE ) +#if defined(CONFIG_M68XXX ) || defined(CONFIG_COLDFIRE )#define SI_TYPE_SIZE 32#define __BITS4 (SI_TYPE_SIZE / 4)
Signature · 5 lines
------------------------------------------------------------------------ Greg Ungerer -- Principal Engineer EMAIL: [email protected] SnapGear Group, McAfee PHONE: +61 7 3435 2888 8 Gardner Close FAX: +61 7 3217 5323 Milton, QLD, 4064, Australia WEB: http://www.SnapGear.com
Geert Uytterhoeven
maintainerQuoted 7 lines · Greg Ungerer
Quoted 4 lines · Luis Alves
This is the first of a pack of patches to support the original 68000 cpu. This adds:
-MC68000 cpu as a choice in the config menu.
-Alcetronics M68K board (uses this cpu).Nice!
But the actual arch/m68k/platform/68000/ part is missing?
Quoted 9 lines
Quoted 5 lines
-Modified
CONFIG_MCPU32to selectCONFIG_M68XXX.
-ModifiedCONFIG_M68360to selectCONFIG_M68XXX(I think it was missing some settings).
-Modified some files to useCONFIG_M68XXXinstead of CONFIG_M68000/CONFIG_MCPU32Although there was no true 68000 part supported before the intention of the
CONFIG_M68000define was for that CPU - or any SoC type part that contained a true 68000 CPU core. And it would be good to keep that
Indeed.
Quoted 1 line
naming so it is consistent with the other 680x0 cores.
Indeed, ...
Quoted 2 lines
Review
Quoted 2 lines
(quoted diff) +1
-1-#if defined(CONFIG_M68000) || defined(CONFIG_COLDFIRE) +#if defined(CONFIG_M68XXX) || defined(CONFIG_COLDFIRE)
"CONFIG_M68XXX || CONFIG_COLDFIRE" makes me think "Isn't this always true?"...
Quoted 5 lines
Quoted 5 lines
/*
* The simpler m68k and ColdFire processors do not have a 32*32->64
* multiply instruction. So we need to handle them a little differently.arch/m68k/lib/memcpy.c +0
-0
Quoted 8 lines
arch/m68k/lib/memcpy.c void *memcpy(void *to, const void *from, size_t n) · line 25
Quoted 8 lines
arch/m68k/lib/memcpy.c +1
-1@@ -22,7 +22,7 @@ void *memcpy(void *to, const void *from, size_t n) from = cfrom; n--; } -#if defined(CONFIG_M68000 ) +#if defined(CONFIG_M68XXX )
... and CONFIG_M68XXX sounds like it's set for e.g. '020 too.
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]
In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds
_______________________________________________
uClinux-dev mailing list
[email protected]
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by [email protected]
To unsubscribe see:
http://mailman.uclinux.org/mailman/options/uclinux-dev
Quoted 23 lines · Luis Alves
arch/m68k/Kconfig.cpu +4
-6@@ -32,26 +32,33 @@ endchoice if M68KCLASSIC -config M68000 + +config M68XXX bool select CPU_HAS_NO_BITFIELDS select CPU_HAS_NO_MULDIV64 select GENERIC_CSUM help - The Freescale (was Motorola) 68000 CPU is the first generation of - the well known M68K family of processors. The CPU core as well as - being available as a stand alone CPU was also used in many - System-On-Chip devices (eg 68328, 68302, etc). It does not contain - a paging MMU. + Common features for the first generation of M68K CPUs. It + includes the original MC68000 and CPU32 core.
arch/m68k/Kconfig.cpu endchoice · line 52
Quoted 10 lines
arch/m68k/Kconfig.cpu +2
-1+ config MCPU32 bool - select CPU_HAS_NO_BITFIELDS + select M68XXX help The Freescale (was then Motorola) CPU32 is a CPU core that is based on the 68020 processor. For the most part it is used in System-On-Chip parts, and does not contain a paging MMU.
I believe this misrepresents the CPU32 feature set. According to the old paper copy I have of the Motorola CPU32 reference manual, the only unimplemented instructions relative to the 68020 are these:
1) Bit field instructions
2) Module call/return
3) RMW instructions (CAS/CAS2)
4) Coprocessor instructions
5) BCD instructions
The 64 bit MUL and DIV variants are explicitly listed in the instruction set.
The CPU32 is also missing some (but not all) of the addressing modes which were added with the 68020.
I haven't worked with any of these chips in a long time, but the CPU32 is quite a bit newer and more complicated than a 68000 or 68010. I did a project based on a 68332 about 15 years ago and still have all the printed reference manuals for that particular chip.
Brad Boyer
[email protected]
Hi Luis,
Quoted 5 lines · Luis Alves
This is the first of a pack of patches to support the original 68000 cpu. This adds:
-MC68000 cpu as a choice in the config menu.
-Alcetronics M68K board (uses this cpu).
Quoted 7 lines
What I have changed:
-CONFIG_M68000 was being used by 68328 CPUs.
Renamed toCONFIG_M68XXX. Now the 68000 and all CPU32 CPUs use this flag for common configurations.
-Modified all 68[VZ|EZ]328 to selectCONFIG_MCPU32
-ModifiedCONFIG_MCPU32to selectCONFIG_M68XXX.
-ModifiedCONFIG_M68360to selectCONFIG_M68XXX(I think it was missing some settings). -Modified some files to useCONFIG_M68XXXinstead of CONFIG_M68000/CONFIG_MCPU32
Thinking on this a little more, you probably don't want most of these changes. Certainly as Brad points out CPU32 and 68000 are quite different, and they need to remain as separate config options.
I can see you will end up with a arch/m68k/platform/68000 with some new code. Is any of that common with what is currently in arch/m68k/platform/68328? I would expect we want to move the common 68000 code into that platform/68000 directory. Longer term we may want to do away with 68328/68EZ328/68VZ328 directories all together. All the code may go in a platform/68000. (Still thinking this one over though, but I am planning on doing away with the separate 5xxx ColdFire directories real soon now).
Regards
Greg
Quoted 216 lines
--- arch/m68k/Kconfig.cpu | 29 ++++++++++++++++++----------- arch/m68k/Kconfig.machine | 6 ++++++ arch/m68k/Makefile | 9 ++++++--- arch/m68k/include/asm/bitops.h | 2 +- arch/m68k/include/asm/delay.h | 2 +- arch/m68k/lib/memcpy.c | 4 ++-- arch/m68k/lib/memset.c | 2 +- arch/m68k/lib/muldi3.c | 2 +- 8 files changed, 36 insertions(+), 20 deletions(-)arch/m68k/Kconfig.cpu +18
-11@@ -32,26 +32,33 @@ endchoice if M68KCLASSIC -config M68000 + +config M68XXX bool select CPU_HAS_NO_BITFIELDS select CPU_HAS_NO_MULDIV64 select GENERIC_CSUM help - The Freescale (was Motorola) 68000 CPU is the first generation of - the well known M68K family of processors. The CPU core as well as - being available as a stand alone CPU was also used in many - System-On-Chip devices (eg 68328, 68302, etc). It does not contain - a paging MMU. + Common features for the first generation of M68K CPUs. It + includes the original MC68000 and CPU32 core. + config MCPU32 bool - select CPU_HAS_NO_BITFIELDS + select M68XXX help The Freescale (was then Motorola) CPU32 is a CPU core that is based on the 68020 processor. For the most part it is used in System-On-Chip parts, and does not contain a paging MMU. +config M68000 + bool "MC68000" + select M68XXX + help + The Freescale (was Motorola) 68000 CPU is the first generation of + the well known M68K family of processors. It does not contain + a paging MMU. + config M68020 bool "68020 support" depends on MMU@@ -96,28 +103,28 @@ config M68060 config M68328 bool "MC68328" depends on !MMU - select M68000 + select MCPU32 help Motorola 68328 processor support. config M68EZ328 bool "MC68EZ328" depends on !MMU - select M68000 + select MCPU32 help Motorola 68EX328 processor support. config M68VZ328 bool "MC68VZ328" depends on !MMU - select M68000 + select MCPU32 help Motorola 68VZ328 processor support. config M68360 bool "MC68360" depends on !MMU - select MCPU32 + select M68XXX help Motorola 68360 processor support.arch/m68k/Kconfig.machine +6
-0@@ -134,6 +134,12 @@ config SUN3 endif # M68KCLASSIC +config ALCE68K + bool "Alcetronics M68K board support" + depends on M68000 + help + Support for the Alcetronics M68K board. + config PILOT boolarch/m68k/Makefile +6
-3@@ -32,8 +32,9 @@ cpuflags-$(CONFIG_M68040) := -m68040 endif cpuflags-$(CONFIG_M68030) := cpuflags-$(CONFIG_M68020) := -cpuflags-$(CONFIG_M68360) := -m68332 cpuflags-$(CONFIG_M68000) := -m68000 +cpuflags-$(CONFIG_MCPU32) := -m68000 +cpuflags-$(CONFIG_M68360) := -m68332 cpuflags-$(CONFIG_M54xx) := $(call cc-option,-mcpu=5475,-m5200) cpuflags-$(CONFIG_M5407) := $(call cc-option,-mcpu=5407,-m5200) cpuflags-$(CONFIG_M532x) := $(call cc-option,-mcpu=532x,-m5307)@@ -88,8 +89,9 @@ endif # head-y := arch/m68k/kernel/head.o head-$(CONFIG_SUN3) := arch/m68k/kernel/sun3-head.o +head-$(CONFIG_M68000) := arch/m68k/platform/68000/head.o head-$(CONFIG_M68360) := arch/m68k/platform/68360/head.o -head-$(CONFIG_M68000) := arch/m68k/platform/68328/head.o +head-$(CONFIG_MCPU32) := arch/m68k/platform/68328/head.o head-$(CONFIG_COLDFIRE) := arch/m68k/platform/coldfire/head.o core-y += arch/m68k/kernel/ arch/m68k/mm/@@ -111,7 +113,8 @@ core-$(CONFIG_M68040) += arch/m68k/fpsp040/ core-$(CONFIG_M68060) += arch/m68k/ifpsp060/ core-$(CONFIG_M68KFPU_EMU) += arch/m68k/math-emu/ core-$(CONFIG_M68360) += arch/m68k/platform/68360/ -core-$(CONFIG_M68000) += arch/m68k/platform/68328/ +core-$(CONFIG_M68000) += arch/m68k/platform/68000/ +core-$(CONFIG_MCPU32) += arch/m68k/platform/68328/ core-$(CONFIG_M68EZ328) += arch/m68k/platform/68EZ328/ core-$(CONFIG_M68VZ328) += arch/m68k/platform/68VZ328/ core-$(CONFIG_COLDFIRE) += arch/m68k/platform/coldfire/arch/m68k/include/asm/bitops.h +1
-1@@ -457,7 +457,7 @@ static inline unsigned long ffz(unsigned long word)* generic functions for those. */ #if (defined(__mcfisaaplus__) || defined(__mcfisac__))&& \ - !defined(CONFIG_M68000 )&& !defined(CONFIG_MCPU32 ) + !defined(CONFIG_M68XXX )static inline int __ffs (int x) { __asm__ __volatile__ ("bitrev %0; ff1 %0"arch/m68k/include/asm/delay.h +1
-1@@ -43,7 +43,7 @@ static inline void __delay(unsigned long loops)extern void __bad_udelay (void ); -#if defined(CONFIG_M68000 ) || defined(CONFIG_COLDFIRE ) +#if defined(CONFIG_M68XXX ) || defined(CONFIG_COLDFIRE )/* * The simpler m68k and ColdFire processors do not have a 32*32->64 * multiply instruction. So we need to handle them a little differently. arch/m68k/lib/memcpy.c +2
-2@@ -22,7 +22,7 @@ void *memcpy(void *to, const void *from, size_t n) from = cfrom; n--; } -#if defined(CONFIG_M68000 ) +#if defined(CONFIG_M68XXX )if ((long )from&1 ) {char *cto = to;const char *cfrom = from;@@ -43,7 +43,7 @@ void *memcpy(void *to, const void *from, size_t n)if (temp) {long *lto = to;const long *lfrom = from; -#if defined(CONFIG_M68000 ) || defined(CONFIG_COLDFIRE ) +#if defined(CONFIG_M68XXX ) || defined(CONFIG_COLDFIRE )for (; temp; temp--) *lto++ = *lfrom++;#else arch/m68k/lib/memset.c +1
-1@@ -32,7 +32,7 @@ void *memset(void *s, int c, size_t count) temp = count>>2 ;if (temp) {long *ls = s; -#if defined(CONFIG_M68000 ) || defined(CONFIG_COLDFIRE ) +#if defined(CONFIG_M68XXX ) || defined(CONFIG_COLDFIRE )for (; temp; temp--) *ls++ = c;#else arch/m68k/lib/muldi3.c +1
-1@@ -19,7 +19,7 @@ along with GNU CC; see the file COPYING. If not, write tothe Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#if defined(CONFIG_M68000 ) || defined(CONFIG_COLDFIRE ) +#if defined(CONFIG_M68XXX ) || defined(CONFIG_COLDFIRE )#define SI_TYPE_SIZE 32#define __BITS4 (SI_TYPE_SIZE / 4)
Signature · 5 lines
------------------------------------------------------------------------ Greg Ungerer -- Principal Engineer EMAIL: [email protected] SnapGear Group, McAfee PHONE: +61 7 3435 2888 8 Gardner Close, FAX: +61 7 3891 3630 Milton, QLD, 4064, Australia WEB: http://www.SnapGear.com
Hi all,
Thanks for the comments, answering below:
Greg:
Quoted 2 lines
The
CONFIG_CPU32designator is not correct for 68x328 parts, they do not have a CPU32 core. They are standard 68000 cores internally.
That's true! I thought they had a CPU32 core like the 68360 and all 683xx parts. (And even if they had, the config would be wrong since CPU32 supports divul)
Quoted 4 lines
Although there was no true 68000 part supported before the intention of the
CONFIG_M68000define was for that CPU - or any SoC type part that contained a true 68000 CPU core. And it would be good to keep that naming so it is consistent with the other 680x0 cores.
It makes a lot more sense now. I'll change the files and submit a new patch.
Geert:
Quoted 1 line
But the actual
arch/m68k/platform/68000/part is missing?
Yes, I'll send it in the next patch. I already have a fully working kernel for my board, but since the 68000 doesn't have any on-chip peripherals the config will be a lot 'board-dependent' I'm figuring out a way to organize the files.
I could use some suggestions in here.
Should I use:
1) Single common files with "#ifdef CONFIG_<board>" conditionals
2) Common config in arch/m68k/platform/68000/ and board specific config in arch/m68k/platform/68000/<boardname>/
3) Other suggestion...
At the moment I'm using option 1) since I suspect there won't be many boards using
the old 68000 (although I already have some guys asking for code).
Quoted 2 lines
"
CONFIG_M68XXX||CONFIG_COLDFIRE" makes me think "Isn't this always true?"...
Well, It is for non-mmu parts (or coldfire with mmu) but not for 68020 and up.
Brad:
Quoted 12 lines
I believe this misrepresents the CPU32 feature set. According to the old paper copy I have of the Motorola CPU32 reference manual, the only unimplemented instructions relative to the 68020 are these:
1) Bit field instructions
2) Module call/return
3) RMW instructions (CAS/CAS2)
4) Coprocessor instructions
5) BCD instructionsThe 64 bit MUL and DIV variants are explicitly listed in the instruction set.
Quoted 7 lines
The CPU32 is also missing some (but not all) of the addressing modes which were added with the 68020.
I haven't worked with any of these chips in a long time, but the CPU32 is quite a bit newer and more complicated than a 68000 or 68010. I did a project based on a 68332 about 15 years ago and still have all the printed reference manuals for that particular chip.
Thanks for the detailed description.
Just like I answered to Greg, I didn't have a clear view of the differences.
Please ignore this patch. I'll make the changes according to what was discussed in here and submit a new one.
Thanks,
Luis Alves
_______________________________________________
uClinux-dev mailing list [email protected]
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by [email protected] To unsubscribe see:
http://mailman.uclinux.org/mailman/options/uclinux-dev
Quoted 26 lines · Greg Ungerer
Hi Luis,
Quoted 6 lines · Luis Alves
This is the first of a pack of patches to support the original 68000 cpu. This adds:
-MC68000 cpu as a choice in the config menu.
-Alcetronics M68K board (uses this cpu).Quoted 10 lines
What I have changed:
-CONFIG_M68000 was being used by 68328 CPUs.
Renamed toCONFIG_M68XXX. Now the 68000 and all CPU32 CPUs use this flag for common configurations.
-Modified all 68[VZ|EZ]328 to selectCONFIG_MCPU32
-ModifiedCONFIG_MCPU32to selectCONFIG_M68XXX.
-ModifiedCONFIG_M68360to selectCONFIG_M68XXX(I think it was missing some settings).
-Modified some files to useCONFIG_M68XXXinstead of CONFIG_M68000/CONFIG_MCPU32Thinking on this a little more, you probably don't want most of these changes. Certainly as Brad points out CPU32 and 68000 are quite different, and they need to remain as separate config options.
Quoted 9 lines
I can see you will end up with a
arch/m68k/platform/68000with some new code. Is any of that common with what is currently inarch/m68k/platform/68328? I would expect we want to move the common 68000 code into that platform/68000 directory. Longer term we may want to do away with 68328/68EZ328/68VZ328 directories all together. All the code may go in a platform/68000. (Still thinking this one over though, but I am planning on doing away with the separate 5xxx ColdFire directories real soon now).
I think this is a good idea. Do you suggest putting all together in the same file and use #ifdef's for cpu specific options? I could do that.
Also, how to deal with board specific configuration files?
As I referred in the previous mail, the 68000 has zero on-chip peripherals so the initial setup and configuration is a lot 'board-dependent'.
Regards,
Luis
Quoted 243 lines
Regards
GregQuoted 225 lines
---
arch/m68k/Kconfig.cpu | 29 ++++++++++++++++++-----------arch/m68k/Kconfig.machine| 6 ++++++arch/m68k/Makefile| 9 ++++++---arch/m68k/include/asm/bitops.h| 2 +-arch/m68k/include/asm/delay.h| 2 +-arch/m68k/lib/memcpy.c | 4 ++-- arch/m68k/lib/memset.c | 2 +- arch/m68k/lib/muldi3.c | 2 +- 8 files changed, 36 insertions(+), 20 deletions(-)arch/m68k/Kconfig.cpu +0
-0@@ -32,26 +32,33 @@ endchoiceif M68KCLASSIC
arch/m68k/Kconfig.cpu +2
-1-config M68000 + +config M68XXXbool
selectCPU_HAS_NO_BITFIELDS
selectCPU_HAS_NO_MULDIV64
selectGENERIC_CSUM
help
- The Freescale (was Motorola) 68000 CPU is the first generation of
- the well known M68K family of processors. The CPU core as well as
- being available as a stand alone CPU was also used in many
- System-On-Chip devices (eg 68328, 68302, etc). It does not contain
- a paging MMU.
+ Common features for the first generation of M68K CPUs. It
+ includes the original MC68000 and CPU32 core.
+config MCPU32
bool
- selectCPU_HAS_NO_BITFIELDS
+ select M68XXX
help
The Freescale (was then Motorola) CPU32 is a CPU core that is based on the 68020 processor. For the most part it is used in System-On-Chip parts, and does not contain a paging MMU.+config M68000
+ bool "MC68000"
+ select M68XXX
+ help
+ The Freescale (was Motorola) 68000 CPU is the first generation of
+ the well known M68K family of processors. It does not contain
+ a paging MMU.
+
config M68020
bool "68020 support"
depends on MMUarch/m68k/Kconfig.cpu +0
-0@@ -96,28 +103,28 @@ config M68060config M68328
bool "MC68328"
depends on !MMU
- select M68000
+ select MCPU32
help
Motorola 68328 processor support.config M68EZ328
bool "MC68EZ328"
depends on !MMU
- select M68000
+ select MCPU32
help
Motorola 68EX328 processor support.config M68VZ328
bool "MC68VZ328"
depends on !MMU
- select M68000
+ select MCPU32
help
Motorola 68VZ328 processor support.config M68360
bool "MC68360"
depends on !MMU
- select MCPU32
+ select M68XXX
help
Motorola 68360 processor support.arch/m68k/Kconfig.machine +0
-0@@ -134,6 +134,12 @@ config SUN3endif # M68KCLASSIC
arch/m68k/Kconfig.machine +6
-0+config ALCE68K + bool "Alcetronics M68K board support" + depends on M68000 + help + Support for the Alcetronics M68K board. +config PILOT
boolarch/m68k/Makefile +0
-0@@ -32,8 +32,9 @@ cpuflags-$(CONFIG_M68040) := -m68040endif
cpuflags-$(CONFIG_M68030) :=
cpuflags-$(CONFIG_M68020) :=
-cpuflags-$(CONFIG_M68360) := -m68332
cpuflags-$(CONFIG_M68000) := -m68000arch/m68k/Makefile +2
-0+cpuflags-$(CONFIG_MCPU32) := -m68000 +cpuflags-$(CONFIG_M68360) := -m68332cpuflags-$(CONFIG_M54xx) := $(call cc-option,-mcpu=5475,-m5200) cpuflags-$(CONFIG_M5407) := $(call cc-option,-mcpu=5407,-m5200) cpuflags-$(CONFIG_M532x) := $(call cc-option,-mcpu=532x,-m5307)
arch/m68k/Makefile +0
-0@@ -88,8 +89,9 @@ endif #head-y :=
arch/m68k/kernel/head.ohead-$(CONFIG_SUN3) :=arch/m68k/kernel/sun3-head.o+head-$(CONFIG_M68000) :=arch/m68k/platform/68000/head.ohead-$(CONFIG_M68360) :=arch/m68k/platform/68360/head.oarch/m68k/Makefile +1
-1-head-$(CONFIG_M68000) := arch/m68k/platform/68328/head.o +head-$(CONFIG_MCPU32) := arch/m68k/platform/68328/head.ohead-$(CONFIG_COLDFIRE) :=
arch/m68k/platform/coldfire/head.ocore-y +=
arch/m68k/kernel/arch/m68k/mm/arch/m68k/Makefile +0
-0@@ -111,7 +113,8 @@ core-$(CONFIG_M68040) +=
arch/m68k/fpsp040/
core-$(CONFIG_M68060) +=arch/m68k/ifpsp060/core-$(CONFIG_M68KFPU_EMU) +=arch/m68k/math-emu/core-$(CONFIG_M68360) +=arch/m68k/platform/68360/arch/m68k/Makefile +2
-1-core-$(CONFIG_M68000) += arch/m68k/platform/68328/ +core-$(CONFIG_M68000) += arch/m68k/platform/68000/ +core-$(CONFIG_MCPU32) += arch/m68k/platform/68328/core-$(CONFIG_M68EZ328) +=
arch/m68k/platform/68EZ328/core-$(CONFIG_M68VZ328) +=arch/m68k/platform/68VZ328/core-$(CONFIG_COLDFIRE) +=arch/m68k/platform/coldfire/arch/m68k/include/asm/bitops.h +1
-1@@ -457,7 +457,7 @@ static inline unsigned long ffz(unsigned long word)* generic functions for those. */ #if (defined(__mcfisaaplus__) || defined(__mcfisac__))&& \ - !defined(CONFIG_M68000)&& !defined(CONFIG_MCPU32) + !defined(CONFIG_M68XXX) static inline int __ffs(int x) {__asm__
__volatile__("bitrev %0; ff1 %0"arch/m68k/include/asm/delay.h +1
-1@@ -43,7 +43,7 @@ static inline void __delay(unsigned long loops) extern void __bad_udelay(void); -#if defined(CONFIG_M68000 ) || defined(CONFIG_COLDFIRE ) +#if defined(CONFIG_M68XXX ) || defined(CONFIG_COLDFIRE ) /** The simpler m68k and ColdFire processors do not have a 32*32->64 * multiply instruction. So we need to handle them a little differently. arch/m68k/lib/memcpy.c +1
-1@@ -22,7 +22,7 @@ void *memcpy(void *to, const void *from, size_t n) from = cfrom; n--; } -#if defined(CONFIG_M68000 ) +#if defined(CONFIG_M68XXX ) if ((long)from& 1) { char *cto = to;const char *cfrom = from;
arch/m68k/lib/memcpy.c +1
-1@@ -43,7 +43,7 @@ void *memcpy(void *to, const void *from, size_t n) if (temp) { long *lto = to; const long *lfrom = from; -#if defined(CONFIG_M68000 ) || defined(CONFIG_COLDFIRE ) +#if defined(CONFIG_M68XXX ) || defined(CONFIG_COLDFIRE ) for (; temp; temp--) *lto++ = *lfrom++; #elsearch/m68k/lib/memset.c +1
-1@@ -32,7 +32,7 @@ void *memset(void *s, int c, size_t count) temp = count>> 2; if (temp) { long *ls = s; -#if defined(CONFIG_M68000 ) || defined(CONFIG_COLDFIRE ) +#if defined(CONFIG_M68XXX ) || defined(CONFIG_COLDFIRE ) for (; temp; temp--) *ls++ = c; #elsearch/m68k/lib/muldi3.c +0
-0@@ -19,7 +19,7 @@ along with GNU CC; see the file COPYING. If not, writeto
the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */arch/m68k/lib/muldi3.c +1
-1-#if defined(CONFIG_M68000 ) || defined(CONFIG_COLDFIRE ) +#if defined(CONFIG_M68XXX ) || defined(CONFIG_COLDFIRE )Quoted 2 lines
#define
SI_TYPE_SIZE32
#define__BITS4(SI_TYPE_SIZE/ 4)--
------------------------------------------------------------------------
Greg Ungerer -- Principal Engineer EMAIL: [email protected] SnapGear Group, McAfee PHONE: +61 7 3435 2888 8 Gardner Close, FAX: +61 7 3891 3630Milton, QLD, 4064, Australia WEB: http://www.SnapGear.com
Hi Luis,
Quoted 33 lines · Luis Alves
Quoted 22 lines · Greg Ungerer
Quoted 5 lines · Luis Alves
This is the first of a pack of patches to support the original 68000 cpu. This adds:
á-MC68000 cpu as a choice in the config menu.
á-Alcetronics M68K board (uses this cpu).Quoted 10 lines
What I have changed:
á-CONFIG_M68000 was being used by 68328 CPUs.
á Renamed toCONFIG_M68XXX. Now the 68000 and all CPU32 CPUs use this flag for common configurations.
á-Modified all 68[VZ|EZ]328 to selectCONFIG_MCPU32á-ModifiedCONFIG_MCPU32to selectCONFIG_M68XXX.
á-ModifiedCONFIG_M68360to selectCONFIG_M68XXX(I think it was missing some settings).
á-Modified some files to useCONFIG_M68XXXinstead of CONFIG_M68000/CONFIG_MCPU32Thinking on this a little more, you probably don't want most of these changes. Certainly as Brad points out CPU32 and 68000 are quite different, and they need to remain as separate config options.
Quoted 9 lines
I can see you will end up with a
arch/m68k/platform/68000with some new code. Is any of that common with what is currently inarch/m68k/platform/68328? áI would expect we want to move the common 68000 code into that platform/68000 directory. Longer term we may want to do away with 68328/68EZ328/68VZ328 directories all together. All the code may go in a platform/68000. (Still thinking this one over though, but I am planning on doing away with the separate 5xxx ColdFire directories real soon now).
Quoted 2 lines
I think this is a good idea. Do you suggest putting all together in the same file and use #ifdef's for cpu specific options? I could do that.
That may or may not make sense, we need to think about each case. Hopefully we can keep common code together with minimal additional #ifdefs. And put board (or on/off chip peripherals) in there own files.
Quoted 3 lines
Also, how to deal with board specific configuration files?
As I referred in the previous mail, the 68000 has zero on-chip peripherals so the initial setup and configuration is a lot 'board-dependent'.
Yep. The best case is if you have specific configuration files separate, and built based on their appropriate defines in the Makefile. (See examples in arch/m68k/platform/coldfire/Makefile).
To start I would just put them all in the common 68000 sub-directory. If the need arises we can start putting machine specific sub-directories later (which is what we have at the top arch level, arch/m68k/). For quite a few years we had machine specific directories under platform/coldfire. But I gave up on it eventually - there was just so much duplicated code it didn't seem to make any sense.
Regards
Greg
------------------------------------------------------------------------
Greg Ungerer -- Principal Engineer EMAIL: [email protected] SnapGear Group, McAfee PHONE: +61 7 3435 2888 8 Gardner Close, FAX: +61 7 3891 3630 Milton, QLD, 4064, Australia WEB: http://www.SnapGear.com