GoogleGit

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