Re: [uClinux-dev] [PATCH 4/8] m68knommu: clean up ColdFire CACHE control code

2010-11-11 Thread Greg Ungerer


Hi Philippe,

On 11/11/10 19:01, Philippe De Muyter wrote:

Hi Greg,

On Thu, Nov 11, 2010 at 11:48:42AM +1000, Greg Ungerer wrote:
...

+#ifdef CONFIG_COLDFIRE_SW_A7
+#define CACHE_INIT (CACR_CINV + CACR_DISD)
+#define CACHE_MODE (CACR_CENB + CACR_DISD + CACR_DCM)
+#else
+#define CACHE_INIT (CACR_CINV + CACR_DISD + CACR_EUSP)
+#define CACHE_MODE (CACR_CENB + CACR_DISD + CACR_DCM + CACR_EUSP)
+#endif


Wouldn't that be more maintainable as :

#ifdef CONFIG_COLDFIRE_SW_A7
#define USERA7_MODE 0
#else
#define USERA7_MODE CACR_EUSP
#endif

#define CACHE_INIT  (CACR_CINV + CACR_DISD + USERA7_MODE)
#define CACHE_MODE  (CACR_CENB + CACR_DISD + CACR_DCM + USERA7_MODE)


Possibly, yes. Interestingly the above changes again in patch 8,
where the parts that support a split cache is the same parts that
support the eusp. Based on the above idea I think I can clean that
up a little to only have a single definition of CACHE_INIT and
CACHE_MODE. Let me rework that and resend that patch.

Thanks
Greg



Greg Ungerer  --  Principal EngineerEMAIL: g...@snapgear.com
SnapGear Group, McAfee  PHONE:   +61 7 3435 2888
8 Gardner Close FAX: +61 7 3217 5323
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 4/8] m68knommu: clean up ColdFire CACHE control code

2010-11-11 Thread Greg Ungerer

On 11/11/10 18:43, Philippe De Muyter wrote:

On Thu, Nov 11, 2010 at 11:48:42AM +1000, Greg Ungerer wrote:


+   : : "i" (CACHE_INVALID) : "d0" );
+#endif

...

+
+#define CACHE_INVALID  (CACHE_MODE + CACR_CINV)
+


As 'invalid' is a real english word, I feel it is unfortunate to use it
to abbreviate 'invalidate'.

Could you rather call that CACHE_INVALIDATE ?


Thats a fair call. I like to keep names short :-)
I will change it to CACHE_INVALIDATE.

Thanks
Greg



Greg Ungerer  --  Principal EngineerEMAIL: g...@snapgear.com
SnapGear Group, McAfee  PHONE:   +61 7 3435 2888
8 Gardner Close FAX: +61 7 3217 5323
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 7/8] m68knommu: support ColdFire caches that do copyback and write-thru

2010-11-11 Thread Greg Ungerer


Hi Philippe,

On 11/11/10 19:14, Philippe De Muyter wrote:

Hi Greg,

On Thu, Nov 11, 2010 at 11:48:53AM +1000, Greg Ungerer wrote:

[PATCH 7/8] m68knommu: support ColdFire caches that do copyback and write-thru

The version 3 and version 4 ColdFire cache controllers support both
write-through and copy-back modes on the data cache. Allow for Kconfig
time configuration of this, and set the cache mode appropriately.

Signed-off-by: Greg Ungerer

...


  config M5407
bool "MCF5407"
select COLDFIRE_SW_A7
+   select HAVE_CACHE_CB
help
  Motorola ColdFire 5407 processor support.

  config M547x
bool "MCF547x"
+   select HAVE_CACHE_CB
help
  Freescale ColdFire 5470/5471/5472/5473/5474/5475 processor support.

@@ -279,7 +286,23 @@ config CACHE_BOTH
  Split the ColdFire CPU cache, and use half as an instruction cache


Didn't you forget the M548x here ?


Oops, yes, certainly did. I'll fix that.

Thanks
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 7/8] m68knommu: support ColdFire caches that do copyback and write-thru

2010-11-11 Thread Philippe De Muyter
Hi Greg,

On Thu, Nov 11, 2010 at 11:48:53AM +1000, Greg Ungerer wrote:
> [PATCH 7/8] m68knommu: support ColdFire caches that do copyback and write-thru
> 
> The version 3 and version 4 ColdFire cache controllers support both
> write-through and copy-back modes on the data cache. Allow for Kconfig
> time configuration of this, and set the cache mode appropriately.
> 
> Signed-off-by: Greg Ungerer 
...
>  
>  config M5407
>   bool "MCF5407"
>   select COLDFIRE_SW_A7
> + select HAVE_CACHE_CB
>   help
> Motorola ColdFire 5407 processor support.
>  
>  config M547x
>   bool "MCF547x"
> + select HAVE_CACHE_CB
>   help
> Freescale ColdFire 5470/5471/5472/5473/5474/5475 processor support.
>  
> @@ -279,7 +286,23 @@ config CACHE_BOTH
> Split the ColdFire CPU cache, and use half as an instruction cache

Didn't you forget the M548x here ?

Philippe
___
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 4/8] m68knommu: clean up ColdFire CACHE control code

2010-11-11 Thread Philippe De Muyter
Hi Greg,

On Thu, Nov 11, 2010 at 11:48:42AM +1000, Greg Ungerer wrote:
...
> +#ifdef CONFIG_COLDFIRE_SW_A7
> +#define CACHE_INIT   (CACR_CINV + CACR_DISD)
> +#define CACHE_MODE   (CACR_CENB + CACR_DISD + CACR_DCM)
> +#else
> +#define CACHE_INIT   (CACR_CINV + CACR_DISD + CACR_EUSP)
> +#define CACHE_MODE   (CACR_CENB + CACR_DISD + CACR_DCM + CACR_EUSP)
> +#endif

Wouldn't that be more maintainable as :

#ifdef CONFIG_COLDFIRE_SW_A7
#define USERA7_MODE 0
#else
#define USERA7_MODE CACR_EUSP
#endif

#define CACHE_INIT  (CACR_CINV + CACR_DISD + USERA7_MODE)
#define CACHE_MODE  (CACR_CENB + CACR_DISD + CACR_DCM + USERA7_MODE)

Philippe
___
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 4/8] m68knommu: clean up ColdFire CACHE control code

2010-11-11 Thread Philippe De Muyter
On Thu, Nov 11, 2010 at 11:48:42AM +1000, Greg Ungerer wrote:

> + : : "i" (CACHE_INVALID) : "d0" );
> +#endif
...
> +
> +#define CACHE_INVALID(CACHE_MODE + CACR_CINV)
> +

As 'invalid' is a real english word, I feel it is unfortunate to use it
to abbreviate 'invalidate'.

Could you rather call that CACHE_INVALIDATE ?

Philippe
___
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