Access PMIC registers directly from APs in iMX8qm

cancel
Showing results for 
Search instead for 
Did you mean: 

Access PMIC registers directly from APs in iMX8qm

408 Views
Contributor I

The System Controller firmware API does not have support to access the I2C bus between SCU and the PMIC in iMX8qm. We need to be able to send commands to the PMIC from the Linux user space running in the APs, possibly via RPC call. We're especially interested in functions like

status_t i2c_write(..); and i2c_read(..) provided by the SCFW source code.

Is there a reasonable workaround that doesn't require kernel changes and adding extra commands to the SCU API?#

0 Kudos
6 Replies

18 Views
Contributor I

You can implemente your own ioctl in board.c in

sc_err_t board_ioctl(sc_rm_pt_t caller_pt, sc_rsrc_t mu, uint32_t *parm1, uint32_t *parm2, uint32_t *parm3);

and call such function from Linux.

0 Kudos

18 Views
Contributor III

Hi All,

Did anyone able to modify SCU I2C registers from AP with Linux, Even I want to perform write on address 0x4a (AMUX_SEL) to get appropriate pmic internal sensor value on AMUX_OUT of PMIC chip, running 

"pmic.w 0x09 0x4a  0x2e" on SCU UART works fine but I want make this work from AP with Linux. Any suggestion would be really helpful.

0 Kudos

18 Views
NXP TechSupport
NXP TechSupport

access may be performed with function dynamic_pmic_register_access() -
allows access to individual registers of the PMIC, described in
sect.16.14.3.6 dynamic_pmic_register_access() sc_fw_port.pdf document

included in SCFW Porting Kit

Best regards
igor

0 Kudos

18 Views
NXP TechSupport
NXP TechSupport

Hi mehdi

access to pmic with i2c is supported by scfw, please refer to attached ../mx8qm_mek/board.c

file from SCFW Porting Kit

pastedImage_1.jpg

Best regards
igor
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos

18 Views
Contributor I

Thanks for your reply. This doesn't however address our problem. We know the I2C communication with PMICs is managed and supported by the SCU firmware (in fsl_pmic.h file). We are interested in calling the I2C read/write routines from the application processors running Linux, somehow using the SCFW API and via an RPC call.

0 Kudos

18 Views
NXP TechSupport
NXP TechSupport

>We are interested in calling the I2C read/write routines from the application

>processors running Linux, somehow using the SCFW API and via an RPC call.

one can refer to sect.2.2 System Controller attached Linux Manual and Porting

Guide included in SCFW Porting Kit

In particular one can pay attention to below

pastedImage_1.jpg

https://community.nxp.com/docs/DOC-340335 

Best regards
igor

0 Kudos