blob: 52d06b3eedb8b463c8d6908e1dd3855216727261 [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
6#include <common.h>
7#include <config.h>
8#include <command.h>
Simon Glass8f3f7612019-11-14 12:57:42 -07009#include <irq_func.h>
Kumar Gala2548b992008-08-15 08:24:33 -050010
Kim Phillipsdc00a682012-10-29 13:34:31 +000011static int do_interrupts(cmd_tbl_t *cmdtp, int flag, int argc,
12 char * const argv[])
Kumar Gala2548b992008-08-15 08:24:33 -050013{
14
Wolfgang Denk3b683112010-07-17 01:06:04 +020015 if (argc != 2)
Simon Glassa06dfc72011-12-10 08:44:01 +000016 return CMD_RET_USAGE;
Kumar Gala2548b992008-08-15 08:24:33 -050017
18 /* on */
Wolfgang Denk3b683112010-07-17 01:06:04 +020019 if (strncmp(argv[1], "on", 2) == 0)
Kumar Gala2548b992008-08-15 08:24:33 -050020 enable_interrupts();
Wolfgang Denk3b683112010-07-17 01:06:04 +020021 else
Kumar Gala2548b992008-08-15 08:24:33 -050022 disable_interrupts();
Kumar Gala2548b992008-08-15 08:24:33 -050023
24 return 0;
25}
26
27U_BOOT_CMD(
28 interrupts, 5, 0, do_interrupts,
Peter Tyserdfb72b82009-01-27 18:03:12 -060029 "enable or disable interrupts",
Wolfgang Denkc54781c2009-05-24 17:06:54 +020030 "[on, off]"
Kumar Gala2548b992008-08-15 08:24:33 -050031);
Peter Tyser42744432009-11-11 10:36:28 -060032
33/* Implemented in $(CPU)/interrupts.c */
Wolfgang Denk6262d0212010-06-28 22:00:46 +020034int do_irqinfo (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]);
Peter Tyser42744432009-11-11 10:36:28 -060035
36U_BOOT_CMD(
37 irqinfo, 1, 1, do_irqinfo,
38 "print information about IRQs",
39 ""
40);