Re: [uClinux-dev] [PATCH 1/1] Changes for 68000 code integration.

2012-04-28 Thread Greg Ungerer

Hi Luis,

On 04/28/2012 12:30 AM, Luis Alves wrote:

On Fri, Apr 27, 2012 at 3:06 PM, Greg Ungererg...@snapgear.com  wrote:

On 04/27/2012 09:08 AM, Luis Alves wrote:

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



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).



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.



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 EngineerEMAIL: g...@snapgear.com
SnapGear Group, McAfee  PHONE:   +61 7 3435 2888
8 Gardner Close,FAX: +61 7 3891 3630
Milton, QLD, 4064, AustraliaWEB: http://www.SnapGear.com
___
uClinux-dev mailing list
uClinux-dev@uclinux.org
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by uclinux-dev@uclinux.org
To unsubscribe see:
http://mailman.uclinux.org/mailman/options/uclinux-dev


Re: [uClinux-dev] [PATCH 1/1] Changes for 68000 code integration.

2012-04-27 Thread Greg Ungerer

Hi Luis,

On 27/04/12 09:08, Luis Alves wrote:

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!



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


The CONFIG_CPU32 designator is not correct for 68x328 parts, they
do not have a CPU32 core. They are standard 68000 cores internally.


  -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


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



---
  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(-)

diff --git a/arch/m68k/Kconfig.cpu b/arch/m68k/Kconfig.cpu
index 8a9c767..2abac0f 100644
--- a/arch/m68k/Kconfig.cpu
+++ b/arch/m68k/Kconfig.cpu
@@ -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.

diff --git a/arch/m68k/Kconfig.machine b/arch/m68k/Kconfig.machine
index 7cdf6b0..25ce143 100644
--- a/arch/m68k/Kconfig.machine
+++ b/arch/m68k/Kconfig.machine
@@ -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

diff --git a/arch/m68k/Makefile b/arch/m68k/Makefile
index cf318f2..d1d7343 100644
--- a/arch/m68k/Makefile
+++ b/arch/m68k/Makefile
@@ -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) := 

Re: [uClinux-dev] [PATCH 1/1] Changes for 68000 code integration.

2012-04-27 Thread Brad Boyer
On Fri, Apr 27, 2012 at 12:08:37AM +0100, Luis Alves wrote:
 diff --git a/arch/m68k/Kconfig.cpu b/arch/m68k/Kconfig.cpu
 index 8a9c767..2abac0f 100644
 --- a/arch/m68k/Kconfig.cpu
 +++ b/arch/m68k/Kconfig.cpu
 @@ -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.

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
f...@allandria.com

___
uClinux-dev mailing list
uClinux-dev@uclinux.org
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by uclinux-dev@uclinux.org
To unsubscribe see:
http://mailman.uclinux.org/mailman/options/uclinux-dev


Re: [uClinux-dev] [PATCH 1/1] Changes for 68000 code integration.

2012-04-27 Thread Greg Ungerer

Hi Luis,

On 04/27/2012 09:08 AM, Luis Alves wrote:

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


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





---
  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(-)

diff --git a/arch/m68k/Kconfig.cpu b/arch/m68k/Kconfig.cpu
index 8a9c767..2abac0f 100644
--- a/arch/m68k/Kconfig.cpu
+++ b/arch/m68k/Kconfig.cpu
@@ -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.

diff --git a/arch/m68k/Kconfig.machine b/arch/m68k/Kconfig.machine
index 7cdf6b0..25ce143 100644
--- a/arch/m68k/Kconfig.machine
+++ b/arch/m68k/Kconfig.machine
@@ -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

diff --git a/arch/m68k/Makefile b/arch/m68k/Makefile
index cf318f2..d1d7343 100644
--- a/arch/m68k/Makefile
+++ b/arch/m68k/Makefile
@@ -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 

Re: [uClinux-dev] [PATCH 1/1] Changes for 68000 code integration.

2012-04-27 Thread Luis Alves
Hi all,

Thanks for the comments, answering below:


Greg:
 The CONFIG_CPU32 designator 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)


 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.

It makes a lot more sense now. I'll change the files and submit a new patch.



Geert:
 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).

 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:
 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.

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
uClinux-dev@uclinux.org
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by uclinux-dev@uclinux.org
To unsubscribe see:
http://mailman.uclinux.org/mailman/options/uclinux-dev