1*552a848eSStefano Babic /*
2*552a848eSStefano Babic * Copyright (C) 2012 Boundary Devices Inc.
3*552a848eSStefano Babic *
4*552a848eSStefano Babic * SPDX-License-Identifier: GPL-2.0+
5*552a848eSStefano Babic */
6*552a848eSStefano Babic #include <common.h>
7*552a848eSStefano Babic #include <asm/arch/imx-regs.h>
8*552a848eSStefano Babic #include <asm/arch/mxc_hdmi.h>
9*552a848eSStefano Babic #include <asm/io.h>
10*552a848eSStefano Babic
do_hdmidet(cmd_tbl_t * cmdtp,int flag,int argc,char * const argv[])11*552a848eSStefano Babic static int do_hdmidet(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
12*552a848eSStefano Babic {
13*552a848eSStefano Babic struct hdmi_regs *hdmi = (struct hdmi_regs *)HDMI_ARB_BASE_ADDR;
14*552a848eSStefano Babic return (readb(&hdmi->phy_stat0) & HDMI_DVI_STAT) ? 0 : 1;
15*552a848eSStefano Babic }
16*552a848eSStefano Babic
17*552a848eSStefano Babic U_BOOT_CMD(hdmidet, 1, 1, do_hdmidet,
18*552a848eSStefano Babic "detect HDMI monitor",
19*552a848eSStefano Babic ""
20*552a848eSStefano Babic );
21