This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Linux/DRA742: Access TPS659038 over I2c

Part Number: DRA742
Other Parts Discussed in Thread: TPS659038-Q1, TPS659039-Q1

Tool/software: Linux

hi Ti ,

I want to access the TPS659038-Q1 over I2c1  and want to read the DESIGNREV Register (Address = 357h) [reset = X]. My Linux version 4.4.14 .

In current base , i can see :

i2cdetect -y -r 1
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: – – – – – – – – – – – – –
10: – – – – – – – – – – – – – – – –
20: – – – – – – – – – – – – – – – –
30: – – – – – – – – – – – – – – – –
40: – – – – – – – – – – – – – – – –
50: – 51 52 53 54 – – – – – – – – – – –
60: – – – – – – – – – – – – – – – –
70: – – – – – – – –

Let me know what will the slave address .

Even tried to read from drivers/regulator/palmas-regulator.c.

+static int palmas_rev_read(struct palmas *palmas, unsigned int reg,
+               unsigned int *dest)
+{


+       return regmap_read(palmas->regmap[REGULATOR_SLAVE], 0x357, dest);
+}

called from palmas_regulators_probe and print by below
Printk ("reg%d",reg );

The valus is showing as zero.

Let me know how to read the same.

Regards

Chinmoy

  • Hi,

    You should know the slave address from the schematics of the board.

    You cannot judge based on the i2cdetect output which of the device is the desired one.

    Regards,

    Nikhil D

  • Thank you Nikhil. I am checking internally in my team for the slave address.

    Sharing following points and request to check and share :

    1)

    In the meantime ,  I am trying another way : Even this value is zero .

    +static int palmas_rev_read(struct palmas *palmas, unsigned int reg,
    +               unsigned int *dest)
    +{


    +       return regmap_read(palmas->regmap[REGULATOR_SLAVE], 0x357, dest);
    +}

    called from palmas_regulators_probe and print by below
    Printk ("reg%d",dest

    *****

    2)

    I have attached swcu119b. pdf from TI and where is mentioned :

    As mentioned

    Register Address Mapping :
    This document describes the register mapping of the TPS659038-Q1 and TPS659039-Q1 devices. The
    operation of the IC is described in the device data sheet, TPS65903x-Q1 Automotive Power Management
    Unit (PMU) for Processor.
    The 3 hex digits of the physical address of the register indicated in this document are mapped as 0xPAA,
    while P stands for the page number of the register, and AA stands for the register address within the
    memory page. The page numbers are mapped to the slave device address as following:
    Page = 0x0 — Slave device address 0x12 for DVS registers
    Page = 0x1 — Slave device address 0x48 or 0x58 for power registers
    Page = 0x2 — Slave device address 0x49 or 0x59 for interface and auxiliary registers
    Page = 0x3 — Slave device address 0x4A or 0x5A for trimming and test registers
    Page = 0x4 — Slave device address 0x4B or 0x5B for OTP programming registers

    So if i need to read 0x357 that  means

    #i2cget -y 1 0x4a 0x57 or #i2cget -y 1 0x5a 0x57

    Could you please share your views.

    Regards

    Chinmoy

    swcu119b.pdf);

  • Hi Chinmoy,

    Based on the document you have shared, it appears that the slave address is selected out of 0x4a and 0x5a based on the ID_I2C1 field from the register I2C_SPI.

    Please check this field to decide the right slave address.

    Do you see both slaves enumerated when you run i2cdetect command?

    Regards,

    Nikhil D

  • I haven't heard back from you, I'm assuming you were able to resolve your issue.

    If not, just post a reply below (or create a new thread if the thread has locked due to time-out).