Skip to content

Commit 6c9e542

Browse files
committed
Add Hi3536xV100 temp reading
1 parent cea5134 commit 6c9e542

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/hal/hisi/hal_hisi.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -519,6 +519,9 @@ static uint32_t hisi_reg_temp(uint32_t read_addr, int temp_bitness,
519519
// Temperature sensor (T-Sensor) control register
520520
#define EV300_MISC_CTRL45 0x120280B4
521521

522+
#define HI3536_PERI_PMC68 0x120e0110
523+
#define HI3536_PERI_PMC70 0x120e0118
524+
522525
static float hisi_get_temp() {
523526
float tempo;
524527
switch (chip_generation) {
@@ -552,6 +555,13 @@ static float hisi_get_temp() {
552555
hisi_reg_temp(EV300_MISC_CTRL47, 10, EV300_MISC_CTRL45, 0xC3200000);
553556
tempo = ((tempo - 117) / 798) * 165 - 40;
554557
break;
558+
case HISI_3536D:
559+
case HISI_3536C:
560+
// PMC70 bit[9:0]
561+
tempo =
562+
hisi_reg_temp(HI3536_PERI_PMC70, 10, HI3536_PERI_PMC68, 0x40000000);
563+
tempo = ((tempo - 125) / 806) * 165 - 40;
564+
break;
555565
default:
556566
return NAN;
557567
}

0 commit comments

Comments
 (0)