please choosego to mobile | Continue to access the PC version
View: 4391|Reply: 0

HDMI PHY Register setting for Allwinner H3

[Copy link]

4

threads

12

posts

48

credits

Novice

Rank: 1

credits
48
Published in 2015-11-27 17:23:29 | Show all floors |Read mode
I saw a lot of discuusiong about HDMI output resolution changes for H3 chip (orange pi PC, mini 2 etc), some resolution is working some are not and a lot of people are intersted in those setting changes.

From kernel point of view, it is important to understand how the H3 PHY registers are setted as below code, could Steven get some information from All Winner about that and share in the forum?
Thanks!


static int hdmi_phy_set(struct video_para *video)
{
        unsigned int id;
        unsigned int tmp;

        id = get_vid(video->vic);
        hdmi_writel(0x10020,hdmi_readl(0x10020)&(~0xf000));
        switch(ptbl[id].para[1])
        {
                case 1:
                        if(hdmi_version == 0)
                                hdmi_writel(0x1002c,0x31dc5fc0);
                        else
                                hdmi_writel(0x1002c,0x30dc5fc0);
                        hdmi_writel(0x10030,0x800863C0);
                        hdmi_udelay(10000);
                        hdmi_writel(0x10034,0x00000001);
                        hdmi_writel(0x1002c,hdmi_readl(0x1002c)|0x02000000);
                        hdmi_udelay(200000);
                        tmp = hdmi_readl(0x10038);
                        hdmi_writel(0x1002c,hdmi_readl(0x1002c)|0xC0000000);
                        if(((tmp&0x1f800)>>11) < 0x3d)
                                hdmi_writel(0x1002c,hdmi_readl(0x1002c)|(((tmp&0x1f800)>>11)+2));
                        else
                                hdmi_writel(0x1002c,hdmi_readl(0x1002c)|0x3f);
                        hdmi_udelay(100000);
                        hdmi_writel(0x10020,0x01FFFF7F);
                        hdmi_writel(0x10024,0x8063b000);
                        hdmi_writel(0x10028,0x0F8246B5);
                        break;
                case 2:
                        hdmi_writel(0x1002c,0x39dc5040);
                        hdmi_writel(0x10030,0x80084381);
                        hdmi_udelay(10000);
                        hdmi_writel(0x10034,0x00000001);
                        hdmi_writel(0x1002c,hdmi_readl(0x1002c)|0x02000000);
                        hdmi_udelay(100000);
                        tmp = hdmi_readl(0x10038);
                        hdmi_writel(0x1002c,hdmi_readl(0x1002c)|0xC0000000);
                        hdmi_writel(0x1002c,hdmi_readl(0x1002c)|((tmp&0x1f800)>>11));
                        hdmi_writel(0x10020,0x01FFFF7F);
                        hdmi_writel(0x10024,0x8063a800);
                        hdmi_writel(0x10028,0x0F81C485);
                        break;
                case 4:
                        hdmi_writel(0x1002c,0x39dc5040);
                        hdmi_writel(0x10030,0x80084343);
                        hdmi_udelay(10000);
                        hdmi_writel(0x10034,0x00000001);
                        hdmi_writel(0x1002c,hdmi_readl(0x1002c)|0x02000000);
                        hdmi_udelay(100000);
                        tmp = hdmi_readl(0x10038);
                        hdmi_writel(0x1002c,hdmi_readl(0x1002c)|0xC0000000);
                        hdmi_writel(0x1002c,hdmi_readl(0x1002c)|((tmp&0x1f800)>>11));
                        hdmi_writel(0x10020,0x01FFFF7F);
                        hdmi_writel(0x10024,0x8063b000);
                        hdmi_writel(0x10028,0x0F81C405);
                        break;
                case 11:
                        hdmi_writel(0x1002c,0x39dc5040);
                        hdmi_writel(0x10030,0x8008430a);
                        hdmi_udelay(10000);
                        hdmi_writel(0x10034,0x00000001);
                        hdmi_writel(0x1002c,hdmi_readl(0x1002c)|0x02000000);
                        hdmi_udelay(100000);
                        tmp = hdmi_readl(0x10038);
                        hdmi_writel(0x1002c,hdmi_readl(0x1002c)|0xC0000000);
                        hdmi_writel(0x1002c,hdmi_readl(0x1002c)|((tmp&0x1f800)>>11));
                        hdmi_writel(0x10020,0x01FFFF7F);
                        hdmi_writel(0x10024,0x8063b000);
                        hdmi_writel(0x10028,0x0F81C405);
                        break;
                default:
                        return -1;
        }
        return 0;
}


You need to log in before you can reply login | Register

Points Rule

Quick reply Top Return list