Re: [U-Boot] [PATCH v4 0/9] armv7: cache maintenance operations

2011-06-27 Thread Albert ARIBAUD
Le 17/06/2011 11:30, Aneesh V a écrit :
> With D-cache and MMU enabled for ARM in u-boot it becomes imperative to
> support a minimal set of cache maintenance operations and necessary
> initializations before enabling MMU.
>
> This series of patches attempt to do the following for armv7:
> * Necessary initialization sequence before enabling MMU that includes
>invalidation of TLB, data caches, branch predictor array etc.
> * Framework for supporting SOC specific outer caches in a generic manner
>(using a structure of function pointers - inspired by the Linux
>implementation)
> * Generic armv7 cache maintenance operations for caches known to the CPU
> * Support for ARM PL310 L2 cache controller used in OMAP4
> * Cleanup of the cleanup_before_linux() function
> * Adapting all armv7 SOCs to use the new framework and removing
>duplicated code
>
> Testing:
> * Extensive testing on OMAP4430SDP and OMAP3430SDP by creating coherency
>issues and solving them using the maintenance routines
>   - Eg: memfill a region of memory with a known pattern
>   - Invalidate the region
>   - Read back and compare the region with the original pattern
>   - If match fails it means that invalidate is successful
>   - Now add a flush call just before the invalidate
>   - If match succeeds it means that flush was successful
>   - Outer caches were tested with experiments involving making the
> function pointers NULL
> * Kernel booting on OMAP4430SDP and OMAP3430SDP
> Note: v2 has been tested only on OMAP4430SDP
>
> V2:
> * Pointer based callback mechanism for outer cache operations
>changed to a weakly linked functions.
> * Change -march=armv7-a back to armv5
> * Moved utility macros out of armv7.h
> * Added documentation for new CONFIG options.
> * Changed implementation of log2n to not use CLZ instruction as armv4
>doesn't support this instruction and newly added Tegra2 uses
>-march=armv4
> * Blank line after local variable declarations - fixed globally
> * Explicitly added an empty flush_cache() under
>#ifdef CONFIG_SYS_NO_DCACHE
> * Removed the print inside the weakly linked stub function -
>__arm_init_before_mmu
> * Fixed signature of flush_cache in cache.c
> * More descriptive commit message for the PL310 support patch
> * C struct for PL310 register accesses
> * Fixed white space issues
>
> V3:
> * Rebased to latest HEAD of master
> * Added comments on changes done in V2 in individual patch headers. This
>was missing in V2
>
> V4:
> * Removed bit field manipulation macros
> * Renamed CONFIG_SYS_NO_*CACHE flags to CONFIG_SYS_*CACHE_OFF globally
>
> Aneesh V (9):
>arm: make default implementation of cache_flush() weakly linked
>armv7: cache maintenance operations for armv7
>armv7: rename cache related CONFIG flags
>armv7: integrate cache maintenance support
>arm: minor fixes for cache and mmu handling
>armv7: add PL310 support to u-boot
>armv7: adapt omap4 to the new cache maintenance framework
>armv7: adapt omap3 to the new cache maintenance framework
>armv7: adapt s5pc1xx to the new cache maintenance framework
>
>   README |   11 +
>   arch/arm/cpu/arm1136/start.S   |4 +-
>   arch/arm/cpu/armv7/Makefile|2 +-
>   arch/arm/cpu/armv7/cache_v7.c  |  394 
> 
>   arch/arm/cpu/armv7/cpu.c   |   50 +--
>   arch/arm/cpu/armv7/omap3/Makefile  |1 -
>   arch/arm/cpu/armv7/omap3/board.c   |  136 ++-
>   arch/arm/cpu/armv7/omap3/cache.S   |  263 -
>   arch/arm/cpu/armv7/omap3/lowlevel_init.S   |   32 ++
>   arch/arm/cpu/armv7/omap4/board.c   |   12 +
>   arch/arm/cpu/armv7/omap4/lowlevel_init.S   |9 +
>   arch/arm/cpu/armv7/s5pc1xx/cache.S |   88 +
>   arch/arm/cpu/armv7/start.S |   18 +-
>   arch/arm/include/asm/arch-omap3/omap3.h|   20 +
>   arch/arm/include/asm/arch-omap3/sys_proto.h|   10 +-
>   arch/arm/include/asm/arch-omap4/sys_proto.h|2 +-
>   arch/arm/include/asm/arch-s5pc1xx/sys_proto.h  |3 -
>   arch/arm/include/asm/armv7.h   |   67 
>   arch/arm/include/asm/global_data.h |2 +-
>   arch/arm/include/asm/pl310.h   |   73 
>   .../omap4/lowlevel_init.S =>  include/asm/utils.h}  |   51 ++-
>   arch/arm/lib/Makefile  |3 +-
>   arch/arm/lib/board.c   |8 +-
>   arch/arm/lib/cache-cp15.c  |   22 +-
>   arch/arm/lib/cache-pl310.c |  115 ++
>   arch/arm/lib/cache.c   |   20 +-
>   board/armltd/integrator/split_by_variant.sh|8 +-
>   common/cmd_bdinfo.c 

