blob: 655aba576a8b29f43808adc7af7e2d33490b7df4 [file] [log] [blame]
Tom Rini83d290c2018-05-06 17:58:06 -04001// SPDX-License-Identifier: GPL-2.0+
Kumar Galaffa4baf2008-08-15 08:24:33 -05002/*
3 * Copyright 2008 Freescale Semiconductor, Inc.
Kumar Galaffa4baf2008-08-15 08:24:33 -05004 */
5
Kumar Galaffa4baf2008-08-15 08:24:33 -05006#include <config.h>
7#include <command.h>
Simon Glass36bf4462019-11-14 12:57:42 -07008#include <irq_func.h>
Kumar Galaffa4baf2008-08-15 08:24:33 -05009
Simon Glass09140112020-05-10 11:40:03 -060010static int do_interrupts(struct cmd_tbl *cmdtp, int flag, int argc,
11 char *const argv[])
Kumar Galaffa4baf2008-08-15 08:24:33 -050012{
13
Wolfgang Denk47e26b12010-07-17 01:06:04 +020014 if (argc != 2)
Simon Glass4c12eeb2011-12-10 08:44:01 +000015 return CMD_RET_USAGE;
Kumar Galaffa4baf2008-08-15 08:24:33 -050016
17 /* on */
Wolfgang Denk47e26b12010-07-17 01:06:04 +020018 if (strncmp(argv[1], "on", 2) == 0)
Kumar Galaffa4baf2008-08-15 08:24:33 -050019 enable_interrupts();
Wolfgang Denk47e26b12010-07-17 01:06:04 +020020 else
Kumar Galaffa4baf2008-08-15 08:24:33 -050021 disable_interrupts();
Kumar Galaffa4baf2008-08-15 08:24:33 -050022
23 return 0;
24}
25
26U_BOOT_CMD(
27 interrupts, 5, 0, do_interrupts,
Peter Tyser2fb26042009-01-27 18:03:12 -060028 "enable or disable interrupts",
Wolfgang Denka89c33d2009-05-24 17:06:54 +020029 "[on, off]"
Kumar Galaffa4baf2008-08-15 08:24:33 -050030);
Peter Tyserc2531222009-11-11 10:36:28 -060031
32/* Implemented in $(CPU)/interrupts.c */
Simon Glass09140112020-05-10 11:40:03 -060033int do_irqinfo(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]);
Peter Tyserc2531222009-11-11 10:36:28 -060034
35U_BOOT_CMD(
36 irqinfo, 1, 1, do_irqinfo,
37 "print information about IRQs",
38 ""
39);