Skip to content

Commit 71d23f9

Browse files
committed
Merge branch 'master' into hx20
2 parents 0badc06 + 4d7e278 commit 71d23f9

File tree

837 files changed

+49250
-11529
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

837 files changed

+49250
-11529
lines changed

Makefile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,7 @@ include driver/build.mk
262262
include fuzz/build.mk
263263
include power/build.mk
264264
-include private/build.mk
265+
-include private-kandou/build.mk
265266
ifneq ($(PDIR),)
266267
include $(PDIR)/build.mk
267268
endif
@@ -285,6 +286,7 @@ all-obj-$(1)+=$(call objs_from_dir_p,chip/$(CHIP),chip,$(1))
285286
all-obj-$(1)+=$(call objs_from_dir_p,$(BASEDIR),baseboard,$(1))
286287
all-obj-$(1)+=$(call objs_from_dir_p,$(BDIR),board,$(1))
287288
all-obj-$(1)+=$(call objs_from_dir_p,private,private,$(1))
289+
all-obj-$(1)+=$(call objs_from_dir_p,private-kandou,private-kandou,$(1))
288290
ifneq ($(PDIR),)
289291
all-obj-$(1)+=$(call objs_from_dir_p,$(PDIR),$(PDIR),$(1))
290292
endif
@@ -310,7 +312,7 @@ $(eval $(call get_sources,ro))
310312

311313
dirs=core/$(CORE) chip/$(CHIP) $(BASEDIR) $(BDIR) common fuzz power test \
312314
cts/common cts/$(CTS_MODULE) $(out)/gen
313-
dirs+= private $(PDIR) $(PBDIR)
315+
dirs+= private private-kandou $(PDIR) $(PBDIR)
314316
dirs+=$(shell find common -type d)
315317
dirs+=$(shell find driver -type d)
316318
common_dirs=util

Makefile.rules

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -198,10 +198,13 @@ build_boards: | $(FAILED_BOARDS_DIR)
198198
@rm -f $(FAILED_BOARDS_DIR)/*
199199
$(MAKE) try_build_boards
200200

201-
.PHONY: buildall
202-
buildall: build_boards build_cros_ec_commands
201+
.PHONY: buildall_only
202+
buildall_only: build_boards build_cros_ec_commands
203203
$(MAKE) build_cts
204204
$(MAKE) buildfuzztests
205+
206+
.PHONY: buildall
207+
buildall: buildall_only
205208
$(MAKE) runtests
206209
@touch .tests-passed
207210
@echo "$@ completed successfully!"
@@ -408,10 +411,10 @@ ifeq ($(V),0)
408411
cmd_size=
409412
else
410413
cmd_size=$(Q)awk '\
411-
/__image_size =/ {image_size = strtonum($$1)} \
414+
/__flash_used =/ {flash_used = strtonum($$1)} \
412415
/^FLASH/ {flash_size = strtonum($$3)} \
413416
/__ram_free =/ {ram_free = strtonum($$1)} \
414-
END {room_free = flash_size - image_size; \
417+
END {room_free = flash_size - flash_used; \
415418
print ram_free > "$(out)/$(1)/space_free_ram.txt"; \
416419
printf " *** "; \
417420
if (flash_size > 0) { \

PRESUBMIT.cfg

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ tab_check: false
1212
checkpatch_check: --no-tree --ignore=MSLEEP,VOLATILE,SPDX_LICENSE_TAG
1313
kerneldoc_check: --include_regex=\bec_commands\.h$
1414

15+
cros_license_check :
16+
--exclude_regex=^third_party/linux/
17+
1518
[Hook Scripts]
1619
presubmit_check = util/presubmit_check.sh
1720
config_option_check = util/config_option_check.py

baseboard/dedede/baseboard.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,10 @@ DECLARE_HOOK(HOOK_CHIPSET_SHUTDOWN, baseboard_chipset_shutdown,
229229

230230
void board_hibernate_late(void)
231231
{
232+
/* Disable any pull-ups on C0 and C1 interrupt lines */
233+
gpio_set_flags(GPIO_USB_C0_INT_ODL, GPIO_INPUT);
234+
gpio_set_flags(GPIO_USB_C1_INT_ODL, GPIO_INPUT);
235+
232236
/*
233237
* Turn on the Z state. This will not return as it will cut power to
234238
* the EC.

baseboard/dedede/baseboard.h

Lines changed: 12 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -26,16 +26,12 @@
2626
/* NPCX7 config */
2727
#define NPCX_UART_MODULE2 1 /* GPIO64/65 are used as UART pins. */
2828
#define NPCX_TACH_SEL2 0 /* No tach. */
29-
#define NPCX7_PWM1_SEL 1 /* GPIO C2 is used as PWM1. */
3029

