Hi all,

I'm working on enabling TWI3 (I2C3) on the Allwinner T113-S3 (sun8iw20) in U-
Boot.

I set up the pinmux and clock for PG10/PG11 (function 3 for TWI3) using:

sunxi_gpio_set_cfgpin(SUNXI_GPG(10), SUN8I_GPG_TWI3);
sunxi_gpio_set_cfgpin(SUNXI_GPG(11), SUN8I_GPG_TWI3);
clock_twi_onoff(3, 1);

I also added the missing macro:

#define SUN8I_GPG_TWI3 3

This works fine if I call it in board_late_init(), but if I set it earlier 
(e.g., i2c_init_board() or board_init()), the PG10/PG11 mux settings get 
overwritten or cleared later on.

I verified the pinctrl register at 0x01C20824 (for PG10/PG11) is reset to 
0xFFFFFFFF unless I reapply it in board_late_init(). Curiously, this does not 
happen to nearby ports like PG0–PG7 (0x01C20820), which remain intact.

Is there some known U-Boot path that resets PG10/PG11 mux early on T113-S3?

Best regards,
Lukas Schmid

Attachment: signature.asc
Description: This is a digitally signed message part.

Reply via email to