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
33 #if defined(CONFIG_CMD_MFSL)
36 int do_frd (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
40 unsigned int blocking;
43 printf ("Usage:\n%s\n", cmdtp->usage);
47 fslnum = (unsigned int)simple_strtoul (argv[1], NULL, 16);
48 blocking = (unsigned int)simple_strtoul (argv[2], NULL, 16);
49 if (fslnum < 0 || fslnum >= XILINX_FSL_NUMBER) {
50 puts ("Bad number of FSL\n");
51 printf ("Usage:\n%s\n", cmdtp->usage);
56 #if (XILINX_FSL_NUMBER > 0)
59 case 0: NGET (num, 0);
61 case 1: NCGET (num, 0);
65 case 3: CGET (num, 0);
72 #if (XILINX_FSL_NUMBER > 1)
75 case 0: NGET (num, 1);
77 case 1: NCGET (num, 1);
81 case 3: CGET (num, 1);
88 #if (XILINX_FSL_NUMBER > 2)
91 case 0: NGET (num, 2);
93 case 1: NCGET (num, 2);
97 case 3: CGET (num, 2);
104 #if (XILINX_FSL_NUMBER > 3)
107 case 0: NGET (num, 3);
109 case 1: NCGET (num, 3);
111 case 2: GET (num, 3);
113 case 3: CGET (num, 3);
120 #if (XILINX_FSL_NUMBER > 4)
123 case 0: NGET (num, 4);
125 case 1: NCGET (num, 4);
127 case 2: GET (num, 4);
129 case 3: CGET (num, 4);
136 #if (XILINX_FSL_NUMBER > 5)
139 case 0: NGET (num, 5);
141 case 1: NCGET (num, 5);
143 case 2: GET (num, 5);
145 case 3: CGET (num, 5);
152 #if (XILINX_FSL_NUMBER > 6)
155 case 0: NGET (num, 6);
157 case 1: NCGET (num, 6);
159 case 2: GET (num, 6);
161 case 3: CGET (num, 6);
168 #if (XILINX_FSL_NUMBER > 7)
171 case 0: NGET (num, 7);
173 case 1: NCGET (num, 7);
175 case 2: GET (num, 7);
177 case 3: CGET (num, 7);
188 printf ("%01x: 0x%08lx - %s %s read\n", fslnum, num,
189 blocking < 2 ? "non blocking" : "blocking",
190 ((blocking == 1) || (blocking == 3)) ? "control" : "data" );
194 int do_fwr (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
198 unsigned int blocking;
201 printf ("Usage:\n%s\n", cmdtp->usage);
205 fslnum = (unsigned int)simple_strtoul (argv[1], NULL, 16);
206 num = (unsigned int)simple_strtoul (argv[2], NULL, 16);
207 blocking = (unsigned int)simple_strtoul (argv[3], NULL, 16);
208 if (fslnum < 0 || fslnum >= XILINX_FSL_NUMBER) {
209 printf ("Bad number of FSL\nUsage:\n%s\n", cmdtp->usage);
214 #if (XILINX_FSL_NUMBER > 0)
217 case 0: NPUT (num, 0);
219 case 1: NCPUT (num, 0);
221 case 2: PUT (num, 0);
223 case 3: CPUT (num, 0);
230 #if (XILINX_FSL_NUMBER > 1)
233 case 0: NPUT (num, 1);
235 case 1: NCPUT (num, 1);
237 case 2: PUT (num, 1);
239 case 3: CPUT (num, 1);
246 #if (XILINX_FSL_NUMBER > 2)
249 case 0: NPUT (num, 2);
251 case 1: NCPUT (num, 2);
253 case 2: PUT (num, 2);
255 case 3: CPUT (num, 2);
262 #if (XILINX_FSL_NUMBER > 3)
265 case 0: NPUT (num, 3);
267 case 1: NCPUT (num, 3);
269 case 2: PUT (num, 3);
271 case 3: CPUT (num, 3);
278 #if (XILINX_FSL_NUMBER > 4)
281 case 0: NPUT (num, 4);
283 case 1: NCPUT (num, 4);
285 case 2: PUT (num, 4);
287 case 3: CPUT (num, 4);
294 #if (XILINX_FSL_NUMBER > 5)
297 case 0: NPUT (num, 5);
299 case 1: NCPUT (num, 5);
301 case 2: PUT (num, 5);
303 case 3: CPUT (num, 5);
310 #if (XILINX_FSL_NUMBER > 6)
313 case 0: NPUT (num, 6);
315 case 1: NCPUT (num, 6);
317 case 2: PUT (num, 6);
319 case 3: CPUT (num, 6);
326 #if (XILINX_FSL_NUMBER > 7)
329 case 0: NPUT (num, 7);
331 case 1: NCPUT (num, 7);
333 case 2: PUT (num, 7);
335 case 3: CPUT (num, 7);
346 printf ("%01x: 0x%08lx - %s %s write\n", fslnum, num,
347 blocking < 2 ? "non blocking" : "blocking",
348 ((blocking == 1) || (blocking == 3)) ? "control" : "data" );
353 int do_rspr (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
355 unsigned int reg = 0;
356 unsigned int val = 0;
359 printf ("Usage:\n%s\n", cmdtp->usage);
362 reg = (unsigned int)simple_strtoul (argv[1], NULL, 16);
363 val = (unsigned int)simple_strtoul (argv[2], NULL, 16);
384 puts ("Unsupported register\n");
387 printf (": 0x%08lx\n", val);
391 /***************************************************/
393 U_BOOT_CMD (frd, 3, 1, do_frd,
394 "frd - read data from FSL\n",
395 "- [fslnum [0|1|2|3]]\n"
396 " 0 - non blocking data read\n"
397 " 1 - non blocking control read\n"
398 " 2 - blocking data read\n"
399 " 3 - blocking control read\n");
402 U_BOOT_CMD (fwr, 4, 1, do_fwr,
403 "fwr - write data to FSL\n",
404 "- [fslnum [0|1|2|3]]\n"
405 " 0 - non blocking data write\n"
406 " 1 - non blocking control write\n"
407 " 2 - blocking data write\n"
408 " 3 - blocking control write\n");
410 U_BOOT_CMD (rspr, 3, 1, do_rspr,
411 "rspr - read/write special purpose register\n",
412 "- reg_num [write value] read/write special purpose register\n"
413 " 1 - MSR - Machine status register\n"
414 " 3 - EAR - Exception address register\n"
415 " 5 - ESR - Exception status register\n");