Tom Rini | 10e4779 | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0+ |
Kumar Gala | 2548b99 | 2008-08-15 08:24:33 -0500 | [diff] [blame] | 2 | /* |
| 3 | * Copyright 2008 Freescale Semiconductor, Inc. |
Kumar Gala | 2548b99 | 2008-08-15 08:24:33 -0500 | [diff] [blame] | 4 | */ |
| 5 | |
Kumar Gala | 2548b99 | 2008-08-15 08:24:33 -0500 | [diff] [blame] | 6 | #include <config.h> |
| 7 | #include <command.h> |
Simon Glass | 8f3f761 | 2019-11-14 12:57:42 -0700 | [diff] [blame] | 8 | #include <irq_func.h> |
Kumar Gala | 2548b99 | 2008-08-15 08:24:33 -0500 | [diff] [blame] | 9 | |
Simon Glass | ed38aef | 2020-05-10 11:40:03 -0600 | [diff] [blame] | 10 | static int do_interrupts(struct cmd_tbl *cmdtp, int flag, int argc, |
| 11 | char *const argv[]) |
Kumar Gala | 2548b99 | 2008-08-15 08:24:33 -0500 | [diff] [blame] | 12 | { |
| 13 | |
Wolfgang Denk | 3b68311 | 2010-07-17 01:06:04 +0200 | [diff] [blame] | 14 | if (argc != 2) |
Simon Glass | a06dfc7 | 2011-12-10 08:44:01 +0000 | [diff] [blame] | 15 | return CMD_RET_USAGE; |
Kumar Gala | 2548b99 | 2008-08-15 08:24:33 -0500 | [diff] [blame] | 16 | |
| 17 | /* on */ |
Wolfgang Denk | 3b68311 | 2010-07-17 01:06:04 +0200 | [diff] [blame] | 18 | if (strncmp(argv[1], "on", 2) == 0) |
Kumar Gala | 2548b99 | 2008-08-15 08:24:33 -0500 | [diff] [blame] | 19 | enable_interrupts(); |
Wolfgang Denk | 3b68311 | 2010-07-17 01:06:04 +0200 | [diff] [blame] | 20 | else |
Kumar Gala | 2548b99 | 2008-08-15 08:24:33 -0500 | [diff] [blame] | 21 | disable_interrupts(); |
Kumar Gala | 2548b99 | 2008-08-15 08:24:33 -0500 | [diff] [blame] | 22 | |
| 23 | return 0; |
| 24 | } |
| 25 | |
| 26 | U_BOOT_CMD( |
| 27 | interrupts, 5, 0, do_interrupts, |
Peter Tyser | dfb72b8 | 2009-01-27 18:03:12 -0600 | [diff] [blame] | 28 | "enable or disable interrupts", |
Wolfgang Denk | c54781c | 2009-05-24 17:06:54 +0200 | [diff] [blame] | 29 | "[on, off]" |
Kumar Gala | 2548b99 | 2008-08-15 08:24:33 -0500 | [diff] [blame] | 30 | ); |
Peter Tyser | 4274443 | 2009-11-11 10:36:28 -0600 | [diff] [blame] | 31 | |
Peter Tyser | 4274443 | 2009-11-11 10:36:28 -0600 | [diff] [blame] | 32 | U_BOOT_CMD( |
| 33 | irqinfo, 1, 1, do_irqinfo, |
| 34 | "print information about IRQs", |
| 35 | "" |
| 36 | ); |