Kumar Gala | ffa4baf | 2008-08-15 08:24:33 -0500 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2008 Freescale Semiconductor, Inc. |
| 3 | * |
Wolfgang Denk | 1a45966 | 2013-07-08 09:37:19 +0200 | [diff] [blame^] | 4 | * SPDX-License-Identifier: GPL-2.0+ |
Kumar Gala | ffa4baf | 2008-08-15 08:24:33 -0500 | [diff] [blame] | 5 | */ |
| 6 | |
| 7 | #include <common.h> |
| 8 | #include <config.h> |
| 9 | #include <command.h> |
| 10 | |
Kim Phillips | 088f1b1 | 2012-10-29 13:34:31 +0000 | [diff] [blame] | 11 | static int do_interrupts(cmd_tbl_t *cmdtp, int flag, int argc, |
| 12 | char * const argv[]) |
Kumar Gala | ffa4baf | 2008-08-15 08:24:33 -0500 | [diff] [blame] | 13 | { |
| 14 | |
Wolfgang Denk | 47e26b1 | 2010-07-17 01:06:04 +0200 | [diff] [blame] | 15 | if (argc != 2) |
Simon Glass | 4c12eeb | 2011-12-10 08:44:01 +0000 | [diff] [blame] | 16 | return CMD_RET_USAGE; |
Kumar Gala | ffa4baf | 2008-08-15 08:24:33 -0500 | [diff] [blame] | 17 | |
| 18 | /* on */ |
Wolfgang Denk | 47e26b1 | 2010-07-17 01:06:04 +0200 | [diff] [blame] | 19 | if (strncmp(argv[1], "on", 2) == 0) |
Kumar Gala | ffa4baf | 2008-08-15 08:24:33 -0500 | [diff] [blame] | 20 | enable_interrupts(); |
Wolfgang Denk | 47e26b1 | 2010-07-17 01:06:04 +0200 | [diff] [blame] | 21 | else |
Kumar Gala | ffa4baf | 2008-08-15 08:24:33 -0500 | [diff] [blame] | 22 | disable_interrupts(); |
Kumar Gala | ffa4baf | 2008-08-15 08:24:33 -0500 | [diff] [blame] | 23 | |
| 24 | return 0; |
| 25 | } |
| 26 | |
| 27 | U_BOOT_CMD( |
| 28 | interrupts, 5, 0, do_interrupts, |
Peter Tyser | 2fb2604 | 2009-01-27 18:03:12 -0600 | [diff] [blame] | 29 | "enable or disable interrupts", |
Wolfgang Denk | a89c33d | 2009-05-24 17:06:54 +0200 | [diff] [blame] | 30 | "[on, off]" |
Kumar Gala | ffa4baf | 2008-08-15 08:24:33 -0500 | [diff] [blame] | 31 | ); |
Peter Tyser | c253122 | 2009-11-11 10:36:28 -0600 | [diff] [blame] | 32 | |
| 33 | /* Implemented in $(CPU)/interrupts.c */ |
Wolfgang Denk | 54841ab | 2010-06-28 22:00:46 +0200 | [diff] [blame] | 34 | int do_irqinfo (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]); |
Peter Tyser | c253122 | 2009-11-11 10:36:28 -0600 | [diff] [blame] | 35 | |
| 36 | U_BOOT_CMD( |
| 37 | irqinfo, 1, 1, do_irqinfo, |
| 38 | "print information about IRQs", |
| 39 | "" |
| 40 | ); |