Re: [U-Boot] [PATCH v4 0/9] armv7: cache maintenance operations

2011-06-27 Thread Minkyu Kang
On 24 June 2011 04:24, Paulraj, Sandeep  wrote:
>
>
>>
>> Hi All,
>>
>> Le 17/06/2011 11:30, Aneesh V a écrit :
>> > With D-cache and MMU enabled for ARM in u-boot it becomes imperative to
>> > support a minimal set of cache maintenance operations and necessary
>> > initializations before enabling MMU.
>> >
>> > This series of patches attempt to do the following for armv7:
>> > * Necessary initialization sequence before enabling MMU that includes
>> >    invalidation of TLB, data caches, branch predictor array etc.
>> > * Framework for supporting SOC specific outer caches in a generic manner
>> >    (using a structure of function pointers - inspired by the Linux
>> >    implementation)
>> > * Generic armv7 cache maintenance operations for caches known to the CPU
>> > * Support for ARM PL310 L2 cache controller used in OMAP4
>> > * Cleanup of the cleanup_before_linux() function
>> > * Adapting all armv7 SOCs to use the new framework and removing
>> >    duplicated code
>>
>> Sandeep, Minkyu: is the patch series OK with you? If so I'll pull it all
>> in ARM and issue a last pull request.
>>
>> Amicalement,
>> --
>> Albert.
>
> I am fine with it.
>
> Acked-by: Sandeep Paulraj 

Acked-by: Minkyu Kang 

Thanks
Minkyu Kang
-- 
from. prom.
www.promsoft.net
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v4 0/9] armv7: cache maintenance operations

2011-06-23 Thread Paulraj, Sandeep


> 
> Hi All,
> 
> Le 17/06/2011 11:30, Aneesh V a écrit :
> > With D-cache and MMU enabled for ARM in u-boot it becomes imperative to
> > support a minimal set of cache maintenance operations and necessary
> > initializations before enabling MMU.
> >
> > This series of patches attempt to do the following for armv7:
> > * Necessary initialization sequence before enabling MMU that includes
> >invalidation of TLB, data caches, branch predictor array etc.
> > * Framework for supporting SOC specific outer caches in a generic manner
> >(using a structure of function pointers - inspired by the Linux
> >implementation)
> > * Generic armv7 cache maintenance operations for caches known to the CPU
> > * Support for ARM PL310 L2 cache controller used in OMAP4
> > * Cleanup of the cleanup_before_linux() function
> > * Adapting all armv7 SOCs to use the new framework and removing
> >duplicated code
> 
> Sandeep, Minkyu: is the patch series OK with you? If so I'll pull it all
> in ARM and issue a last pull request.
> 
> Amicalement,
> --
> Albert.

