blob: da223b4b2cce77c4b851b152f4b74693869c23c7 [file] [log] [blame]
Tom Rini10e47792018-05-06 17:58:06 -04001// SPDX-License-Identifier: GPL-2.0+
Kumar Gala2548b992008-08-15 08:24:33 -05002/*
3 * Copyright 2008 Freescale Semiconductor, Inc.
Kumar Gala2548b992008-08-15 08:24:33 -05004 */
5
Kumar Gala2548b992008-08-15 08:24:33 -05006#include <config.h>
7#include <command.h>
Simon Glass8f3f7612019-11-14 12:57:42 -07008#include <irq_func.h>
Kumar Gala2548b992008-08-15 08:24:33 -05009
Simon Glassed38aef2020-05-10 11:40:03 -060010static int do_interrupts(struct cmd_tbl *cmdtp, int flag, int argc,
11 char *const argv[])
Kumar Gala2548b992008-08-15 08:24:33 -050012{
13
Wolfgang Denk3b683112010-07-17 01:06:04 +020014 if (argc != 2)
Simon Glassa06dfc72011-12-10 08:44:01 +000015 return CMD_RET_USAGE;
Kumar Gala2548b992008-08-15 08:24:33 -050016
17 /* on */
Wolfgang Denk3b683112010-07-17 01:06:04 +020018 if (strncmp(argv[1], "on", 2) == 0)
Kumar Gala2548b992008-08-15 08:24:33 -050019 enable_interrupts();
Wolfgang Denk3b683112010-07-17 01:06:04 +020020 else
Kumar Gala2548b992008-08-15 08:24:33 -050021 disable_interrupts();
Kumar Gala2548b992008-08-15 08:24:33 -050022
23 return 0;
24}
25
26U_BOOT_CMD(
27 interrupts, 5, 0, do_interrupts,
Peter Tyserdfb72b82009-01-27 18:03:12 -060028 "enable or disable interrupts",
Wolfgang Denkc54781c2009-05-24 17:06:54 +020029 "[on, off]"
Kumar Gala2548b992008-08-15 08:24:33 -050030);
Peter Tyser42744432009-11-11 10:36:28 -060031
Peter Tyser42744432009-11-11 10:36:28 -060032U_BOOT_CMD(
33 irqinfo, 1, 1, do_irqinfo,
34 "print information about IRQs",
35 ""
36);