aboutsummaryrefslogtreecommitdiffstats
path: root/arch/blackfin/kernel/cplbinfo.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/blackfin/kernel/cplbinfo.c')
-rw-r--r--arch/blackfin/kernel/cplbinfo.c84
1 files changed, 0 insertions, 84 deletions
diff --git a/arch/blackfin/kernel/cplbinfo.c b/arch/blackfin/kernel/cplbinfo.c
index 1d3bbec1a195..64d78300dd08 100644
--- a/arch/blackfin/kernel/cplbinfo.c
+++ b/arch/blackfin/kernel/cplbinfo.c
@@ -20,8 +20,6 @@ static char const page_strtbl[][3] = { "1K", "4K", "1M", "4M" };
20#define page(flags) (((flags) & 0x30000) >> 16) 20#define page(flags) (((flags) & 0x30000) >> 16)
21#define strpage(flags) page_strtbl[page(flags)] 21#define strpage(flags) page_strtbl[page(flags)]
22 22
23#ifdef CONFIG_MPU
24
25struct cplbinfo_data { 23struct cplbinfo_data {
26 loff_t pos; 24 loff_t pos;
27 char cplb_type; 25 char cplb_type;
@@ -75,88 +73,6 @@ static void cplbinfo_seq_init(struct cplbinfo_data *cdata, unsigned int cpu)
75 } 73 }
76} 74}
77 75
78#else
79
80struct cplbinfo_data {
81 loff_t pos;
82 char cplb_type;
83 u32 mem_control;
84 unsigned long *pdt_tables, *pdt_swapcount;
85 unsigned long cplb_addr, cplb_data;
86};
87
88extern int page_size_table[];
89
90static int cplb_find_entry(unsigned long addr_tbl, unsigned long data_tbl,
91 unsigned long addr_find, unsigned long data_find)
92{
93 int i;
94
95 for (i = 0; i < 16; ++i) {
96 unsigned long cplb_addr = bfin_read32(addr_tbl + i * 4);
97 unsigned long cplb_data = bfin_read32(data_tbl + i * 4);
98 if (addr_find >= cplb_addr &&
99 addr_find < cplb_addr + page_size_table[page(cplb_data)] &&
100 cplb_data == data_find)
101 return i;
102 }
103
104 return -1;
105}
106
107static void cplbinfo_print_header(struct seq_file *m)
108{
109 seq_printf(m, "Address\t\tData\tSize\tValid\tLocked\tSwapin\tiCount\toCount\n");
110}
111
112static int cplbinfo_nomore(struct cplbinfo_data *cdata)
113{
114 return cdata->pdt_tables[cdata->pos * 2] == 0xffffffff;
115}
116
117static int cplbinfo_show(struct seq_file *m, void *p)
118{
119 struct cplbinfo_data *cdata;
120 unsigned long data, addr;
121 int entry;
122 loff_t pos;
123
124 cdata = p;
125 pos = cdata->pos * 2;
126 addr = cdata->pdt_tables[pos];
127 data = cdata->pdt_tables[pos + 1];
128 entry = cplb_find_entry(cdata->cplb_addr, cdata->cplb_data, addr, data);
129
130 seq_printf(m,
131 "0x%08lx\t0x%05lx\t%s\t%c\t%c\t%2d\t%ld\t%ld\n",
132 addr, data, strpage(data),
133 (data & CPLB_VALID) ? 'Y' : 'N',
134 (data & CPLB_LOCK) ? 'Y' : 'N', entry,
135 cdata->pdt_swapcount[pos],
136 cdata->pdt_swapcount[pos + 1]);
137
138 return 0;
139}
140
141static void cplbinfo_seq_init(struct cplbinfo_data *cdata, unsigned int cpu)
142{
143 if (cdata->cplb_type == 'I') {
144 cdata->mem_control = bfin_read_IMEM_CONTROL();
145 cdata->pdt_tables = ipdt_tables[cpu];
146 cdata->pdt_swapcount = ipdt_swapcount_tables[cpu];
147 cdata->cplb_addr = ICPLB_ADDR0;
148 cdata->cplb_data = ICPLB_DATA0;
149 } else {
150 cdata->mem_control = bfin_read_DMEM_CONTROL();
151 cdata->pdt_tables = dpdt_tables[cpu];
152 cdata->pdt_swapcount = dpdt_swapcount_tables[cpu];
153 cdata->cplb_addr = DCPLB_ADDR0;
154 cdata->cplb_data = DCPLB_DATA0;
155 }
156}
157
158#endif
159
160static void *cplbinfo_start(struct seq_file *m, loff_t *pos) 76static void *cplbinfo_start(struct seq_file *m, loff_t *pos)
161{ 77{
162 struct cplbinfo_data *cdata = m->private; 78 struct cplbinfo_data *cdata = m->private;