I am fine with it.

Acked-by: Sandeep Paulraj http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v4 0/9] armv7: cache maintenance operations

2011-06-22 Thread V, Aneesh
On Wed, Jun 22, 2011 at 11:11 PM, Albert ARIBAUD
 wrote:
> Hi All,
>
> Le 17/06/2011 11:30, Aneesh V a écrit :
>>
>> With D-cache and MMU enabled for ARM in u-boot it becomes imperative to
>> support a minimal set of cache maintenance operations and necessary
>> initializations before enabling MMU.
>>
>> This series of patches attempt to do the following for armv7:
>> * Necessary initialization sequence before enabling MMU that includes
>>   invalidation of TLB, data caches, branch predictor array etc.
>> * Framework for supporting SOC specific outer caches in a generic manner
>>   (using a structure of function pointers - inspired by the Linux
>>   implementation)
>> * Generic armv7 cache maintenance operations for caches known to the CPU
>> * Support for ARM PL310 L2 cache controller used in OMAP4
>> * Cleanup of the cleanup_before_linux() function
>> * Adapting all armv7 SOCs to use the new framework and removing
>>   duplicated code
>
> Sandeep, Minkyu: is the patch series OK with you? If so I'll pull it all in
> ARM and issue a last pull request.

Sandeep, Minkyu,

Would you please let me know if you have any concerns about this series.
If not, it will be good to see this going upstream this release. The
necessary initializations before enabling the cache are missing today.
Also, the absence of proper invalidate and flush functions will be missed
by any driver that uses DMA.

best regards,
Aneesh
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v4 0/9] armv7: cache maintenance operations

2011-06-22 Thread Albert ARIBAUD
Hi All,

Le 17/06/2011 11:30, Aneesh V a écrit :
> With D-cache and MMU enabled for ARM in u-boot it becomes imperative to
> support a minimal set of cache maintenance operations and necessary
> initializations before enabling MMU.
>
> This series of patches attempt to do the following for armv7:
> * Necessary initialization sequence before enabling MMU that includes
>invalidation of TLB, data caches, branch predictor array etc.
> * Framework for supporting SOC specific outer caches in a generic manner
>(using a structure of function pointers - inspired by the Linux
>implementation)
> * Generic armv7 cache maintenance operations for caches known to the CPU
> * Support for ARM PL310 L2 cache controller used in OMAP4
> * Cleanup of the cleanup_before_linux() function
> * Adapting all armv7 SOCs to use the new framework and removing
>duplicated code

Sandeep, Minkyu: is the patch series OK with you? If so I'll pull it all 
in ARM and issue a last pull request.

Amicalement,
-- 
Albert.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v4 0/9] armv7: cache maintenance operations

2011-06-17 Thread Aneesh V
With D-cache and MMU enabled for ARM in u-boot it becomes imperative to
support a minimal set of cache maintenance operations and necessary
initializations before enabling MMU.

This series of patches attempt to do the following for armv7:
* Necessary initialization sequence before enabling MMU that includes
  invalidation of TLB, data caches, branch predictor array etc.
* Framework for supporting SOC specific outer caches in a generic manner
  (using a structure of function pointers - inspired by the Linux
  implementation)
* Generic armv7 cache maintenance operations for caches known to the CPU
* Support for ARM PL310 L2 cache controller used in OMAP4
* Cleanup of the cleanup_before_linux() function
* Adapting all armv7 SOCs to use the new framework and removing
  duplicated code

Testing:
* Extensive testing on OMAP4430SDP and OMAP3430SDP by creating coherency
  issues and solving them using the maintenance routines
- Eg: memfill a region of memory with a known pattern
- Invalidate the region
- Read back and compare the region with the original pattern
- If match fails it means that invalidate is successful
- Now add a flush call just before the invalidate
- If match succeeds it means that flush was successful
- Outer caches were tested with experiments involving making the
  function pointers NULL