3130
/* Internal SPI flash on NPCX7 */
3231
#define CONFIG_FLASH_SIZE (512 * 1024)
3332
#define CONFIG_SPI_FLASH_REGS
3433
#define CONFIG_SPI_FLASH_W25Q80 /* Internal SPI flash type. */
3534
#elif defined(VARIANT_DEDEDE_EC_IT8320)
36-
/* Flash clock must be > (50Mhz / 2) */
37-
#define CONFIG_IT83XX_FLASH_CLOCK_48MHZ
38-
3935
#define I2C_PORT_EEPROM IT83XX_I2C_CH_A
4036
#define I2C_PORT_BATTERY IT83XX_I2C_CH_B
4137
#define I2C_PORT_SENSOR IT83XX_I2C_CH_C
@@ -46,7 +42,8 @@
4642

4743
#define CONFIG_ADC_VOLTAGE_COMPARATOR /* ITE ADC thresholds */
4844

49-
#define CONFIG_DAC /* DAC for PSYS */
45+
#undef CONFIG_UART_TX_BUF_SIZE /* UART */
46+
#define CONFIG_UART_TX_BUF_SIZE 4096
5047
#else
5148
#error "Must define a VARIANT_DEDEDE_EC!"
5249
#endif
@@ -85,6 +82,13 @@
8582
/* Work around double CR50 reset by waiting in initial power on. */
8683
#define CONFIG_BOARD_RESET_AFTER_POWER_ON
8784

85+
/* Optional console commands */
86+
#define CONFIG_CMD_CHARGER_DUMP
87+
88+
/* Enable AP Reset command for TPM with old firmware version to detect it. */
89+
#define CONFIG_CMD_AP_RESET_LOG
90+
#define CONFIG_HOSTCMD_AP_RESET
91+
8892
/* Enable i2ctrace command */
8993
#define CONFIG_I2C_DEBUG
9094

@@ -106,6 +110,7 @@
106110
/* Battery */
107111
#define CONFIG_BATTERY_CUT_OFF
108112
#define CONFIG_BATTERY_PRESENT_GPIO GPIO_EC_BATTERY_PRES_ODL
113+
#define CONFIG_BATTERY_REQUESTS_NIL_WHEN_DEAD
109114
#define CONFIG_BATTERY_REVIVE_DISCONNECT
110115
#define CONFIG_BATTERY_SMART
111116

@@ -121,9 +126,9 @@
121126
/* Charger */
122127
#define CONFIG_CHARGE_MANAGER
123128
#define CONFIG_CHARGER
129+
#define CONFIG_CHARGER_DISCHARGE_ON_AC
124130
#define CONFIG_CHARGER_INPUT_CURRENT 256
125131
#define CONFIG_CHARGER_MIN_BAT_PCT_FOR_POWER_ON 1
126-
#define CONFIG_CHARGER_MIN_POWER_MW_FOR_POWER_ON 15001
127132
#define CONFIG_USB_CHARGER
128133
#define CONFIG_TRICKLE_CHARGING
129134

@@ -138,9 +143,6 @@
138143
/* LED */
139144
#define CONFIG_LED_COMMON
140145

141-
/* PWM */
142-
#define CONFIG_PWM
143-
144146
/* SoC */
145147
#define CONFIG_BOARD_HAS_RTC_RESET
146148
#define CONFIG_CHIPSET_JASPERLAKE
@@ -170,21 +172,14 @@
170172
#define CONFIG_USB_PD_TCPM_MUX
171173
#define CONFIG_USB_PD_TCPM_TCPCI
172174
#define CONFIG_USB_PD_TRY_SRC
173-
/*
174-
* Don't attempt Try.Src if the battery is too low. Even batteries which report
175-
* 1% state of charge can sometimes disable their discharge FET if the load is
176-
* too much. Therefore, set this threshold a bit higher. 5% should leave
177-
* plenty of margin.
178-
*/
179-
#undef CONFIG_USB_PD_TRY_SRC_MIN_BATT_SOC
180-
#define CONFIG_USB_PD_TRY_SRC_MIN_BATT_SOC 5
181175
/* #define CONFIG_USB_PD_VBUS_DETECT_CHARGER */
182176
#define CONFIG_USB_PD_VBUS_MEASURE_CHARGER
183177
#define CONFIG_USB_PD_DECODE_SOP
184178
#define CONFIG_USB_PID 0x5042
185179
#define CONFIG_USB_POWER_DELIVERY
186180
#define CONFIG_USB_PD_TCPMV2
187181
#define CONFIG_USB_DRP_ACC_TRYSRC
182+
#define CONFIG_HOSTCMD_PD_CONTROL
188183

