Message ID | CAGsJ_4xhQZUKx85+4mZLqFrAF+XmUqZp=VCRYwJyNafTUe814g@mail.gmail.com |
---|---|
State | New |
Headers | show |
On Mon, Sep 19, 2011 at 01:33:39PM +0800, Barry Song wrote:
> Do you think the following is what you want?
Almost. A couple of things:
1. Making the variables static means that folk like OMAP can't read the
values at resume time from their assembly (forcing them to save and
restore them, rather than using the already saved copy.)
2. It probably makes sense to make a structure out of the saved state
information so that assembly code doesn't have to individually find
the address of each variable. Instead, they can find the address of
the structure (in physical memory if that's what they need) and use
offsets.
With (2) its probably worth adding a comment about the structure being
used in platform code and it should only ever be appended to.
(Alternatively, we could use the asm-offsets.h generation stuff to
create preprocessor symbols for the offsets in the struct if we put the
struct in a header file.)
diff --git a/arch/arm/include/asm/outercache.h b/arch/arm/include/asm/outercache.h index d838743..53426c6 100644 --- a/arch/arm/include/asm/outercache.h +++ b/arch/arm/include/asm/outercache.h @@ -34,6 +34,7 @@ struct outer_cache_fns { void (*sync)(void); #endif void (*set_debug)(unsigned long); + void (*resume)(void); }; #ifdef CONFIG_OUTER_CACHE @@ -74,6 +75,12 @@ static inline void outer_disable(void) outer_cache.disable(); } +static inline void outer_resume(void) +{ + if (outer_cache.resume) + outer_cache.resume(); +} + #else static inline void outer_inv_range(phys_addr_t start, phys_addr_t end) diff --git a/arch/arm/mm/cache-l2x0.c b/arch/arm/mm/cache-l2x0.c index 0d85d22..4722707 100644 --- a/arch/arm/mm/cache-l2x0.c +++ b/arch/arm/mm/cache-l2x0.c @@ -32,6 +32,14 @@ static void __iomem *l2x0_base; static DEFINE_SPINLOCK(l2x0_lock); static uint32_t l2x0_way_mask; /* Bitmask of active ways */ static uint32_t l2x0_size; +static u32 l2x0_aux_ctrl; +static u32 l2x0_tag_latency, l2x0_data_latency, l2x0_filter_start, l2x0_filter_end; + +struct l2x0_of_data { + void (*setup)(const struct device_node *,__u32 *, __u32 *); + void (*save)(void); + void (*resume)(void); +}; static inline void cache_wait_way(void __iomem *reg, unsigned long mask)