* Kernel booting on OMAP4430SDP and OMAP3430SDP
Note: v2 has been tested only on OMAP4430SDP

V2:
* Pointer based callback mechanism for outer cache operations
  changed to a weakly linked functions.
* Change -march=armv7-a back to armv5
* Moved utility macros out of armv7.h
* Added documentation for new CONFIG options.
* Changed implementation of log2n to not use CLZ instruction as armv4
  doesn't support this instruction and newly added Tegra2 uses
  -march=armv4
* Blank line after local variable declarations - fixed globally
* Explicitly added an empty flush_cache() under
  #ifdef CONFIG_SYS_NO_DCACHE
* Removed the print inside the weakly linked stub function -
  __arm_init_before_mmu
* Fixed signature of flush_cache in cache.c
* More descriptive commit message for the PL310 support patch
* C struct for PL310 register accesses
* Fixed white space issues

V3:
* Rebased to latest HEAD of master
* Added comments on changes done in V2 in individual patch headers. This
  was missing in V2

V4:
* Removed bit field manipulation macros
* Renamed CONFIG_SYS_NO_*CACHE flags to CONFIG_SYS_*CACHE_OFF globally

Aneesh V (9):
  arm: make default implementation of cache_flush() weakly linked
  armv7: cache maintenance operations for armv7
  armv7: rename cache related CONFIG flags
  armv7: integrate cache maintenance support
  arm: minor fixes for cache and mmu handling
  armv7: add PL310 support to u-boot
  armv7: adapt omap4 to the new cache maintenance framework
  armv7: adapt omap3 to the new cache maintenance framework
  armv7: adapt s5pc1xx to the new cache maintenance framework

 README |   11 +
 arch/arm/cpu/arm1136/start.S   |4 +-
 arch/arm/cpu/armv7/Makefile|2 +-
 arch/arm/cpu/armv7/cache_v7.c  |  394 
 arch/arm/cpu/armv7/cpu.c   |   50 +--
 arch/arm/cpu/armv7/omap3/Makefile  |1 -
 arch/arm/cpu/armv7/omap3/board.c   |  136 ++-
 arch/arm/cpu/armv7/omap3/cache.S   |  263 -
 arch/arm/cpu/armv7/omap3/lowlevel_init.S   |   32 ++
 arch/arm/cpu/armv7/omap4/board.c   |   12 +
 arch/arm/cpu/armv7/omap4/lowlevel_init.S   |9 +
 arch/arm/cpu/armv7/s5pc1xx/cache.S |   88 +
 arch/arm/cpu/armv7/start.S |   18 +-
 arch/arm/include/asm/arch-omap3/omap3.h|   20 +
 arch/arm/include/asm/arch-omap3/sys_proto.h|   10 +-
 arch/arm/include/asm/arch-omap4/sys_proto.h|2 +-
 arch/arm/include/asm/arch-s5pc1xx/sys_proto.h  |3 -
 arch/arm/include/asm/armv7.h   |   67 
 arch/arm/include/asm/global_data.h |2 +-
 arch/arm/include/asm/pl310.h   |   73 
 .../omap4/lowlevel_init.S => include/asm/utils.h}  |   51 ++-
 arch/arm/lib/Makefile  |3 +-
 arch/arm/lib/board.c   |8 +-
 arch/arm/lib/cache-cp15.c  |   22 +-
 arch/arm/lib/cache-pl310.c |  115 ++
 arch/arm/lib/cache.c   |   20 +-
 board/armltd/integrator/split_by_variant.sh|8 +-
 common/cmd_bdinfo.c|2 +-
 include/common.h   |5 +-
 include/configs/B2.h   |3 +-
 include/configs/assabet.h  |2 +-
 include/configs/ca9x4_ct_vxp.h