Po Xu has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/46390 )
Change subject: soc/mediatek/mt8192: Add auxadc driver ......................................................................
Patch Set 12:
(2 comments)
https://review.coreboot.org/c/coreboot/+/46390/4//COMMIT_MSG Commit Message:
https://review.coreboot.org/c/coreboot/+/46390/4//COMMIT_MSG@10 PS4, Line 10:
What is AUXADC, and what is the name and revision of the datasheet?
AUXADC: auxiliary analogue-to-digital conversion The auxiliary ADC unit is used to identify the plugged peripheral and perform temperature/voltage measurement.
Reference datasheet: AUXADC.pdf
https://review.coreboot.org/c/coreboot/+/46390/4/src/soc/mediatek/mt8192/aux... File src/soc/mediatek/mt8192/auxadc.c:
https://review.coreboot.org/c/coreboot/+/46390/4/src/soc/mediatek/mt8192/aux... PS4, Line 41: setbits32(&mt8192_infracfg->module_sw_cg_1_clr, 1 << 10); : assert(wait_ms(300, !(read32(&mtk_auxadc->con2) & 0x1))); : : clrbits32(&mtk_auxadc->con1, 1 << channel); : assert(wait_ms(300, !(read32(&mtk_auxadc->data[channel]) & (1 << 12)))); : : setbits32(&mtk_auxadc->con1, 1 << channel); : udelay(25); : assert(wait_ms(300, read32(&mtk_auxadc->data[channel]) & (1 << 12)));
300 ms time-out sound too much for coreboot. […]
First of all, wait_ms() will only delay 300ms in the worst case. If there is a 300ms delay, it means that auxadc has a problem or is blocked. Normally, there is no need to delay, and you can check that the busy bit or ready bit meets the sampling conditions. (Occasionally there may be a delay of 1~2ms), so you don’t need to worry about it delaying 300ms.
About 300ms delay is the recommended time given by designer.