aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/platforms/pseries
diff options
context:
space:
mode:
authorManish Ahuja <ahuja@austin.ibm.com>2008-03-21 19:44:05 -0400
committerPaul Mackerras <paulus@samba.org>2008-03-25 17:44:06 -0400
commit599c1aa54f06da4fd277982be0731e96f0791caa (patch)
tree14f5526df3d9d8b57d727eddedcc07c8e7e15f3b /arch/powerpc/platforms/pseries
parent2c4f41139cc4ffc3ad12d7fdb8dd71dc36824a6e (diff)
[POWERPC] pseries: phyp dump: Debugging print routines
Provide some basic debugging support. Signed-off-by: Manish Ahuja <mahuja@us.ibm.com> Signed-off-by: Linas Vepstas <linasvepstas@gmail.com> Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch/powerpc/platforms/pseries')
-rw-r--r--arch/powerpc/platforms/pseries/phyp_dump.c61
1 files changed, 59 insertions, 2 deletions
diff --git a/arch/powerpc/platforms/pseries/phyp_dump.c b/arch/powerpc/platforms/pseries/phyp_dump.c
index d93f1b1585a3..5cdba6a6f70c 100644
--- a/arch/powerpc/platforms/pseries/phyp_dump.c
+++ b/arch/powerpc/platforms/pseries/phyp_dump.c
@@ -123,6 +123,61 @@ static unsigned long init_dump_header(struct phyp_dump_header *ph)
123 return addr_offset; 123 return addr_offset;
124} 124}
125 125
126static void print_dump_header(const struct phyp_dump_header *ph)
127{
128#ifdef DEBUG
129 printk(KERN_INFO "dump header:\n");
130 /* setup some ph->sections required */
131 printk(KERN_INFO "version = %d\n", ph->version);
132 printk(KERN_INFO "Sections = %d\n", ph->num_of_sections);
133 printk(KERN_INFO "Status = 0x%x\n", ph->status);
134
135 /* No ph->disk, so all should be set to 0 */
136 printk(KERN_INFO "Offset to first section 0x%x\n",
137 ph->first_offset_section);
138 printk(KERN_INFO "dump disk sections should be zero\n");
139 printk(KERN_INFO "dump disk section = %d\n", ph->dump_disk_section);
140 printk(KERN_INFO "block num = %ld\n", ph->block_num_dd);
141 printk(KERN_INFO "number of blocks = %ld\n", ph->num_of_blocks_dd);
142 printk(KERN_INFO "dump disk offset = %d\n", ph->offset_dd);
143 printk(KERN_INFO "Max auto time= %d\n", ph->maxtime_to_auto);
144
145 /*set cpu state and hpte states as well scratch pad area */
146 printk(KERN_INFO " CPU AREA \n");
147 printk(KERN_INFO "cpu dump_flags =%d\n", ph->cpu_data.dump_flags);
148 printk(KERN_INFO "cpu source_type =%d\n", ph->cpu_data.source_type);
149 printk(KERN_INFO "cpu error_flags =%d\n", ph->cpu_data.error_flags);
150 printk(KERN_INFO "cpu source_address =%lx\n",
151 ph->cpu_data.source_address);
152 printk(KERN_INFO "cpu source_length =%lx\n",
153 ph->cpu_data.source_length);
154 printk(KERN_INFO "cpu length_copied =%lx\n",
155 ph->cpu_data.length_copied);
156
157 printk(KERN_INFO " HPTE AREA \n");
158 printk(KERN_INFO "HPTE dump_flags =%d\n", ph->hpte_data.dump_flags);
159 printk(KERN_INFO "HPTE source_type =%d\n", ph->hpte_data.source_type);
160 printk(KERN_INFO "HPTE error_flags =%d\n", ph->hpte_data.error_flags);
161 printk(KERN_INFO "HPTE source_address =%lx\n",
162 ph->hpte_data.source_address);
163 printk(KERN_INFO "HPTE source_length =%lx\n",
164 ph->hpte_data.source_length);
165 printk(KERN_INFO "HPTE length_copied =%lx\n",
166 ph->hpte_data.length_copied);
167
168 printk(KERN_INFO " SRSD AREA \n");
169 printk(KERN_INFO "SRSD dump_flags =%d\n", ph->kernel_data.dump_flags);
170 printk(KERN_INFO "SRSD source_type =%d\n", ph->kernel_data.source_type);
171 printk(KERN_INFO "SRSD error_flags =%d\n", ph->kernel_data.error_flags);
172 printk(KERN_INFO "SRSD source_address =%lx\n",
173 ph->kernel_data.source_address);
174 printk(KERN_INFO "SRSD source_length =%lx\n",
175 ph->kernel_data.source_length);
176 printk(KERN_INFO "SRSD length_copied =%lx\n",
177 ph->kernel_data.length_copied);
178#endif
179}
180
126static void register_dump_area(struct phyp_dump_header *ph, unsigned long addr) 181static void register_dump_area(struct phyp_dump_header *ph, unsigned long addr)
127{ 182{
128 int rc; 183 int rc;
@@ -135,9 +190,11 @@ static void register_dump_area(struct phyp_dump_header *ph, unsigned long addr)
135 1, ph, sizeof(struct phyp_dump_header)); 190 1, ph, sizeof(struct phyp_dump_header));
136 } while (rtas_busy_delay(rc)); 191 } while (rtas_busy_delay(rc));
137 192
138 if (rc) 193 if (rc) {
139 printk(KERN_ERR "phyp-dump: unexpected error (%d) on " 194 printk(KERN_ERR "phyp-dump: unexpected error (%d) on "
140 "register\n", rc); 195 "register\n", rc);
196 print_dump_header(ph);
197 }
141} 198}
142 199
143/* ------------------------------------------------- */ 200/* ------------------------------------------------- */
@@ -246,8 +303,8 @@ static int __init phyp_dump_setup(void)
246 of_node_put(rtas); 303 of_node_put(rtas);
247 } 304 }
248 305
306 print_dump_header(dump_header);
249 dump_area_length = init_dump_header(&phdr); 307 dump_area_length = init_dump_header(&phdr);
250
251 /* align down */ 308 /* align down */
252 dump_area_start = phyp_dump_info->init_reserve_start & PAGE_MASK; 309 dump_area_start = phyp_dump_info->init_reserve_start & PAGE_MASK;
253 310