Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 1 | /* |
Robin Getz | 96f1050 | 2009-09-24 14:11:24 +0000 | [diff] [blame] | 2 | * Common CPLB definitions for CPLB init |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 3 | * |
Robin Getz | 96f1050 | 2009-09-24 14:11:24 +0000 | [diff] [blame] | 4 | * Copyright 2006-2008 Analog Devices Inc. |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 5 | * |
Robin Getz | 96f1050 | 2009-09-24 14:11:24 +0000 | [diff] [blame] | 6 | * Licensed under the GPL-2 or later. |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 7 | */ |
| 8 | |
Mike Frysinger | 81a487a | 2007-11-21 15:55:45 +0800 | [diff] [blame] | 9 | #ifndef __ASM_CPLBINIT_H__ |
| 10 | #define __ASM_CPLBINIT_H__ |
| 11 | |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 12 | #include <asm/blackfin.h> |
| 13 | #include <asm/cplb.h> |
Bernd Schmidt | dbdf20d | 2009-01-07 23:14:38 +0800 | [diff] [blame] | 14 | #include <linux/threads.h> |
| 15 | |
| 16 | #ifdef CONFIG_CPLB_SWITCH_TAB_L1 |
| 17 | # define PDT_ATTR __attribute__((l1_data)) |
| 18 | #else |
| 19 | # define PDT_ATTR |
| 20 | #endif |
| 21 | |
| 22 | struct cplb_entry { |
| 23 | unsigned long data, addr; |
| 24 | }; |
| 25 | |
| 26 | struct cplb_boundary { |
| 27 | unsigned long eaddr; /* End of this region. */ |
| 28 | unsigned long data; /* CPLB data value. */ |
| 29 | }; |
| 30 | |
| 31 | extern struct cplb_boundary dcplb_bounds[]; |
| 32 | extern struct cplb_boundary icplb_bounds[]; |
| 33 | extern int dcplb_nr_bounds, icplb_nr_bounds; |
| 34 | |
| 35 | extern struct cplb_entry dcplb_tbl[NR_CPUS][MAX_CPLBS]; |
| 36 | extern struct cplb_entry icplb_tbl[NR_CPUS][MAX_CPLBS]; |
| 37 | extern int first_switched_icplb; |
| 38 | extern int first_switched_dcplb; |
| 39 | |
| 40 | extern int nr_dcplb_miss[], nr_icplb_miss[], nr_icplb_supv_miss[]; |
| 41 | extern int nr_dcplb_prot[], nr_cplb_flush[]; |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 42 | |
Bernd Schmidt | b97b8a9 | 2008-01-27 18:39:16 +0800 | [diff] [blame] | 43 | #ifdef CONFIG_MPU |
| 44 | |
Bernd Schmidt | dbdf20d | 2009-01-07 23:14:38 +0800 | [diff] [blame] | 45 | extern int first_mask_dcplb; |
Bernd Schmidt | b97b8a9 | 2008-01-27 18:39:16 +0800 | [diff] [blame] | 46 | |
Bernd Schmidt | dbdf20d | 2009-01-07 23:14:38 +0800 | [diff] [blame] | 47 | extern int page_mask_order; |
| 48 | extern int page_mask_nelts; |
Bernd Schmidt | b97b8a9 | 2008-01-27 18:39:16 +0800 | [diff] [blame] | 49 | |
Bernd Schmidt | dbdf20d | 2009-01-07 23:14:38 +0800 | [diff] [blame] | 50 | extern unsigned long *current_rwx_mask[NR_CPUS]; |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 51 | |
Bernd Schmidt | dbdf20d | 2009-01-07 23:14:38 +0800 | [diff] [blame] | 52 | extern void flush_switched_cplbs(unsigned int); |
| 53 | extern void set_mask_dcplbs(unsigned long *, unsigned int); |
Graf Yang | b8a9898 | 2008-11-18 17:48:22 +0800 | [diff] [blame] | 54 | |
Bernd Schmidt | dbdf20d | 2009-01-07 23:14:38 +0800 | [diff] [blame] | 55 | extern void __noreturn panic_cplb_error(int seqstat, struct pt_regs *); |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 56 | |
Bernd Schmidt | b97b8a9 | 2008-01-27 18:39:16 +0800 | [diff] [blame] | 57 | #endif /* CONFIG_MPU */ |
| 58 | |
Bernd Schmidt | dbdf20d | 2009-01-07 23:14:38 +0800 | [diff] [blame] | 59 | extern void bfin_icache_init(struct cplb_entry *icplb_tbl); |
| 60 | extern void bfin_dcache_init(struct cplb_entry *icplb_tbl); |
| 61 | |
Graf Yang | b8a9898 | 2008-11-18 17:48:22 +0800 | [diff] [blame] | 62 | #if defined(CONFIG_BFIN_DCACHE) || defined(CONFIG_BFIN_ICACHE) |
Bernd Schmidt | dbdf20d | 2009-01-07 23:14:38 +0800 | [diff] [blame] | 63 | extern void generate_cplb_tables_all(void); |
Graf Yang | b8a9898 | 2008-11-18 17:48:22 +0800 | [diff] [blame] | 64 | extern void generate_cplb_tables_cpu(unsigned int cpu); |
| 65 | #endif |
Mike Frysinger | 81a487a | 2007-11-21 15:55:45 +0800 | [diff] [blame] | 66 | #endif |