GoogleGit

blob: ad1dba54dff64aac6a3397e459d5a5af8b03f64e [file] [log] [blame]
  1. /* Copyright (c) 2014 The Chromium OS Authors. All rights reserved.
  2. * Use of this source code is governed by a BSD-style license that can be
  3. * found in the LICENSE file.
  4. */
  5. /*
  6. * config.h - Top-level configuration Chrome EC
  7. *
  8. * All configuration settings (CONFIG_*) are defined in this file or in a
  9. * sub-configuration file (config_chip.h, board.h, etc.) included by this file.
  10. *
  11. * Note that this file is included by assembly (.S) files. Any C-isms such as
  12. * struct definitions or enums in a sub-configuration file MUST be guarded with
  13. * #ifndef __ASSEMBLER__ to prevent those C-isms from being evaluated by the
  14. * assembler.
  15. */
  16. #ifndef __CROS_EC_CONFIG_H
  17. #define __CROS_EC_CONFIG_H
  18. /*
  19. * All config options are listed alphabetically and described here.
  20. *
  21. * If you add a new config option somewhere in the code, you must add a
  22. * default value here and describe what it does.
  23. *
  24. * To get a list current list, run this command:
  25. * git grep " CONFIG_" | grep -o "CONFIG_[A-Za-z0-9_]\+" | sort | uniq
  26. *
  27. * Some options are #defined here to enable them by default. Chips or boards
  28. * may override this by #undef'ing them in config_chip.h or board.h,
  29. * respectively.
  30. *
  31. * TODO(crosbug.com/p/23758): Describe all of these. Also describe the
  32. * HAS_TASK_* macro and how/when it should be used vs. a config define. And
  33. * BOARD_*, CHIP_*, and CHIP_FAMILY_*.
  34. */
  35. /* Enable accelerometer interrupts. */
  36. #undef CONFIG_ACCEL_INTERRUPTS
  37. /* Specify type of accelerometers attached. */
  38. #undef CONFIG_ACCEL_KXCJ9
  39. /* Compile chip support for analog-to-digital convertor */
  40. #undef CONFIG_ADC
  41. /*
  42. * ADC module has certain clock requirement. If this is defined, the ADC module
  43. * should call clock_enable_module() to configure clock for ADC.
  44. */
  45. #undef CONFIG_ADC_CLOCK
  46. /* ADC sample time selection. The value is chip-dependent. */
  47. #undef CONFIG_ADC_SAMPLE_TIME
  48. /*
  49. * Some ALS modules may be connected to the EC. We need the command, and
  50. * specific drivers for each module.
  51. */
  52. #undef CONFIG_ALS
  53. #undef CONFIG_ALS_ISL29035
  54. /* Support AP hang detection host command and state machine */
  55. #undef CONFIG_AP_HANG_DETECT
  56. /*
  57. * Support controlling the display backlight based on the state of the lid
  58. * switch. The EC will disable the backlight when the lid is closed.
  59. */
  60. #undef CONFIG_BACKLIGHT_LID
  61. /*
  62. * If defined, EC will enable the backlight signal only if this GPIO is
  63. * asserted AND the lid is open. This supports passing the backlight-enable
  64. * signal from the AP through EC.
  65. */
  66. #undef CONFIG_BACKLIGHT_REQ_GPIO
  67. /*****************************************************************************/
  68. /* Battery config */
  69. /*
  70. * Compile battery-specific code. Choose at most one.
  71. *
  72. * Note that some boards have their own unique battery constants / functions.
  73. * In this case, those are provided in board/(boardname)/battery.c, and none of
  74. * these are defined.
  75. */
  76. #undef CONFIG_BATTERY_BQ20Z453 /* BQ20Z453 battery used on some ARM laptops */
  77. #undef CONFIG_BATTERY_BQ27541 /* BQ27541 battery */
  78. #undef CONFIG_BATTERY_LINK /* Battery used on Link */
  79. /* Compile mock battery support; used by tests. */
  80. #undef CONFIG_BATTERY_MOCK
  81. /*
  82. * Charger should call battery_override_params() to limit/correct the voltage
  83. * and current requested by the battery pack before acting on the request.
  84. *
  85. * This is valid with CONFIG_CHARGER_V1 only.
  86. */
  87. #undef CONFIG_BATTERY_OVERRIDE_PARAMS
  88. /*
  89. * If defined, the charger will check for battery presence before attempting
  90. * to communicate with it. This avoids the 30 second delay when booting
  91. * without a battery present. Do not use with CONFIG_BATTERY_PRESENT_GPIO.
  92. *
  93. * Replace the default battery_is_present() function with a board-specific
  94. * implementation in board.c
  95. */
  96. #undef CONFIG_BATTERY_PRESENT_CUSTOM
  97. /*
  98. * If defined, GPIO which is driven low when battery is present.
  99. * Charger will check for battery presence before attempting to communicate
  100. * with it. This avoids the 30 second delay when booting without a battery
  101. * present. Do not use with CONFIG_BATTERY_PRESENT_CUSTOM.
  102. */
  103. #undef CONFIG_BATTERY_PRESENT_GPIO
  104. /*
  105. * Compile smart battery support
  106. *
  107. * For batteries which support this specification:
  108. * http://sbs-forum.org/specs/sbdat110.pdf)
  109. */
  110. #undef CONFIG_BATTERY_SMART
  111. /*
  112. * Critical battery shutdown timeout (seconds)
  113. *
  114. * If the battery is at extremely low charge (and discharging) or extremely
  115. * high temperature, the EC will shut itself down. This defines the timeout
  116. * period in seconds between the critical condition being detected and the
  117. * EC shutting itself down. Note that if the critical condition is corrected
  118. * before the timeout expiration, the EC will not shut itself down.
  119. *
  120. */
  121. #define CONFIG_BATTERY_CRITICAL_SHUTDOWN_TIMEOUT 30
  122. /*
  123. * Support battery cut-off as host command and console command.
  124. *
  125. * Once defined, you have to implement a board_cut_off_battery() function
  126. * in board/???/battery.c file.
  127. */
  128. #undef CONFIG_BATTERY_CUT_OFF
  129. /*
  130. * The default delay is 1 second. Define this if a board prefers
  131. * different delay.
  132. */
  133. #undef CONFIG_BATTERY_CUTOFF_DELAY_US
  134. /*
  135. * The board-specific battery.c implements get and set functions to read and
  136. * write arbirary vendor-specific parameters stored in the battery.
  137. * See include/battery.h for prototypes.
  138. */
  139. #undef CONFIG_BATTERY_VENDOR_PARAM
  140. /*
  141. * TODO(crosbug.com/p/29467): allows charging of a dead battery that
  142. * requests nil for current and voltage. Remove this workaround when
  143. * possible.
  144. */
  145. #undef CONFIG_BATTERY_REQUESTS_NIL_WHEN_DEAD
  146. /*
  147. * Check for battery in disconnect state (similar to cut-off state). If this
  148. * battery is found to be in disconnect state, take it out of this state by
  149. * force-applying a charge current.
  150. */
  151. #undef CONFIG_BATTERY_REVIVE_DISCONNECT
  152. /*****************************************************************************/
  153. /*
  154. * Call board_config_post_gpio_init() after GPIOs are initialized. See
  155. * include/board_config.h for more information.
  156. */
  157. #undef CONFIG_BOARD_POST_GPIO_INIT
  158. /*
  159. * Call board_config_pre_init() before any inits are called. See
  160. * include/board_config.h for more information.
  161. */
  162. #undef CONFIG_BOARD_PRE_INIT
  163. /* EC has GPIOs attached to board version stuffing resistors */
  164. #undef CONFIG_BOARD_VERSION
  165. /* Permanent LM4 boot configuration */
  166. #undef CONFIG_BOOTCFG_VALUE
  167. /*****************************************************************************/
  168. /* Modify the default behavior to make system bringup easier. */
  169. #undef CONFIG_BRINGUP
  170. /*****************************************************************************/
  171. /*
  172. * Number of extra buttons not on the keyboard scan matrix. Doesn't include
  173. * the power button, which has its own handler.
  174. */
  175. #undef CONFIG_BUTTON_COUNT
  176. /*
  177. * Enable case close debug (CCD) mode.
  178. */
  179. #undef CONFIG_CASE_CLOSED_DEBUG
  180. /*
  181. * Capsense chip has buttons, too.
  182. */
  183. #undef CONFIG_CAPSENSE
  184. /*****************************************************************************/
  185. /* Compile charge manager */
  186. #undef CONFIG_CHARGE_MANAGER
  187. /* Compile input current ramping support */
  188. #undef CONFIG_CHARGE_RAMP
  189. /*****************************************************************************/
  190. /* Charger config */
  191. /* Compile common charge state code. You must pick an implementation. */
  192. #undef CONFIG_CHARGER
  193. #undef CONFIG_CHARGER_V1
  194. #undef CONFIG_CHARGER_V2
  195. /* Compile charger-specific code for these chargers (pick at most one) */
  196. #undef CONFIG_CHARGER_BQ24707A
  197. #undef CONFIG_CHARGER_BQ24715
  198. #undef CONFIG_CHARGER_BQ24725
  199. #undef CONFIG_CHARGER_BQ24738
  200. #undef CONFIG_CHARGER_BQ24770
  201. #undef CONFIG_CHARGER_BQ24773
  202. #undef CONFIG_CHARGER_TPS65090 /* Note: does not use CONFIG_CHARGER */
  203. /*
  204. * Board specific charging current limit, in mA. If defined, the charge state
  205. * machine will not allow the battery to request more current than this.
  206. */
  207. #undef CONFIG_CHARGER_CURRENT_LIMIT
  208. /*
  209. * Board supports discharge mode. In this mode, the battery will discharge
  210. * even if AC is present. Used for testing.
  211. */
  212. #undef CONFIG_CHARGER_DISCHARGE_ON_AC
  213. /*
  214. * Board specific flag used to disable external ILIM pin used to determine input
  215. * current limit. When defined, the input current limit is decided only by
  216. * the software register value.
  217. */
  218. #undef CONFIG_CHARGER_ILIM_PIN_DISABLED
  219. /*
  220. * Maximum amount of input current the charger can receive, in mA.
  221. *
  222. * This value should depend on external power adapter, designed charging
  223. * voltage, and the maximum power of the running system.
  224. */
  225. #undef CONFIG_CHARGER_INPUT_CURRENT
  226. /*
  227. * Equivalent of CONFIG_BATTERY_OVERRIDE_PARAMS for use with
  228. * CONFIG_CHARGER_V2
  229. */
  230. #undef CONFIG_CHARGER_PROFILE_OVERRIDE
  231. /* Value of the charge sense resistor, in mOhms */
  232. #undef CONFIG_CHARGER_SENSE_RESISTOR
  233. /* Value of the input current sense resistor, in mOhms */
  234. #undef CONFIG_CHARGER_SENSE_RESISTOR_AC
  235. /*
  236. * Maximum time to charge the battery, in hours.
  237. *
  238. * If this timeout is reached, the charger will enter force-idle state.
  239. * If not defined, charger will provide current until the battery asks it to
  240. * stop.
  241. */
  242. #undef CONFIG_CHARGER_TIMEOUT_HOURS
  243. /*
  244. * Board has an GPIO pin to enable or disable charging.
  245. *
  246. * This GPIO should be named GPIO_CHARGER_EN, if active high. Or
  247. * GPIO_CHARGER_EN_L if active low.
  248. */
  249. #undef CONFIG_CHARGER_EN_GPIO
  250. /* Charger enable GPIO is active low */
  251. #undef CONFIG_CHARGER_EN_ACTIVE_LOW
  252. /*****************************************************************************/
  253. /* Chipset config */
  254. /* AP chipset support; pick at most one */
  255. #undef CONFIG_CHIPSET_BAYTRAIL /* Intel Bay Trail (x86) */
  256. #undef CONFIG_CHIPSET_GAIA /* Gaia and Ares (ARM) */
  257. #undef CONFIG_CHIPSET_HASWELL /* Intel Haswell (x86) */
  258. #undef CONFIG_CHIPSET_IVYBRIDGE /* Intel Ivy Bridge (x86) */
  259. #undef CONFIG_CHIPSET_ROCKCHIP /* Rockchip rk32xx */
  260. #undef CONFIG_CHIPSET_TEGRA /* nVidia Tegra 5 */
  261. #undef CONFIG_CHIPSET_BRASWELL /* Intel Braswell (x86) */
  262. /* Support chipset throttling */
  263. #undef CONFIG_CHIPSET_CAN_THROTTLE
  264. /* Enable additional chipset debugging */
  265. #undef CONFIG_CHIPSET_DEBUG
  266. /* Support power rail control */
  267. #define CONFIG_CHIPSET_HAS_PP1350
  268. #define CONFIG_CHIPSET_HAS_PP5000
  269. /*****************************************************************************/
  270. /*
  271. * Chip config for clock circuitry
  272. * define = crystal / undef = oscillator
  273. */
  274. #undef CONFIG_CLOCK_CRYSTAL
  275. /*****************************************************************************/
  276. /* PMIC config */
  277. /* Support firmware long press power-off timer */
  278. #undef CONFIG_PMIC_FW_LONG_PRESS_TIMER
  279. /*****************************************************************************/
  280. /*
  281. * Optional console commands
  282. *
  283. * Defining these options will enable the corresponding command on the EC
  284. * console.
  285. */
  286. #undef CONFIG_CMD_ACCELS
  287. #undef CONFIG_CMD_ACCEL_INFO
  288. #undef CONFIG_CMD_BATDEBUG
  289. #undef CONFIG_CMD_CHGRAMP
  290. #undef CONFIG_CMD_CLOCKGATES
  291. #undef CONFIG_CMD_COMXTEST
  292. #undef CONFIG_CMD_ECTEMP
  293. #undef CONFIG_CMD_FLASH
  294. #undef CONFIG_CMD_FORCETIME
  295. #undef CONFIG_CMD_GSV
  296. #define CONFIG_CMD_HASH
  297. #undef CONFIG_CMD_HOSTCMD
  298. #define CONFIG_CMD_I2C_SCAN
  299. #define CONFIG_CMD_I2C_XFER
  300. #define CONFIG_CMD_IDLE_STATS
  301. #undef CONFIG_CMD_ILIM
  302. #undef CONFIG_CMD_JUMPTAGS
  303. #define CONFIG_CMD_PD
  304. #undef CONFIG_CMD_PD_DEV_DUMP_INFO
  305. #undef CONFIG_CMD_PD_FLASH
  306. #undef CONFIG_CMD_PLL
  307. #undef CONFIG_CMD_PMU
  308. #define CONFIG_CMD_POWER_AP
  309. #define CONFIG_CMD_POWERINDEBUG
  310. #undef CONFIG_CMD_POWERLED
  311. #undef CONFIG_CMD_RTC_ALARM
  312. #undef CONFIG_CMD_SCRATCHPAD
  313. #define CONFIG_CMD_SHMEM
  314. #undef CONFIG_CMD_SLEEP
  315. #undef CONFIG_CMD_SPI_FLASH
  316. #undef CONFIG_CMD_STACKOVERFLOW
  317. #undef CONFIG_CMD_TASKREADY
  318. #define CONFIG_CMD_TYPEC
  319. #undef CONFIG_CMD_USB_PD_PE
  320. /*****************************************************************************/
  321. /* Provide common core code to output panic information without interrupts. */
  322. #define CONFIG_COMMON_PANIC_OUTPUT
  323. /*
  324. * Store a panic log and halt the system for a software-related reasons, such as
  325. * stack overflow or assertion failure.
  326. */
  327. #undef CONFIG_SOFTWARE_PANIC
  328. /*
  329. * Provide the default GPIO abstraction layer.
  330. * You want this unless you are doing a really tiny firmware.
  331. */
  332. #define CONFIG_COMMON_GPIO
  333. /*
  334. * Provides smaller GPIO names to reduce flash size. Instead of the 'name'
  335. * field in GPIO macro it will concat 'port' and 'pin' to reduce flash size.
  336. */
  337. #undef CONFIG_COMMON_GPIO_SHORTNAMES
  338. /*
  339. * Provide common runtime layer code (tasks, hooks ...)
  340. * You want this unless you are doing a really tiny firmware.
  341. */
  342. #define CONFIG_COMMON_RUNTIME
  343. /* Provide common core code to handle the operating system timers. */
  344. #define CONFIG_COMMON_TIMER
  345. /*****************************************************************************/
  346. /*
  347. * Provide additional help on console commands, such as the supported
  348. * options/usage.
  349. *
  350. * Boards may #undef this to reduce image size.
  351. */
  352. #define CONFIG_CONSOLE_CMDHELP
  353. /*
  354. * Number of entries in console history buffer.
  355. *
  356. * Boards may #undef this to reduce memory usage.
  357. */
  358. #define CONFIG_CONSOLE_HISTORY 8
  359. /* Max length of a single line of input */
  360. #define CONFIG_CONSOLE_INPUT_LINE_SIZE 80
  361. /*
  362. * Disable EC console input if the system is locked. This is needed for
  363. * security on platforms where the EC console is accessible from outside the
  364. * case - for example, via a special USB dongle.
  365. */
  366. #undef CONFIG_CONSOLE_RESTRICTED_INPUT
  367. /* Include CRC-8 utility function */
  368. #undef CONFIG_CRC8
  369. /*****************************************************************************/
  370. /*
  371. * Debugging config
  372. *
  373. * Note that these options are enabled by default, because they're really
  374. * handy for debugging systems during bringup and even at factory time.
  375. *
  376. * A board may undefine any or all of these to reduce image size and RAM usage,
  377. * at the cost of debuggability.
  378. */
  379. /*
  380. * ASSERT() macros are checked at runtime. See CONFIG_DEBUG_ASSERT_REBOOTS
  381. * to see what happens if one fails.
  382. *
  383. * Boards may #undef this to reduce image size.
  384. */
  385. #define CONFIG_DEBUG_ASSERT
  386. /*
  387. * Prints a message and reboots if an ASSERT() macro fails at runtime. When
  388. * enabled, an ASSERT() which fails will produce a message of the form:
  389. *
  390. * ASSERTION FAILURE '<expr>' in function() at file:line
  391. *
  392. * If this is not defined, failing ASSERT() will trigger a BKPT instruction
  393. * instead.
  394. *
  395. * Ignored if CONFIG_DEBUG_ASSERT is not defined.
  396. *
  397. * Boards may #undef this to reduce image size.
  398. */
  399. #define CONFIG_DEBUG_ASSERT_REBOOTS
  400. /*
  401. * On assertion failure, prints only the file name and the line number.
  402. *
  403. * Ignored if CONFIG_DEBUG_ASSERT_REBOOTS is not defined.
  404. *
  405. * Boards may define this to reduce image size.
  406. */
  407. #undef CONFIG_DEBUG_ASSERT_BRIEF
  408. /*
  409. * Disable the write buffer used for default memory map accesses.
  410. * This turns "Imprecise data bus errors" into "Precise" errors
  411. * in exception traces at the cost of some performance.
  412. * This may help identify the offending instruction causing an
  413. * exception. Supported on cortex-m.
  414. */
  415. #undef CONFIG_DEBUG_DISABLE_WRITE_BUFFER
  416. /*
  417. * Print additional information when exceptions are triggered, such as the
  418. * fault address, here shown as bfar. This shows the reason for the fault
  419. * and may help to determine the cause.
  420. *
  421. * === EXCEPTION: 03 ====== xPSR: 01000000 ===========
  422. * r0 :0000000b r1 :00000047 r2 :60000000 r3 :200013dd
  423. * r4 :00000000 r5 :080053f4 r6 :200013d0 r7 :00000002
  424. * r8 :00000000 r9 :200013de r10:00000000 r11:00000000
  425. * r12:00000000 sp :200009a0 lr :08002b85 pc :08003a8a
  426. * Precise data bus error, Forced hard fault, Vector catch, bfar = 60000000
  427. * mmfs = 00008200, shcsr = 00000000, hfsr = 40000000, dfsr = 00000008
  428. *
  429. * If this is not defined, only a register dump will be printed.
  430. *
  431. * Boards may #undef this to reduce image size.
  432. */
  433. #define CONFIG_DEBUG_EXCEPTIONS
  434. /* Check for stack overflows on every context switch */
  435. #define CONFIG_DEBUG_STACK_OVERFLOW
  436. /*****************************************************************************/
  437. /* Support DMA transfers inside the EC */
  438. #undef CONFIG_DMA
  439. /* Use the common interrupt handlers for DMA IRQs */
  440. #define CONFIG_DMA_DEFAULT_HANDLERS
  441. /* Compile extra debugging and tests for the DMA module */
  442. #undef CONFIG_DMA_HELP
  443. /* Support EC chip internal data EEPROM */
  444. #undef CONFIG_EEPROM
  445. /*
  446. * Compile the eoption module, which provides a higher-level interface to
  447. * options stored in internal data EEPROM.
  448. */
  449. #undef CONFIG_EOPTION
  450. /* Include code for handling external power */
  451. #define CONFIG_EXTPOWER
  452. /* Support turbo-mode chargers */
  453. #undef CONFIG_EXTPOWER_FALCO
  454. /* Support detecting external power presence via a GPIO */
  455. #undef CONFIG_EXTPOWER_GPIO
  456. /*
  457. * Support detecting external power presence via a pair of GPIOs, as used
  458. * on Snow.
  459. */
  460. #undef CONFIG_EXTPOWER_SNOW
  461. /* Support providing power to the device via USB on Spring. */
  462. #undef CONFIG_EXTPOWER_SPRING
  463. /*****************************************************************************/
  464. /* Number of cooling fans. Undef if none. */
  465. #undef CONFIG_FANS
  466. /*
  467. * Replace the default fan_percent_to_rpm() function with a board-specific
  468. * implementation in board.c
  469. */
  470. #undef CONFIG_FAN_RPM_CUSTOM
  471. /*
  472. * We normally check and update the fans once per second (HOOK_SECOND). If this
  473. * is #defined to a postive integer N, we will only update the fans every N
  474. * seconds instead.
  475. */
  476. #undef CONFIG_FAN_UPDATE_PERIOD
  477. /*****************************************************************************/
  478. /* Flash configuration */
  479. /* Support programming on-chip flash */
  480. #define CONFIG_FLASH
  481. #undef CONFIG_FLASH_BANK_SIZE
  482. #undef CONFIG_FLASH_BASE
  483. #undef CONFIG_FLASH_ERASED_VALUE32
  484. #undef CONFIG_FLASH_ERASE_SIZE
  485. /*
  486. * Flash is directly mapped into the EC's address space. If this is not
  487. * defined, the flash driver must implement flash_physical_read().
  488. */
  489. #define CONFIG_FLASH_MAPPED
  490. #undef CONFIG_FLASH_PHYSICAL_SIZE
  491. #undef CONFIG_FLASH_PROTECT_NEXT_BOOT
  492. /*
  493. * Use a bank of flash to store its persistent write protect state. This
  494. * allows ECs with internal flash to emulate something closer to a SPI flash
  495. * write protect register. If this is not defined, write protect state is
  496. * maintained solely by the physical flash driver.
  497. */
  498. #define CONFIG_FLASH_PSTATE
  499. #undef CONFIG_FLASH_SIZE
  500. #undef CONFIG_FLASH_WRITE_IDEAL_SIZE
  501. #undef CONFIG_FLASH_WRITE_SIZE
  502. /*****************************************************************************/
  503. /* Include a flashmap in the compiled firmware image */
  504. #define CONFIG_FMAP
  505. /* Allow EC serial console input to wake up the EC from STOP mode */
  506. #undef CONFIG_FORCE_CONSOLE_RESUME
  507. /* Enable support for floating point unit */
  508. #undef CONFIG_FPU
  509. /*****************************************************************************/
  510. /* Firmware region configuration */
  511. #undef CONFIG_FW_IMAGE_SIZE
  512. #undef CONFIG_FW_PSTATE_OFF
  513. #undef CONFIG_FW_PSTATE_SIZE
  514. #undef CONFIG_FW_RO_OFF
  515. #undef CONFIG_FW_RO_SIZE
  516. #undef CONFIG_FW_RW_OFF
  517. #undef CONFIG_FW_RW_SIZE
  518. #undef CONFIG_FW_WP_RO_OFF
  519. #undef CONFIG_FW_WP_RO_SIZE
  520. /*
  521. * Board Image ec.bin contains a RO firmware. If not defined, the image will
  522. * only contain the RW firmware. The RO firmware comes from another board.
  523. */
  524. #define CONFIG_FW_INCLUDE_RO
  525. /*****************************************************************************/
  526. /* Motion sensor based gesture recognition information */
  527. #undef CONFIG_GESTURE_DETECTION
  528. #ifndef CONFIG_GESTURE_DETECTION
  529. /* Which sensor to look for gesture recognition */
  530. #undef CONFIG_SENSOR_BATTERY_TAP
  531. /* Sensor sampling interval for gesture recognition */
  532. #undef CONFIG_GESTURE_SAMPLING_INTERVAL_MS
  533. /*
  534. * Double tap detection parameters
  535. * Double tap works by looking for two isolated Z-axis accelerometer impulses
  536. * preceded and followed by relatively calm periods of accelerometer motion.
  537. *
  538. * Define an outer and inner window. The inner window specifies how
  539. * long the tap impulse is expected to last. The outer window specifies the
  540. * period before the initial tap impluse and after the final tap impulse for
  541. * which to check for relatively calm periods. In between the two impulses
  542. * there is a minimum and maximum interstice time allowed.
  543. */
  544. #undef CONFIG_GESTURE_TAP_OUTER_WINDOW_T
  545. #undef CONFIG_GESTURE_TAP_INNER_WINDOW_T
  546. #undef CONFIG_GESTURE_TAP_MIN_INTERSTICE_T
  547. #undef CONFIG_GESTURE_TAP_MAX_INTERSTICE_T
  548. #endif
  549. #undef CONFIG_LID_ANGLE
  550. #ifndef CONFIG_LID_ANGLE
  551. #undef CONFIG_SENSOR_BASE
  552. #undef CONFIG_SENSOR_LID
  553. /*
  554. * Allows using the lid angle measurement to determine if key scanning should
  555. * be enabled or disabled when chipset is suspended.
  556. */
  557. #undef CONFIG_LID_ANGLE_KEY_SCAN
  558. #endif
  559. /*****************************************************************************/
  560. /*
  561. * Support the host asking the EC about the status of the most recent host
  562. * command.
  563. *
  564. * When the AP is attached to the EC via a serialized bus such as I2C or SPI,
  565. * it needs a way to minimize the length of time an EC command will tie up the
  566. * bus (and the kernel driver on the AP). If this config is defined, the EC
  567. * may return an in-progress result code for slow commands such as flash
  568. * erase/write instead of stalling until the command finishes processing, and
  569. * the AP may then inquire the status of the current command and/or the result
  570. * of the previous command.
  571. */
  572. #undef CONFIG_HOST_COMMAND_STATUS
  573. /* If we have host command task, assume we also are using host events. */
  574. #ifdef HAS_TASK_HOSTCMD
  575. #define CONFIG_HOSTCMD_EVENTS
  576. #else
  577. #undef CONFIG_HOSTCMD_EVENTS
  578. #endif
  579. /*
  580. * For ECs where the host command interface is I2C, slave
  581. * address which the EC will respond to.
  582. */
  583. #undef CONFIG_HOSTCMD_I2C_SLAVE_ADDR
  584. /*
  585. * Host command rate limiting assures EC will have time to process lower
  586. * priority tasks even if the AP is hammering the EC with host commands.
  587. * If there is less than CONFIG_HOSTCMD_RATE_LIMITING_MIN_REST between
  588. * host commands for CONFIG_HOSTCMD_RATE_LIMITING_PERIOD, then a
  589. * recess period of CONFIG_HOSTCMD_RATE_LIMITING_RECESS will be
  590. * enforced.
  591. */
  592. #define CONFIG_HOSTCMD_RATE_LIMITING_PERIOD (500 * MSEC)
  593. #define CONFIG_HOSTCMD_RATE_LIMITING_MIN_REST (3 * MSEC)
  594. #define CONFIG_HOSTCMD_RATE_LIMITING_RECESS (20 * MSEC)
  595. /* Panic when status of PD MCU reflects that it has crashed */
  596. #undef CONFIG_HOSTCMD_PD_PANIC
  597. /*****************************************************************************/
  598. /* Enable debugging and profiling statistics for hook functions */
  599. #undef CONFIG_HOOK_DEBUG
  600. /*****************************************************************************/
  601. /* CRC configuration */
  602. /* Enable the hardware accelerator for CRC computation */
  603. #undef CONFIG_HW_CRC
  604. /* Enable the software routine for CRC computation */
  605. #undef CONFIG_SW_CRC
  606. /*****************************************************************************/
  607. /* Enable system hibernate */
  608. #define CONFIG_HIBERNATE
  609. /* Default delay after shutting down before hibernating */
  610. #define CONFIG_HIBERNATE_DELAY_SEC 3600
  611. /*
  612. * Use to define going in to hibernate early if low on battery.
  613. * CONFIG_HIBERNATE_BATT_PCT specifies the low battery threshold
  614. * for going into hibernate early, and CONFIG_HIBERNATE_BATT_SEC defines
  615. * the minimum amount of time to stay in G3 before checking for low
  616. * battery hibernate.
  617. */
  618. #undef CONFIG_HIBERNATE_BATT_PCT
  619. #undef CONFIG_HIBERNATE_BATT_SEC
  620. /* For ECs with multiple wakeup pins, define enabled wakeup pins */
  621. #undef CONFIG_HIBERNATE_WAKEUP_PINS
  622. /*****************************************************************************/
  623. /* I2C configuration */
  624. #undef CONFIG_I2C
  625. #undef CONFIG_I2C_ARBITRATION
  626. #undef CONFIG_I2C_DEBUG
  627. #undef CONFIG_I2C_DEBUG_PASSTHRU
  628. #undef CONFIG_I2C_PASSTHROUGH
  629. #undef CONFIG_I2C_PASSTHRU_RESTRICTED
  630. /*
  631. * I2C SCL gating.
  632. *
  633. * If CONFIG_I2C_SCL_GATE_ADDR/PORT is defined, whenever the defined address
  634. * is addressed, CONFIG_I2C_SCL_GATE_GPIO is set to high. When the I2C
  635. * transaction is done, the pin is set back to low.
  636. */
  637. #undef CONFIG_I2C_SCL_GATE_PORT
  638. #undef CONFIG_I2C_SCL_GATE_ADDR
  639. #undef CONFIG_I2C_SCL_GATE_GPIO
  640. /*****************************************************************************/
  641. /* Current/Power monitor */
  642. /*
  643. * Compile driver for INA219 or INA231. These two flags may not be both
  644. * defined.
  645. */
  646. #undef CONFIG_INA219
  647. #undef CONFIG_INA231
  648. /*****************************************************************************/
  649. /* Inductive charging */
  650. /* Enable inductive charging support */
  651. #undef CONFIG_INDUCTIVE_CHARGING
  652. /*****************************************************************************/
  653. /* Number of IRQs supported on the EC chip */
  654. #undef CONFIG_IRQ_COUNT
  655. /*****************************************************************************/
  656. /* Keyboard config */
  657. /*
  658. * The Silego reset chip sits in between the EC and the physical keyboard on
  659. * column 2. To save power in low-power modes, some Silego variants require
  660. * the signal to be inverted so that the open-drain output from the EC isn't
  661. * costing power due to the pull-up resistor in the Silego.
  662. */
  663. #undef CONFIG_KEYBOARD_COL2_INVERTED
  664. /* Enable extra debugging output from keyboard modules */
  665. #undef CONFIG_KEYBOARD_DEBUG
  666. /* The board uses a negative edge-triggered GPIO for keyboard interrupts. */
  667. #undef CONFIG_KEYBOARD_IRQ_GPIO
  668. /* Compile code for 8042 keyboard protocol */
  669. #undef CONFIG_KEYBOARD_PROTOCOL_8042
  670. /* Compile code for MKBP keyboard protocol */
  671. #undef CONFIG_KEYBOARD_PROTOCOL_MKBP
  672. /*
  673. * Keyboard config (struct keyboard_scan_config) is in board.c. If this is
  674. * not defined, default values from common/keyboard_scan.c will be used.
  675. */
  676. #undef CONFIG_KEYBOARD_BOARD_CONFIG
  677. /*
  678. * Minimum CPU clocks between scans. This ensures that keyboard scanning
  679. * doesn't starve the other EC tasks of CPU when running at a decreased system
  680. * clock.
  681. */
  682. #undef CONFIG_KEYBOARD_POST_SCAN_CLOCKS
  683. /*
  684. * Call board-supplied keyboard_suppress_noise() function when the debounced
  685. * keyboard state changes. Some boards use this to send a signal to the audio
  686. * codec to suppress typing noise picked up by the microphone.
  687. */
  688. #undef CONFIG_KEYBOARD_SUPPRESS_NOISE
  689. /*
  690. * Enable keyboard testing functionality. This enables a message which receives
  691. * a list of keyscan events from the AP and processes them. This will cause
  692. * keypresses to appear on the AP through the same mechanism as a normal
  693. * keyboard press.
  694. *
  695. * This can be used to spoof keyboard events, so is not normally defined,
  696. * except during internal testing.
  697. */
  698. #undef CONFIG_KEYBOARD_TEST
  699. /*****************************************************************************/
  700. /* Support common LED interface */
  701. #undef CONFIG_LED_COMMON
  702. /* Standard LED behavior according to spec given that we have a red-green
  703. * bicolor led for charging and one power led
  704. */
  705. #undef CONFIG_LED_POLICY_STD
  706. /*
  707. * LEDs for LED_POLICY STD may be inverted. In this case they are active low
  708. * and the GPIO names will be GPIO_LED..._L.
  709. */
  710. #undef CONFIG_LED_BAT_ACTIVE_LOW
  711. #undef CONFIG_LED_POWER_ACTIVE_LOW
  712. /* Support for LED driver chip(s) */
  713. #undef CONFIG_LED_DRIVER_DS2413 /* Maxim DS2413, on one-wire interface */
  714. #undef CONFIG_LED_DRIVER_LP5562 /* LP5562, on I2C interface */
  715. /*
  716. * Compile lid switch support.
  717. *
  718. * This is enabled by default because all boards other than reference boards
  719. * are for laptops with lid switchs. Reference boards #undef it.
  720. */
  721. #define CONFIG_LID_SWITCH
  722. /*
  723. * Support for turning the lightbar power rails on briefly when the AP is off.
  724. * Enabling this requires implementing the board-specific lb_power() function
  725. * to do it (see lb_common.h).
  726. */
  727. #undef CONFIG_LIGHTBAR_POWER_RAILS
  728. /*
  729. * For tap sequence, show the last segment in dim to give a better idea of
  730. * battery percentage.
  731. */
  732. #undef CONFIG_LIGHTBAR_TAP_DIM_LAST_SEGMENT
  733. /*
  734. * Low power idle options. These are disabled by default and all boards that
  735. * want to use low power idle must define it. When using the LFIOSC, the low
  736. * frequency clock will be used to conserve even more power when possible.
  737. *
  738. * GPIOs which need to trigger interrupts in low power idle must specify the
  739. * GPIO_INT_DSLEEP flag in gpio_list[].
  740. *
  741. * Note that for some processors (e.g. LM4), an active JTAG connection will
  742. * prevent the EC from using low-power idle.
  743. */
  744. #undef CONFIG_LOW_POWER_IDLE
  745. #undef CONFIG_LOW_POWER_USE_LFIOSC
  746. /*
  747. * Enable deep sleep during S0 (ignores SLEEP_MASK_AP_RUN).
  748. */
  749. #undef CONFIG_LOW_POWER_S0
  750. /* Support LPC interface */
  751. #undef CONFIG_LPC
  752. /* Support MKBP event */
  753. #undef CONFIG_MKBP_EVENT
  754. /* Support memory protection unit (MPU) */
  755. #undef CONFIG_MPU
  756. /* Support one-wire interface */
  757. #undef CONFIG_ONEWIRE
  758. /* Support PECI interface to x86 processor */
  759. #undef CONFIG_PECI
  760. /*
  761. * Maximum operating temperature in degrees Celcius used on some x86
  762. * processors. CPU chip temperature is reported relative to this value and
  763. * is never reported greater than this value. Processor asserts PROCHOT#
  764. * and starts throttling frequency and voltage at this temp. Operation may
  765. * become unreliable if temperature exceeds this limit.
  766. */
  767. #undef CONFIG_PECI_TJMAX
  768. /*****************************************************************************/
  769. /* PMU config */
  770. /*
  771. * Force switching on and off the FETs on the PMU controlling various power
  772. * rails during AP startup and shutdown sequences. This is mainly useful for
  773. * bringup when we don't have the corresponding sequences in the AP code.
  774. *
  775. * Currently supported only on spring platform.
  776. */
  777. #undef CONFIG_PMU_FORCE_FET
  778. /*
  779. * Enable hard-resetting the PMU from the EC. The implementation is rather
  780. * hacky; it simply shorts out the 3.3V rail to force the PMIC to panic. We
  781. * need this unfortunate hack because it's the only way to reset the I2C engine
  782. * inside the PMU.
  783. */
  784. #undef CONFIG_PMU_HARD_RESET
  785. /* Support TPS65090 PMU */
  786. #undef CONFIG_PMU_TPS65090
  787. /*
  788. * Support PMU powerinfo host and console commands. Note that the
  789. * implementation is currently specific to the Pit board, so don't blindly
  790. * enable this for another board without fixing that first.
  791. */
  792. #undef CONFIG_PMU_POWERINFO
  793. /*****************************************************************************/
  794. /* Compile common code to support power button debouncing */
  795. #undef CONFIG_POWER_BUTTON
  796. /* Force the active state of the power button : 0(default if unset) or 1 */
  797. #undef CONFIG_POWER_BUTTON_ACTIVE_STATE
  798. /* Allow the power button to send events while the lid is closed */
  799. #undef CONFIG_POWER_BUTTON_IGNORE_LID
  800. /* Support sending the power button signal to x86 chipsets */
  801. #undef CONFIG_POWER_BUTTON_X86
  802. /* Compile common code for AP power state machine */
  803. #undef CONFIG_POWER_COMMON
  804. /* Use part of the EC's data EEPROM to hold persistent storage for the AP. */
  805. #undef CONFIG_PSTORE
  806. /*****************************************************************************/
  807. /* Support PWM control */
  808. #undef CONFIG_PWM
  809. /* Support PWM control while in low-power idle */
  810. #undef CONFIG_PWM_DSLEEP
  811. /*****************************************************************************/
  812. /* Support PWM output to keyboard backlight */
  813. #undef CONFIG_PWM_KBLIGHT
  814. /* Base address of RAM for the chip */
  815. #undef CONFIG_RAM_BASE
  816. /* Size of RAM available on the chip, in bytes */
  817. #undef CONFIG_RAM_SIZE
  818. /* Support IR357x Link voltage regulator debugging / reprogramming */
  819. #undef CONFIG_REGULATOR_IR357X
  820. /* Support verifying 2048-bit RSA signature */
  821. #undef CONFIG_RSA
  822. /*
  823. * Verify the RW firmware using the RSA signature.
  824. * (for accessories without software sync)
  825. */
  826. #undef CONFIG_RWSIG
  827. /*
  828. * If defined, the hash module will save its last computed hash when jumping
  829. * between EC images.
  830. */
  831. #undef CONFIG_SAVE_VBOOT_HASH
  832. /* Enable smart battery firmware update driver */
  833. #undef CONFIG_SB_FIRMWARE_UPDATE
  834. /* Allow the board to use a GPIO for the SCI# signal. */
  835. #undef CONFIG_SCI_GPIO
  836. /* Support computing SHA-1 hash */
  837. #undef CONFIG_SHA1
  838. /* Support computing SHA-256 hash (without the VBOOT code) */
  839. #undef CONFIG_SHA256
  840. /* Emulate the CLZ (Count Leading Zeros) in software for CPU lacking support */
  841. #undef CONFIG_SOFTWARE_CLZ
  842. /* Support smbus interface */
  843. #undef CONFIG_SMBUS
  844. /* Support SPI interfaces */
  845. #undef CONFIG_SPI
  846. /* Support SPI flash */
  847. #undef CONFIG_SPI_FLASH
  848. /* Support W25Q64 SPI flash */
  849. #undef CONFIG_SPI_FLASH_W25Q64
  850. /* Support W25X40 SPI flash */
  851. #undef CONFIG_SPI_FLASH_W25X40
  852. /* SPI flash part supports SR2 register */
  853. #undef CONFIG_SPI_FLASH_HAS_SR2
  854. /* Size (bytes) of SPI flash memory */
  855. #undef CONFIG_SPI_FLASH_SIZE
  856. /* SPI module port used for master interface */
  857. #undef CONFIG_SPI_MASTER_PORT
  858. /* Default stack size to use for tasks, in bytes */
  859. #undef CONFIG_STACK_SIZE
  860. /* Fake hibernate mode */
  861. #undef CONFIG_STM32L_FAKE_HIBERNATE
  862. /*
  863. * Compile common code to handle simple switch inputs such as the recovery
  864. * button input from the servo debug interface.
  865. */
  866. #undef CONFIG_SWITCH
  867. /* Support dedicated recovery signal from servo board */
  868. #undef CONFIG_SWITCH_DEDICATED_RECOVERY
  869. /*
  870. * System should remain unlocked even if write protect is enabled.
  871. *
  872. * NOTE: This should ONLY be defined during bringup, and should never be
  873. * defined on a shipping / released platform.
  874. */
  875. #undef CONFIG_SYSTEM_UNLOCKED
  876. /*****************************************************************************/
  877. /* Task config */
  878. /*
  879. * List of enabled tasks in ascending priority order. This is normally
  880. * defined in each board's ec.tasklist file.
  881. *
  882. * For each task, use the macro TASK_ALWAYS(n, r, d, s) for base tasks and
  883. * TASK_NOTEST(n, r, d, s) for tasks that can be excluded in test binaries,
  884. * where :
  885. * 'n' is the name of the task
  886. * 'r' is the main routine of the task
  887. * 'd' is an opaque parameter passed to the routine at startup
  888. * 's' is the stack size in bytes; must be a multiple of 8
  889. */
  890. #undef CONFIG_TASK_LIST
  891. /*
  892. * List of test tasks. Same format as CONFIG_TASK_LIST, but used to define
  893. * additional tasks for a unit test. Normally defined in
  894. * test/{testname}.tasklist.
  895. */
  896. #undef CONFIG_TEST_TASK_LIST
  897. /*
  898. * Enable task profiling.
  899. *
  900. * Boards may #undef this to reduce image size and RAM usage.
  901. */
  902. #define CONFIG_TASK_PROFILING
  903. /*****************************************************************************/
  904. /* Temperature sensor config */
  905. /* Compile common code for temperature sensor support */
  906. #undef CONFIG_TEMP_SENSOR
  907. /* Support particular temperature sensor chips */
  908. #undef CONFIG_TEMP_SENSOR_G781 /* G781 sensor, on I2C bus */
  909. #undef CONFIG_TEMP_SENSOR_TMP006 /* TI TMP006 sensor, on I2C bus */
  910. #undef CONFIG_TEMP_SENSOR_TMP432 /* TI TMP432 sensor, on I2C bus */
  911. /*
  912. * If defined, active-high GPIO which indicates temperature sensor chips are
  913. * powered. If not defined, temperature sensors are assumed to be always
  914. * powered.
  915. */
  916. #undef CONFIG_TEMP_SENSOR_POWER_GPIO
  917. /*****************************************************************************/
  918. /* Stream config
  919. *
  920. * Streams are an abstraction for managing character based IO streams. Streams
  921. * can virtualize USARTs (interrupt, polled, or DMA driven), USB bulk
  922. * endpoints, I2C transfers, and more.
  923. */
  924. #undef CONFIG_STREAM
  925. /*****************************************************************************/
  926. /* USART stream config */
  927. #undef CONFIG_STREAM_USART
  928. /*
  929. * Each USART stream can be individually enabled and accessible using the
  930. * stream interface provided in the usart_config struct.
  931. */
  932. #undef CONFIG_STREAM_USART1
  933. #undef CONFIG_STREAM_USART2
  934. #undef CONFIG_STREAM_USART3
  935. #undef CONFIG_STREAM_USART4
  936. /*****************************************************************************/
  937. /* USB stream config */
  938. #undef CONFIG_STREAM_USB
  939. /*****************************************************************************/
  940. /* UART config */
  941. /* Baud rate for UARTs */
  942. #define CONFIG_UART_BAUD_RATE 115200
  943. /* UART index (number) for EC console */
  944. #undef CONFIG_UART_CONSOLE
  945. /* UART index (number) for host UART, if present */
  946. #undef CONFIG_UART_HOST
  947. /* Use uart_input_filter() to filter UART input. See prototype in uart.h */
  948. #undef CONFIG_UART_INPUT_FILTER
  949. /*
  950. * UART receive buffer size in bytes. Must be a power of 2 for macros in
  951. * common/uart_buffering.c to work properly. Must be larger than
  952. * CONFIG_CONSOLE_INPUT_LINE_SIZE to copy and paste scripts.
  953. */
  954. #define CONFIG_UART_RX_BUF_SIZE 128
  955. /* Use DMA for UART input */
  956. #undef CONFIG_UART_RX_DMA
  957. /*
  958. * On some platforms, UART receive DMA can't trigger an interrupt when a single
  959. * character is received. Those platforms poll for characters every HOOK_TICK.
  960. * When a character is received, make this many additional checks between then
  961. * and the next HOOK_TICK, to increase responsiveness of the console to input.
  962. */
  963. #define CONFIG_UART_RX_DMA_RECHECKS 5
  964. /*
  965. * UART transmit buffer size in bytes. Must be a power of 2 for macros in
  966. * common/uart_buffering.c to work properly.
  967. */
  968. #define CONFIG_UART_TX_BUF_SIZE 512
  969. /* Use DMA for UART output */
  970. #undef CONFIG_UART_TX_DMA
  971. /* The DMA channel for UART. If not defined, default to UART1. */
  972. #undef CONFIG_UART_TX_DMA_CH
  973. #undef CONFIG_UART_RX_DMA_CH
  974. /*****************************************************************************/
  975. /* USB PD config */
  976. /* Include all USB Power Delivery modules */
  977. #undef CONFIG_USB_POWER_DELIVERY
  978. /* Support for USB PD alternate mode */
  979. #undef CONFIG_USB_PD_ALT_MODE
  980. /* Support for USB PD alternate mode of Downward Facing Port */
  981. #undef CONFIG_USB_PD_ALT_MODE_DFP
  982. /* Check if max voltage request is allowed before each request */
  983. #undef CONIFG_USB_PD_CHECK_MAX_REQUEST_ALLOWED
  984. /* Default state of PD communication enabled flag */
  985. #define CONFIG_USB_PD_COMM_ENABLED 1
  986. /* Respond to custom vendor-defined messages over PD */
  987. #undef CONFIG_USB_PD_CUSTOM_VDM
  988. /* Define if this board can act as a dual-role PD port (source and sink) */
  989. #undef CONFIG_USB_PD_DUAL_ROLE
  990. /* Dynamic USB PD source capability */
  991. #undef CONFIG_USB_PD_DYNAMIC_SRC_CAP
  992. /* Check whether PD is the sole power source before flash erase operation */
  993. #undef CONFIG_USB_PD_FLASH_ERASE_CHECK
  994. /* HW & SW version for alternate mode discover identity response (4bits each) */
  995. #undef CONFIG_USB_PD_IDENTITY_HW_ID
  996. #undef CONFIG_USB_PD_IDENTITY_SW_ID
  997. /* USB PD MCU slave address for host commands */
  998. #define CONFIG_USB_PD_I2C_SLAVE_ADDR 0x3c
  999. /* Define if using internal comparator for PD receive */
  1000. #undef CONFIG_USB_PD_INTERNAL_COMP
  1001. /* Record main PD events in a circular buffer */
  1002. #undef CONFIG_USB_PD_LOGGING
  1003. /* The size in bytes of the FIFO used for PD events logging */
  1004. #undef CONFIG_USB_PD_LOG_SIZE
  1005. /* Define if USB-PD device has no way of detecting USB VBUS */
  1006. #undef CONFIG_USB_PD_NO_VBUS_DETECT
  1007. /* Simple DFP, such as power adapter, will not send discovery VDM on connect */
  1008. #undef CONFIG_USB_PD_SIMPLE_DFP
  1009. /* Use comparator module for PD RX interrupt */
  1010. #define CONFIG_USB_PD_RX_COMP_IRQ
  1011. /* Alternative configuration keeping only the TX part of PHY */
  1012. #undef CONFIG_USB_PD_TX_PHY_ONLY
  1013. /* Support for USB type-c superspeed mux */
  1014. #undef CONFIG_USBC_SS_MUX
  1015. /* Support v1.1 type-C connection state machine */
  1016. #undef CONFIG_USBC_BACKWARDS_COMPATIBLE_DFP
  1017. /* Support for USB type-c vconn. Not needed for captive cables. */
  1018. #undef CONFIG_USBC_VCONN
  1019. /* USB Binary device Object Store support */
  1020. #undef CONFIG_USB_BOS
  1021. /* USB Device version of product */
  1022. #undef CONFIG_USB_BCD_DEV
  1023. /*****************************************************************************/
  1024. /* Compile chip support for the USB device controller */
  1025. #undef CONFIG_USB
  1026. /* Disable automatic connection of USB peripheral */
  1027. #undef CONFIG_USB_INHIBIT_CONNECT
  1028. /* Disable automatic initialization of USB peripheral */
  1029. #undef CONFIG_USB_INHIBIT_INIT
  1030. /* Support simple control of power to the device's USB ports */
  1031. #undef CONFIG_USB_PORT_POWER_DUMB
  1032. /*
  1033. * Support supplying USB power in S3, if the host leaves the port enabled when
  1034. * entering S3.
  1035. */
  1036. #undef CONFIG_USB_PORT_POWER_IN_S3
  1037. /*
  1038. * Support smart power control to the device's USB ports, using
  1039. * dedicated power control chips. This potentially enables automatic
  1040. * negotiation of supplying more power to peripherals.
  1041. */
  1042. #undef CONFIG_USB_PORT_POWER_SMART
  1043. /*
  1044. * Override the default charging mode for USB smart power control.
  1045. * Value is selected from usb_charge_mode in include/usb_charge.h
  1046. */
  1047. #undef CONFIG_USB_PORT_POWER_SMART_DEFAULT_MODE
  1048. /*
  1049. * Smart USB power control can use a full set of control signals to the USB
  1050. * port power chip, or a reduced set. If this is defined, use the reduced set.
  1051. */
  1052. #undef CONFIG_USB_PORT_POWER_SMART_SIMPLE
  1053. /*
  1054. * Smart USB power control current limit pins may be inverted. In this case
  1055. * they are active low and the GPIO names will be GPIO_USBn_ILIM_SEL_L.
  1056. */
  1057. #undef CONFIG_USB_PORT_POWER_SMART_INVERTED
  1058. /* Support the TSU6721 I2C smart switch */
  1059. #undef CONFIG_USB_SWITCH_TSU6721
  1060. /* Support the Pericom PI3USB9281 I2C USB switch */
  1061. #undef CONFIG_USB_SWITCH_PI3USB9281
  1062. /* Select GPIO MUX for Pericom PI3USB9281 I2C USB switch */
  1063. #undef CONFIG_USB_SWITCH_PI3USB9281_MUX_GPIO
  1064. /*****************************************************************************/
  1065. /* USB GPIO config */
  1066. #undef CONFIG_USB_GPIO
  1067. /*****************************************************************************/
  1068. /* USB SPI config */
  1069. #undef CONFIG_USB_SPI
  1070. /*****************************************************************************/
  1071. /* Support computing hash of code for verified boot */
  1072. #undef CONFIG_VBOOT_HASH
  1073. /*****************************************************************************/
  1074. /* Watchdog config */
  1075. /*
  1076. * Compile watchdog timer support. The watchdog timer will reboot the system
  1077. * if the hook task (which is the lowest-priority task on the system) gets
  1078. * starved for CPU time and isn't able to fire its HOOK_TICK event.
  1079. */
  1080. #define CONFIG_WATCHDOG
  1081. /*
  1082. * Try to detect a watchdog that is about to fire, and print a trace. This is
  1083. * required on chips such as STM32 where the watchdog timer simply reboots the
  1084. * system without any early warning.
  1085. */
  1086. #undef CONFIG_WATCHDOG_HELP
  1087. /* Watchdog period in ms; see also AUX_TIMER_PERIOD_MS */
  1088. #define CONFIG_WATCHDOG_PERIOD_MS 1600
  1089. /*
  1090. * Fire auxiliary timer 500ms before watchdog timer expires. This leaves
  1091. * some time for debug trace to be printed.
  1092. */
  1093. #define CONFIG_AUX_TIMER_PERIOD_MS (CONFIG_WATCHDOG_PERIOD_MS - 500)
  1094. /*****************************************************************************/
  1095. /*
  1096. * Support controlling power to WiFi, WWAN (3G/LTE), and/or bluetooth modules.
  1097. */
  1098. #undef CONFIG_WIRELESS
  1099. /*
  1100. * Support for WiFi devices that must remain powered in suspend. Set to the
  1101. * combination of EC_WIRELESS_SWITCH flags (from ec_commands.h) which should
  1102. * be set in suspend.
  1103. */
  1104. #undef CONFIG_WIRELESS_SUSPEND
  1105. /*
  1106. * Write protect signal is active-high. If this is defined, there must be a
  1107. * GPIO named GPIO_WP; if not defined, there must be a GPIO names GPIO_WP_L.
  1108. */
  1109. #undef CONFIG_WP_ACTIVE_HIGH
  1110. /*
  1111. * The write protect signal is always asserted,
  1112. * independantly of the GPIO existence or current value.
  1113. */
  1114. #undef CONFIG_WP_ALWAYS
  1115. /*****************************************************************************/
  1116. /*
  1117. * Include board and core configs, since those hold the CONFIG_ constants for a
  1118. * given configuration. This guarantees they get included everywhere, and
  1119. * fixes a fairly common bug where we gate out code with #ifndef
  1120. * CONFIG_SOMETHING and but forget to include both of these.
  1121. *
  1122. * Board is included after chip, so that chip defaults can be overridden on a
  1123. * per-board basis as needed.
  1124. */
  1125. #ifdef __CROS_EC_CONFIG_CHIP_H
  1126. #error Include config.h instead of config_chip.h!
  1127. #endif
  1128. #ifdef __BOARD_H
  1129. #error Include config.h instead of board.h!
  1130. #endif
  1131. #include "config_chip.h"
  1132. #include "board.h"
  1133. /*****************************************************************************/
  1134. /*
  1135. * Handle task-dependent configs.
  1136. *
  1137. * This prevent sub-modules from being compiled when the task and parent module
  1138. * are not present.
  1139. */
  1140. #ifndef HAS_TASK_CHIPSET
  1141. #undef CONFIG_CHIPSET_BAYTRAIL
  1142. #undef CONFIG_CHIPSET_BRASWELL
  1143. #undef CONFIG_CHIPSET_GAIA
  1144. #undef CONFIG_CHIPSET_HASWELL
  1145. #undef CONFIG_CHIPSET_IVYBRIDGE
  1146. #undef CONFIG_CHIPSET_ROCKCHIP
  1147. #undef CONFIG_CHIPSET_TEGRA
  1148. #undef CONFIG_POWER_COMMON
  1149. #endif
  1150. #ifndef HAS_TASK_KEYPROTO
  1151. #undef CONFIG_KEYBOARD_PROTOCOL_8042
  1152. /*
  1153. * Note that we don't undef CONFIG_KEYBOARD_PROTOCOL_MKBP, because it doesn't
  1154. * have its own task.
  1155. */
  1156. #endif
  1157. #ifndef HAS_TASK_KEYSCAN
  1158. #undef CONFIG_KEYBOARD_PROTOCOL_8042
  1159. #undef CONFIG_KEYBOARD_PROTOCOL_MKBP
  1160. #endif
  1161. /*****************************************************************************/
  1162. /*
  1163. * Apply test config overrides last, since tests need to override some of the
  1164. * config flags in non-standard ways to mock only parts of the system.
  1165. */
  1166. #include "test_config.h"
  1167. /*****************************************************************************/
  1168. /*
  1169. * Sanity checks to make sure some of the configs above make sense.
  1170. */
  1171. #if (CONFIG_AUX_TIMER_PERIOD_MS) < ((HOOK_TICK_INTERVAL_MS) * 2)
  1172. #error "CONFIG_AUX_TIMER_PERIOD_MS must be at least 2x HOOK_TICK_INTERVAL_MS"
  1173. #endif
  1174. #endif /* __CROS_EC_CONFIG_H */