blob: 8104ab26b08f2cbc1ea21726d5b342ac74c3aa45 [file] [log] [blame]
Tom Rini10e47792018-05-06 17:58:06 -04001// SPDX-License-Identifier: GPL-2.0+
Eric Nelsonb94cfae2013-03-09 07:06:09 +00002/*
3 * Copyright (C) 2012 Boundary Devices Inc.
Eric Nelsonb94cfae2013-03-09 07:06:09 +00004 */
Simon Glassed38aef2020-05-10 11:40:03 -06005#include <command.h>
Eric Nelsonb94cfae2013-03-09 07:06:09 +00006#include <asm/arch/imx-regs.h>
7#include <asm/arch/mxc_hdmi.h>
8#include <asm/io.h>
9
Simon Glassed38aef2020-05-10 11:40:03 -060010static int do_hdmidet(struct cmd_tbl *cmdtp, int flag, int argc,
11 char *const argv[])
Eric Nelsonb94cfae2013-03-09 07:06:09 +000012{
13 struct hdmi_regs *hdmi = (struct hdmi_regs *)HDMI_ARB_BASE_ADDR;
Robert Winklerc920df72013-07-23 15:07:56 -070014 return (readb(&hdmi->phy_stat0) & HDMI_DVI_STAT) ? 0 : 1;
Eric Nelsonb94cfae2013-03-09 07:06:09 +000015}
16
17U_BOOT_CMD(hdmidet, 1, 1, do_hdmidet,
18 "detect HDMI monitor",
19 ""
20);