blob: 1d3e28cb3ce02427dc144ba3a0ca940564813d86 [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
6#include <common.h>
7#include <config.h>
8#include <command.h>
Simon Glass36bf4462019-11-14 12:57:42 -07009#include <irq_func.h>
Kumar Galaffa4baf2008-08-15 08:24:33 -050010
Simon Glass09140112020-05-10 11:40:03 -060011static int do_interrupts(struct cmd_tbl *cmdtp, int flag, int argc,
12 char *const argv[])
Kumar Galaffa4baf2008-08-15 08:24:33 -050013{
14
Wolfgang Denk47e26b12010-07-17 01:06:04 +020015 if (argc != 2)
Simon Glass4c12eeb2011-12-10 08:44:01 +000016 return CMD_RET_USAGE;
Kumar Galaffa4baf2008-08-15 08:24:33 -050017
18 /* on */
Wolfgang Denk47e26b12010-07-17 01:06:04 +020019 if (strncmp(argv[1], "on", 2) == 0)
Kumar Galaffa4baf2008-08-15 08:24:33 -050020 enable_interrupts();
Wolfgang Denk47e26b12010-07-17 01:06:04 +020021 else
Kumar Galaffa4baf2008-08-15 08:24:33 -050022 disable_interrupts();
Kumar Galaffa4baf2008-08-15 08:24:33 -050023
24 return 0;
25}
26
27U_BOOT_CMD(
28 interrupts, 5, 0, do_interrupts,
Peter Tyser2fb26042009-01-27 18:03:12 -060029 "enable or disable interrupts",
Wolfgang Denka89c33d2009-05-24 17:06:54 +020030 "[on, off]"
Kumar Galaffa4baf2008-08-15 08:24:33 -050031);
Peter Tyserc2531222009-11-11 10:36:28 -060032
33/* Implemented in $(CPU)/interrupts.c */
Simon Glass09140112020-05-10 11:40:03 -060034int do_irqinfo(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]);
Peter Tyserc2531222009-11-11 10:36:28 -060035
36U_BOOT_CMD(
37 irqinfo, 1, 1, do_irqinfo,
38 "print information about IRQs",
39 ""
40);