SATA temperature sensor on i.MX53 (AN4380)

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

SATA temperature sensor on i.MX53 (AN4380)

1,316件の閲覧回数
mfuzzey
Contributor I

Hi,

has anyone got the i.MX53 internal temperature sensor to work as described in AN4380?

Initially I could not access the PHY registers (the acknowledge bit was never set) but I found this was

because the SATA module did not have a clock (we haven't connected an external clock).

Blowing the fuse at 180C in fusebank 4 to set SATA_ALT_CLK_REF to 10 (internal USB Phy) fixed that

(I couldn't find another way to do it in software without blowing the fuse)

So I can now access the registers and implement the algorithm described in the application note.

The readings seem fairly stable but I get (at ambient temperature) m1=520 m2=683

Which, according to the formula in the AN is  -106.6 C

Something is clearly wrong...

Cheers,

Martin

ラベル(1)
0 件の賞賛
返信
5 返答(返信)

950件の閲覧回数
rambabu1
Contributor II

Hello,

I am facing similar issue of not able to get the clock for SATA block.

1. Even though i enabled SATA  block clock gating, all registers read as 0, i.e. clock for this block is not really enabled. How to verify that clock for this block is really coming or not, is there any status register i can check?

2. How to set an internal PLL clock to generate clock for SATA block. like i want to have 50 MHz clock for SATA block through one of 4 PLLs. Can somebody give an idea on this?

Regards,

Rambabu

0 件の賞賛
返信

951件の閲覧回数
YixingKong
Senior Contributor IV

Martin

This discussion is closed since no activity. If you still need help, please feel free to reply with an update to this discussion, or create another discussion.

Thanks,

Yixing

0 件の賞賛
返信

951件の閲覧回数
YixingKong
Senior Contributor IV

Martin

Had your issue got resolved? If yes, we are going to close the discussion in 3 days. If you still need help, please feel free to reply with an update to this discussion.

Thanks,
Yixing

0 件の賞賛
返信

951件の閲覧回数
BrilliantovKiri
Senior Contributor I

Hello, Martin!

Follow my function for get temperature from iMX53 SATA controller:

const char *file = "/sys/devices/platform/imx-ahci-hwmon/temp1_input";

int temperature_cpu(unsigned int *val)

{

    FILE *fd = NULL;

    char buf[7] = {0};

    if (NULL == val)

        return -1;

    fd = fopen(file, "r");

    if (NULL == fd)

        return -1;

    if (NULL == fgets(buf, 7, fd)) {

        fclose(fd);

        return -1;

    }

    fclose(fd);

    *val = (unsigned int)atoi(buf);

    return 0;

}

Hope this help you.

0 件の賞賛
返信

951件の閲覧回数
mfuzzey
Contributor I

Slight update. There was a bug - the values are actually m1=1290,  m2=1511 but that's even worst T=-173C

0 件の賞賛
返信