2 * (C) Copyright 2007 Michal Simek
4 * Michal SIMEK <monstr@monstr.eu>
6 * See file CREDITS for list of people who contributed to this
9 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License as
11 * published by the Free Software Foundation; either version 2 of
12 * the License, or (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
26 * Microblaze FSL support
34 int do_frd (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
38 unsigned int blocking;
41 printf ("Usage:\n%s\n", cmdtp->usage);
45 fslnum = (unsigned int)simple_strtoul (argv[1], NULL, 16);
46 blocking = (unsigned int)simple_strtoul (argv[2], NULL, 16);
47 if (fslnum < 0 || fslnum >= XILINX_FSL_NUMBER) {
48 puts ("Bad number of FSL\n");
49 printf ("Usage:\n%s\n", cmdtp->usage);
54 #if (XILINX_FSL_NUMBER > 0)
57 case 0: NGET (num, 0);
59 case 1: NCGET (num, 0);
63 case 3: CGET (num, 0);
70 #if (XILINX_FSL_NUMBER > 1)
73 case 0: NGET (num, 1);
75 case 1: NCGET (num, 1);
79 case 3: CGET (num, 1);
86 #if (XILINX_FSL_NUMBER > 2)
89 case 0: NGET (num, 2);
91 case 1: NCGET (num, 2);
95 case 3: CGET (num, 2);
102 #if (XILINX_FSL_NUMBER > 3)
105 case 0: NGET (num, 3);
107 case 1: NCGET (num, 3);
109 case 2: GET (num, 3);
111 case 3: CGET (num, 3);
118 #if (XILINX_FSL_NUMBER > 4)
121 case 0: NGET (num, 4);
123 case 1: NCGET (num, 4);
125 case 2: GET (num, 4);
127 case 3: CGET (num, 4);
134 #if (XILINX_FSL_NUMBER > 5)
137 case 0: NGET (num, 5);
139 case 1: NCGET (num, 5);
141 case 2: GET (num, 5);
143 case 3: CGET (num, 5);
150 #if (XILINX_FSL_NUMBER > 6)
153 case 0: NGET (num, 6);
155 case 1: NCGET (num, 6);
157 case 2: GET (num, 6);
159 case 3: CGET (num, 6);
166 #if (XILINX_FSL_NUMBER > 7)
169 case 0: NGET (num, 7);
171 case 1: NCGET (num, 7);
173 case 2: GET (num, 7);
175 case 3: CGET (num, 7);
186 printf ("%01x: 0x%08x - %s %s read\n", fslnum, num,
187 blocking < 2 ? "non blocking" : "blocking",
188 ((blocking == 1) || (blocking == 3)) ? "control" : "data" );
192 int do_fwr (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
196 unsigned int blocking;
199 printf ("Usage:\n%s\n", cmdtp->usage);
203 fslnum = (unsigned int)simple_strtoul (argv[1], NULL, 16);
204 num = (unsigned int)simple_strtoul (argv[2], NULL, 16);
205 blocking = (unsigned int)simple_strtoul (argv[3], NULL, 16);
206 if (fslnum < 0 || fslnum >= XILINX_FSL_NUMBER) {
207 printf ("Bad number of FSL\nUsage:\n%s\n", cmdtp->usage);
212 #if (XILINX_FSL_NUMBER > 0)
215 case 0: NPUT (num, 0);
217 case 1: NCPUT (num, 0);
219 case 2: PUT (num, 0);
221 case 3: CPUT (num, 0);
228 #if (XILINX_FSL_NUMBER > 1)
231 case 0: NPUT (num, 1);
233 case 1: NCPUT (num, 1);
235 case 2: PUT (num, 1);
237 case 3: CPUT (num, 1);
244 #if (XILINX_FSL_NUMBER > 2)
247 case 0: NPUT (num, 2);
249 case 1: NCPUT (num, 2);
251 case 2: PUT (num, 2);
253 case 3: CPUT (num, 2);
260 #if (XILINX_FSL_NUMBER > 3)
263 case 0: NPUT (num, 3);
265 case 1: NCPUT (num, 3);
267 case 2: PUT (num, 3);
269 case 3: CPUT (num, 3);
276 #if (XILINX_FSL_NUMBER > 4)
279 case 0: NPUT (num, 4);
281 case 1: NCPUT (num, 4);
283 case 2: PUT (num, 4);
285 case 3: CPUT (num, 4);
292 #if (XILINX_FSL_NUMBER > 5)
295 case 0: NPUT (num, 5);
297 case 1: NCPUT (num, 5);
299 case 2: PUT (num, 5);
301 case 3: CPUT (num, 5);
308 #if (XILINX_FSL_NUMBER > 6)
311 case 0: NPUT (num, 6);
313 case 1: NCPUT (num, 6);
315 case 2: PUT (num, 6);
317 case 3: CPUT (num, 6);
324 #if (XILINX_FSL_NUMBER > 7)
327 case 0: NPUT (num, 7);
329 case 1: NCPUT (num, 7);
331 case 2: PUT (num, 7);
333 case 3: CPUT (num, 7);
344 printf ("%01x: 0x%08x - %s %s write\n", fslnum, num,
345 blocking < 2 ? "non blocking" : "blocking",
346 ((blocking == 1) || (blocking == 3)) ? "control" : "data" );
351 int do_rspr (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
353 unsigned int reg = 0;
354 unsigned int val = 0;
357 printf ("Usage:\n%s\n", cmdtp->usage);
360 reg = (unsigned int)simple_strtoul (argv[1], NULL, 16);
361 val = (unsigned int)simple_strtoul (argv[2], NULL, 16);
382 puts ("Unsupported register\n");
385 printf (": 0x%08x\n", val);
389 /***************************************************/
391 U_BOOT_CMD (frd, 3, 1, do_frd,
392 "frd - read data from FSL\n",
393 "- [fslnum [0|1|2|3]]\n"
394 " 0 - non blocking data read\n"
395 " 1 - non blocking control read\n"
396 " 2 - blocking data read\n"
397 " 3 - blocking control read\n");
400 U_BOOT_CMD (fwr, 4, 1, do_fwr,
401 "fwr - write data to FSL\n",
402 "- [fslnum [0|1|2|3]]\n"
403 " 0 - non blocking data write\n"
404 " 1 - non blocking control write\n"
405 " 2 - blocking data write\n"
406 " 3 - blocking control write\n");
408 U_BOOT_CMD (rspr, 3, 1, do_rspr,
409 "rspr - read/write special purpose register\n",
410 "- reg_num [write value] read/write special purpose register\n"
411 " 1 - MSR - Machine status register\n"
412 " 3 - EAR - Exception address register\n"
413 " 5 - ESR - Exception status register\n");