189184
/* UART COMMAND */
190185
#define CONFIG_CMD_CHARGEN

baseboard/dedede/cbi_fw_config.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,3 +44,9 @@ enum fw_config_tablet_mode_type get_cbi_fw_config_tablet_mode(void)
4444
return ((cached_fw_config & FW_CONFIG_TABLET_MODE_MASK)
4545
>> FW_CONFIG_TABLET_MODE_OFFSET);
4646
}
47+
48+
int get_cbi_fw_config_keyboard(void)
49+
{
50+
return ((cached_fw_config & FW_CONFIG_KB_LAYOUT_MASK)
51+
>> FW_CONFIG_KB_LAYOUT_OFFSET);
52+
}

baseboard/dedede/cbi_fw_config.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,13 @@ enum fw_config_tablet_mode_type {
4343
#define FW_CONFIG_TABLET_MODE_OFFSET 10
4444
#define FW_CONFIG_TABLET_MODE_MASK GENMASK(10, 10)
4545

46+
#define FW_CONFIG_KB_LAYOUT_OFFSET 12
47+
#define FW_CONFIG_KB_LAYOUT_MASK GENMASK(13, 12)
48+
4649
enum fw_config_db get_cbi_fw_config_db(void);
4750
enum fw_config_kblight_type get_cbi_fw_config_kblight(void);
4851
enum fw_config_tablet_mode_type get_cbi_fw_config_tablet_mode(void);
4952

53+
int get_cbi_fw_config_keyboard(void);
54+
5055
#endif /* _DEDEDE_CBI_FW_CONFIG__H_ */

baseboard/dedede/variant_ec_it8320.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
static void pp3300_a_pgood_low(void)
2222
{
23-
atomic_clear(&pp3300_a_pgood, 1);
23+
deprecated_atomic_clear_bits(&pp3300_a_pgood, 1);
2424

2525
/* Disable low interrupt while asserted */
2626
vcmp_enable(VCMP_SNS_PP3300_LOW, 0);
@@ -29,15 +29,15 @@ static void pp3300_a_pgood_low(void)
2929
vcmp_enable(VCMP_SNS_PP3300_HIGH, 1);
3030

3131
/*
32-
* Call power_signal_interrupt() with a dummy GPIO in order for the
32+
* Call power_signal_interrupt() with a fake GPIO in order for the
3333
* chipset task to pick up the change in power sequencing signals.
3434
*/
3535
power_signal_interrupt(GPIO_PG_EC_DSW_PWROK);
3636
}
3737

3838
static void pp3300_a_pgood_high(void)
3939
{
40-
atomic_or(&pp3300_a_pgood, 1);
40+
deprecated_atomic_or(&pp3300_a_pgood, 1);
4141

4242
/* Disable high interrupt while asserted */
4343
vcmp_enable(VCMP_SNS_PP3300_HIGH, 0);
@@ -46,7 +46,7 @@ static void pp3300_a_pgood_high(void)
4646
vcmp_enable(VCMP_SNS_PP3300_LOW, 1);
4747

4848
/*
49-
* Call power_signal_interrupt() with a dummy GPIO in order for the
49+
* Call power_signal_interrupt() with a fake GPIO in order for the
5050
* chipset task to pick up the change in power sequencing signals.
5151
*/
5252
power_signal_interrupt(GPIO_PG_EC_DSW_PWROK);
@@ -76,7 +76,7 @@ BUILD_ASSERT(ARRAY_SIZE(vcmp_list) == VCMP_COUNT);
7676
/* I2C Ports */
7777
const struct i2c_port_t i2c_ports[] = {
7878
{
79-
"eeprom", I2C_PORT_EEPROM, 1000, GPIO_EC_I2C_EEPROM_SCL,
79+
"eeprom", I2C_PORT_EEPROM, 400, GPIO_EC_I2C_EEPROM_SCL,
8080
GPIO_EC_I2C_EEPROM_SDA
8181
},
8282

baseboard/dedede/variant_ec_npcx796fc.c

Lines changed: 4 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@
1616
#include "i2c.h"
1717
#include "lid_switch.h"
1818
#include "power.h"
19-
#include "pwm.h"
20-
#include "pwm_chip.h"
2119
#include "registers.h"
2220
#include "task.h"
2321
#include "timer.h"
@@ -28,31 +26,31 @@
2826

2927
void pp3300_a_pgood_high(void)
3028
{
31-
atomic_or(&pp3300_a_pgood, 1);
29+
deprecated_atomic_or(&pp3300_a_pgood, 1);
3230

3331
/* Disable this interrupt while it's asserted. */
3432
npcx_adc_thresh_int_enable(NPCX_ADC_THRESH1, 0);
3533
/* Enable the voltage low interrupt. */
3634
npcx_adc_thresh_int_enable(NPCX_ADC_THRESH2, 1);
3735

3836
/*
39-
* Call power_signal_interrupt() with a dummy GPIO in order for the
37+
* Call power_signal_interrupt() with a fake GPIO in order for the
4038
* chipset task to pick up the change in power sequencing signals.
4139
*/
4240
power_signal_interrupt(GPIO_PG_EC_DSW_PWROK);
4341
}
4442

4543
void pp3300_a_pgood_low(void)
4644
{
47-
atomic_clear(&pp3300_a_pgood, 1);
45+
deprecated_atomic_clear_bits(&pp3300_a_pgood, 1);
4846

4947
/* Disable this interrupt while it's asserted. */
5048
npcx_adc_thresh_int_enable(NPCX_ADC_THRESH2, 0);
5149
/* Enable the voltage high interrupt. */
5250
npcx_adc_thresh_int_enable(NPCX_ADC_THRESH1, 1);
5351

5452
/*
55-
* Call power_signal_interrupt() with a dummy GPIO in order for the
53+
* Call power_signal_interrupt() with a fake GPIO in order for the
5654
* chipset task to pick up the change in power sequencing signals.
5755
*/
5856
power_signal_interrupt(GPIO_PG_EC_DSW_PWROK);
@@ -62,15 +60,13 @@ const struct npcx_adc_thresh_t adc_pp3300_a_pgood_high = {
6260
.adc_ch = ADC_VSNS_PP3300_A,
6361
.adc_thresh_cb = pp3300_a_pgood_high,
6462
.thresh_assert = 2700,
65-
.thresh_deassert = -1,
6663
};
6764

6865
const struct npcx_adc_thresh_t adc_pp3300_a_pgood_low = {
6966
.adc_ch = ADC_VSNS_PP3300_A,
7067
.adc_thresh_cb = pp3300_a_pgood_low,
7168
.lower_or_higher = 1,
7269
.thresh_assert = 600,
73-
.thresh_deassert = -1,
7470
};
7571

7672
static void set_up_adc_irqs(void)
@@ -190,24 +186,3 @@ const struct i2c_port_t i2c_ports[] = {
190186
};
191187
const unsigned int i2c_ports_used = ARRAY_SIZE(i2c_ports);
192188

193-
/* PWM channels. Must be in the exactly same order as in enum pwm_channel. */
194-
const struct pwm_t pwm_channels[] = {
195-
[PWM_CH_KBLIGHT] = {
196-
.channel = 3,
197-
.flags = PWM_CONFIG_DSLEEP,
198-
.freq = 10000,
199-
},
200-
201-
[PWM_CH_LED1_AMBER] = {
202-
.channel = 2,
203-
.flags = PWM_CONFIG_DSLEEP | PWM_CONFIG_ACTIVE_LOW,
204-
.freq = 2400,
205-
},
206-
207-
[PWM_CH_LED2_WHITE] = {
208-
.channel = 0,
209-
.flags = PWM_CONFIG_DSLEEP | PWM_CONFIG_ACTIVE_LOW,
210-
.freq = 2400,
211-
}
212-
};
213-
BUILD_ASSERT(ARRAY_SIZE(pwm_channels) == PWM_CH_COUNT);

baseboard/hatch/baseboard.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -343,9 +343,9 @@ void baseboard_mst_enable_control(enum mst_source src, int level)
343343
static uint32_t mst_input_levels;
344344

345345
if (level)
346-
atomic_or(&mst_input_levels, 1 << src);
346+
deprecated_atomic_or(&mst_input_levels, 1 << src);
347347
else
348-
atomic_clear(&mst_input_levels, 1 << src);
348+
deprecated_atomic_clear_bits(&mst_input_levels, 1 << src);
349349

350350
gpio_set_level(GPIO_EN_MST, mst_input_levels ? 1 : 0);
351351
}

0 commit comments

Comments
 (0)