File tree Expand file tree Collapse file tree
src/board/system76/common Expand file tree Collapse file tree Original file line number Diff line number Diff line change 77#include <board/gpio.h>
88#include <board/kbled.h>
99#include <board/lid.h>
10- #include <board/peci.h>
1110#include <board/pwm.h>
1211#include <common/debug.h>
1312#include <common/macro.h>
1413
14+ #if CONFIG_PLATFORM_INTEL
15+ #include <board/peci.h>
16+ #endif
17+
1518#ifndef HAVE_LED_AIRPLANE_N
1619#define HAVE_LED_AIRPLANE_N 1
1720#endif // HAVE_LED_AIRPLANE_N
@@ -113,7 +116,9 @@ uint8_t acpi_read(uint8_t addr) {
113116 }
114117 break ;
115118
119+ #if CONFIG_PLATFORM_INTEL
116120 ACPI_8 (0x07 , peci_temp );
121+ #endif
117122
118123 // Handle AC adapter and battery present
119124 case 0x10 :
Original file line number Diff line number Diff line change @@ -14,7 +14,6 @@ board-common-y += keymap.c
1414board-common-y += lid.c
1515board-common-y += main.c
1616board-common-y += parallel.c
17- board-common-y += peci.c
1817board-common-y += pmc.c
1918board-common-y += pnp.c
2019board-common-y += ps2.c
@@ -42,8 +41,12 @@ CFLAGS+=-DLEVEL=4
4241# CFLAGS+=-DI2C_DEBUGGER=0x76
4342
4443ifeq ($(CONFIG_PLATFORM_INTEL ) ,y)
44+ board-common-y += peci.c
4545board-common-y += power/intel.c
4646CFLAGS += -DCONFIG_PLATFORM_INTEL=1
47+ else ifeq ($(CONFIG_PLATFORM_AMD),y)
48+ board-common-y += power/amd.c
49+ CFLAGS += -DCONFIG_PLATFORM_AMD=1
4750else
4851$(error PLATFORM not specified)
4952endif
Original file line number Diff line number Diff line change 22
33#include <board/fan.h>
44#include <board/dgpu.h>
5- #include <board/peci.h>
65#include <board/power.h>
76#include <common/debug.h>
87#include <common/macro.h>
98#include <ec/pwm.h>
109
10+ #if CONFIG_PLATFORM_INTEL
11+ #include <board/peci.h>
12+ #endif
13+
1114bool fan_max = false;
1215
1316uint8_t fan1_pwm_actual = 0 ;
@@ -195,11 +198,16 @@ static uint16_t fan_get_tach1_rpm(void) {
195198}
196199
197200void fan_event (void ) {
201+ #if CONFIG_PLATFORM_INTEL
198202#if CONFIG_HAVE_DGPU
199203 int16_t sys_temp = MAX (peci_temp , dgpu_temp );
200204#else
201205 int16_t sys_temp = peci_temp ;
202206#endif
207+ #elif CONFIG_PLATFORM_AMD
208+ // TODO: AMD SB-TSI temp
209+ int16_t sys_temp = 50 ;
210+ #endif
203211
204212 // Fan update interval is 100ms (main.c). The event changes PWM duty
205213 // by 1 every interval to give a smoothing effect.
Original file line number Diff line number Diff line change @@ -17,7 +17,6 @@ void power_init(void);
1717void power_on (void );
1818void power_off (void );
1919void power_cpu_reset (void );
20-
2120void power_event (void );
2221
2322#endif // _BOARD_POWER_H
Original file line number Diff line number Diff line change 1818#include <board/kbscan.h>
1919#include <board/keymap.h>
2020#include <board/lid.h>
21- #include <board/peci.h>
2221#include <board/pmc.h>
2322#include <board/power.h>
2423#include <board/ps2.h>
3130#include <common/version.h>
3231#include <ec/ec.h>
3332
33+ #if CONFIG_PLATFORM_INTEL
34+ #include <board/peci.h>
35+ #endif
36+
3437#ifdef PARALLEL_DEBUG
3538#include <board/parallel.h>
3639#endif // PARALLEL_DEBUG
@@ -73,7 +76,9 @@ void init(void) {
7376 kbscan_init ();
7477 }
7578 keymap_init ();
79+ #if CONFIG_PLATFORM_INTEL
7680 peci_init ();
81+ #endif
7782 pmc_init ();
7883 pwm_init ();
7984 smbus_init ();
@@ -140,7 +145,9 @@ void main(void) {
140145 if ((time - last_time_250ms ) >= INTERVAL_250MS ) {
141146 last_time_250ms = time ;
142147
148+ #if CONFIG_PLATFORM_INTEL
143149 peci_read_temp ();
150+ #endif
144151 dgpu_read_temp ();
145152 }
146153
Original file line number Diff line number Diff line change 1+ // SPDX-License-Identifier: GPL-3.0-only
2+
3+ #include <board/power.h>
4+
5+ enum PowerState power_state = POWER_STATE_OFF ;
6+
7+ void update_power_state (void ) {}
8+ void power_init (void ) {}
9+ void power_on (void ) {}
10+ void power_off (void ) {}
11+ void power_cpu_reset (void ) {}
12+ void power_event (void ) {}
Original file line number Diff line number Diff line change 11// SPDX-License-Identifier: GPL-3.0-only
22
3+ #include <board/power.h>
4+
35#include <arch/delay.h>
46#include <arch/time.h>
57#include <board/acpi.h>
1214#include <board/kbled.h>
1315#include <board/lid.h>
1416#include <board/peci.h>
15- #include <board/power.h>
1617#include <board/pmc.h>
1718#include <board/pnp.h>
1819#include <board/wireless.h>
You can’t perform that action at this time.
0 commit comments