├── .checkpatch.conf ├── .gitignore ├── COMMIT-QUEUE.ini ├── LICENSE ├── Makefile ├── Makefile.rules ├── Makefile.toolchain ├── OWNERS ├── PRESUBMIT.cfg ├── README ├── README.fmap ├── board ├── OWNERS ├── bds │ ├── board.c │ ├── board.h │ ├── build.mk │ ├── ec.tasklist │ └── gpio.inc ├── big │ ├── battery.c │ ├── board.c │ ├── board.h │ ├── build.mk │ ├── ec.tasklist │ ├── gpio.inc │ └── led.c ├── chell │ ├── battery.c │ ├── board.c │ ├── board.h │ ├── build.mk │ ├── ec.tasklist │ ├── gpio.inc │ ├── led.c │ ├── lfw │ │ └── gpio.inc │ └── usb_pd_policy.c ├── chell_pd ├── cr50 │ ├── board.c │ ├── board.h │ ├── build.mk │ ├── ec.tasklist │ ├── gpio.inc │ ├── rdd.c │ ├── scratch_reg1.h │ ├── tpm2 │ │ ├── NVMem.c │ │ ├── aes.c │ │ ├── ecc.c │ │ ├── ecies.c │ │ ├── endian.h │ │ ├── endorsement.c │ │ ├── hash.c │ │ ├── hash_data.c │ │ ├── hkdf.c │ │ ├── manufacture.c │ │ ├── platform.c │ │ ├── post_reset.c │ │ ├── rsa.c │ │ ├── stubs.c │ │ ├── tpm_state.c │ │ ├── trng.c │ │ └── upgrade.c │ ├── usb_i2c.c │ ├── usb_spi.c │ ├── wp.c │ └── wp.h ├── dingdong │ ├── board.c │ ├── board.h │ ├── build.mk │ ├── dev_key.pem │ ├── ec.tasklist │ ├── gpio.inc │ ├── usb_pd_config.h │ └── usb_pd_policy.c ├── discovery-stm32f072 │ ├── board.c │ ├── board.h │ ├── build.mk │ ├── ec.tasklist │ ├── gpio.inc │ └── openocd-flash.cfg ├── discovery │ ├── board.c │ ├── board.h │ ├── build.mk │ ├── ec.tasklist │ ├── gpio.inc │ └── openocd-flash.cfg ├── elm │ ├── battery.c │ ├── board.c │ ├── board.h │ ├── build.mk │ ├── ec.tasklist │ ├── gpio.inc │ ├── led.c │ └── usb_pd_policy.c ├── eve │ ├── battery.c │ ├── board.c │ ├── board.h │ ├── build.mk │ ├── ec.tasklist │ ├── gpio.inc │ ├── led.c │ └── usb_pd_policy.c ├── eve_fp │ ├── board.c │ ├── board.h │ ├── build.mk │ ├── ec.tasklist │ └── gpio.inc ├── glados │ ├── battery.c │ ├── board.c │ ├── board.h │ ├── build.mk │ ├── ec.tasklist │ ├── gpio.inc │ ├── led.c │ ├── lfw │ │ └── gpio.inc │ └── usb_pd_policy.c ├── glados_pd │ ├── block.png │ ├── board.c │ ├── board.h │ ├── build.mk │ ├── dualtcpc.md │ ├── ec.tasklist │ ├── glados_pd.pdf │ ├── glados_pd.png │ ├── gpio.inc │ └── usb_pd_config.h ├── gru ├── hadoken │ ├── board.c │ ├── board.h │ ├── build.mk │ ├── ec.tasklist │ └── gpio.inc ├── hammer │ ├── board.c │ ├── board.h │ ├── build.mk │ ├── dev_key.pem │ ├── ec.tasklist │ └── gpio.inc ├── hoho │ ├── board.c │ ├── board.h │ ├── build.mk │ ├── dev_key.pem │ ├── ec.tasklist │ ├── gpio.inc │ ├── usb_pd_config.h │ └── usb_pd_policy.c ├── honeybuns │ ├── board.c │ ├── board.h │ ├── build.mk │ ├── dev_key.pem │ ├── ec.tasklist │ ├── gpio.inc │ ├── hx3.c │ ├── usb_mux.c │ ├── usb_pd_config.h │ └── usb_pd_policy.c ├── host │ ├── battery.c │ ├── board.c │ ├── board.h │ ├── build.mk │ ├── charger.c │ ├── chipset.c │ ├── ec.tasklist │ ├── fan.c │ ├── gpio.inc │ ├── usb_pd_config.c │ ├── usb_pd_config.h │ └── usb_pd_policy.c ├── it83xx_evb │ ├── board.c │ ├── board.h │ ├── build.mk │ ├── ec.tasklist │ ├── gpio.inc │ └── usb_pd_policy.c ├── jerry │ ├── battery.c │ ├── board.c │ ├── board.h │ ├── build.mk │ ├── ec.tasklist │ └── gpio.inc ├── kevin │ ├── battery.c │ ├── board.c │ ├── board.h │ ├── build.mk │ ├── charge_ramp.c │ ├── ec.tasklist │ ├── gpio.inc │ ├── led_gru.c │ ├── led_kevin.c │ └── usb_pd_policy.c ├── llama │ ├── battery.c │ ├── board.c │ ├── board.h │ ├── build.mk │ ├── ec.tasklist │ ├── gpio.inc │ └── led.c ├── lucid │ ├── battery.c │ ├── board.c │ ├── board.h │ ├── build.mk │ ├── dev_key.pem │ ├── ec.tasklist │ ├── gpio.inc │ ├── led.c │ ├── usb_pd_config.h │ └── usb_pd_policy.c ├── minimuffin ├── npcx_evb │ ├── board.c │ ├── board.h │ ├── build.mk │ ├── ec.tasklist │ └── gpio.inc ├── npcx_evb_arm │ ├── board.c │ ├── board.h │ ├── build.mk │ ├── ec.tasklist │ └── gpio.inc ├── nucleo-f072rb │ ├── board.c │ ├── board.h │ ├── build.mk │ ├── ec.tasklist │ ├── gpio.inc │ └── openocd-flash.cfg ├── oak │ ├── battery.c │ ├── board.c │ ├── board.h │ ├── board_revs.h │ ├── build.mk │ ├── ec.tasklist │ ├── gpio.inc │ ├── led.c │ └── usb_pd_policy.c ├── oak_pd ├── pdeval-stm32f072 │ ├── PD_evaluation.md │ ├── board.c │ ├── board.h │ ├── build.mk │ ├── ec.tasklist │ ├── gpio.inc │ ├── openocd-flash.cfg │ └── usb_pd_policy.c ├── pit │ ├── board.c │ ├── board.h │ ├── build.mk │ ├── ec.tasklist │ └── gpio.inc ├── plankton │ ├── board.c │ ├── board.h │ ├── build.mk │ ├── ec.tasklist │ ├── gpio.inc │ ├── usb_pd_config.h │ └── usb_pd_policy.c ├── polyberry │ ├── board.c │ ├── board.h │ ├── build.mk │ ├── ec.tasklist │ └── gpio.inc ├── poppy │ ├── battery.c │ ├── board.c │ ├── board.h │ ├── build.mk │ ├── ec.tasklist │ ├── gpio.inc │ └── usb_pd_policy.c ├── pyro │ ├── battery.c │ ├── board.c │ ├── board.h │ ├── build.mk │ ├── ec.tasklist │ ├── gpio.inc │ ├── led.c │ └── usb_pd_policy.c ├── reef │ ├── battery.c │ ├── board.c │ ├── board.h │ ├── build.mk │ ├── ec.tasklist │ ├── gpio.inc │ ├── led.c │ └── usb_pd_policy.c ├── rowan │ ├── battery.c │ ├── board.c │ ├── board.h │ ├── build.mk │ ├── ec.tasklist │ ├── gpio.inc │ ├── led.c │ └── usb_pd_policy.c ├── ryu │ ├── battery.c │ ├── board.c │ ├── board.h │ ├── build.mk │ ├── dfu │ ├── ec.tasklist │ ├── gpio.inc │ ├── usb_mux.c │ ├── usb_pd_config.h │ └── usb_pd_policy.c ├── samus │ ├── battery.c │ ├── board.c │ ├── board.h │ ├── build.mk │ ├── ec.tasklist │ ├── extpower.c │ ├── gpio.inc │ ├── panel.c │ └── power_sequence.c ├── samus_pd │ ├── board.c │ ├── board.h │ ├── build.mk │ ├── ec.tasklist │ ├── gpio.inc │ ├── usb_mux.c │ ├── usb_pd_config.h │ └── usb_pd_policy.c ├── servo_micro │ ├── board.c │ ├── board.h │ ├── build.mk │ ├── ec.tasklist │ └── gpio.inc ├── servo_v4 │ ├── board.c │ ├── board.h │ ├── build.mk │ ├── ec.tasklist │ ├── gpio.inc │ ├── usb_pd_config.h │ └── usb_pd_policy.c ├── snappy │ ├── battery.c │ ├── board.c │ ├── board.h │ ├── build.mk │ ├── ec.tasklist │ ├── gpio.inc │ ├── led.c │ └── usb_pd_policy.c ├── snoball │ ├── board.c │ ├── board.h │ ├── build.mk │ ├── ec.tasklist │ └── gpio.inc ├── stm32f446e-eval │ ├── board.c │ ├── board.h │ ├── build.mk │ ├── ec.tasklist │ └── gpio.inc ├── stm32l476g-eval │ ├── board.c │ ├── board.h │ ├── build.mk │ ├── ec.tasklist │ ├── gpio.inc │ └── openocd-flash.cfg ├── strago │ ├── battery.c │ ├── board.c │ ├── board.h │ ├── build.mk │ ├── ec.tasklist │ ├── gpio.inc │ ├── led.c │ ├── lfw │ │ └── gpio.inc │ └── usb_pd_policy.c ├── sweetberry │ ├── board.c │ ├── board.h │ ├── build.mk │ ├── ec.tasklist │ └── gpio.inc ├── twinkie │ ├── board.c │ ├── board.h │ ├── build.mk │ ├── build_rw_variant │ ├── ec.tasklist │ ├── gpio.inc │ ├── injector.c │ ├── injector.h │ ├── simpletrace.c │ ├── sink.tasklist │ ├── sniffer.c │ ├── usb_pd_config.h │ └── usb_pd_policy.c ├── wheatley │ ├── battery.c │ ├── board.c │ ├── board.h │ ├── build.mk │ ├── ec.tasklist │ ├── gpio.inc │ ├── led.c │ └── usb_pd_policy.c └── zinger │ ├── board.c │ ├── board.h │ ├── build.mk │ ├── dev_key.pem │ ├── ec.irqlist │ ├── ec.tasklist │ ├── hardware.c │ ├── runtime.c │ ├── usb_pd_config.h │ └── usb_pd_policy.c ├── builtin ├── assert.h ├── endian.h ├── stdarg.h ├── stdbool.h ├── stddef.h ├── stdint.h ├── string.h └── time.h ├── chip ├── g │ ├── blob.c │ ├── build.mk │ ├── clock.c │ ├── config_chip.h │ ├── crypto_api.c │ ├── dcrypto │ │ ├── aes.c │ │ ├── app_cipher.c │ │ ├── app_key.c │ │ ├── bn.c │ │ ├── bn_hw.c │ │ ├── compare.c │ │ ├── dcrypto.h │ │ ├── dcrypto_runtime.c │ │ ├── gcm.c │ │ ├── hkdf.c │ │ ├── hmac.c │ │ ├── internal.h │ │ ├── key_ladder.c │ │ ├── p256.c │ │ ├── p256_ec.c │ │ ├── p256_ecies.c │ │ ├── rsa.c │ │ ├── sha1.c │ │ ├── sha256.c │ │ ├── sha384.c │ │ ├── sha512.c │ │ └── x509.c │ ├── flash.c │ ├── flash_config.h │ ├── flash_info.h │ ├── gpio.c │ ├── hw_regdefs.h │ ├── hwtimer.c │ ├── i2cm.c │ ├── i2cs.c │ ├── i2cs.h │ ├── idle.c │ ├── init_chip.h │ ├── jitter.c │ ├── jtag.c │ ├── loader │ │ ├── debug_printf.c │ │ ├── debug_printf.h │ │ ├── key_ladder.c │ │ ├── key_ladder.h │ │ ├── launch.c │ │ ├── main.c │ │ ├── rom_flash.c │ │ ├── rom_flash.h │ │ ├── setup.c │ │ ├── setup.h │ │ ├── verify.c │ │ └── verify.h │ ├── pmu.c │ ├── pmu.h │ ├── polling_uart.c │ ├── rbox.c │ ├── rbox.h │ ├── rdd.c │ ├── rdd.h │ ├── registers.h │ ├── runlevel.c │ ├── signed_header.h │ ├── spi_master.c │ ├── spi_master.h │ ├── sps.c │ ├── sps.h │ ├── sps_tpm.c │ ├── system.c │ ├── system_chip.h │ ├── trng.c │ ├── uart.c │ ├── uartn.c │ ├── uartn.h │ ├── upgrade_fw.c │ ├── upgrade_fw.h │ ├── usart.c │ ├── usart.h │ ├── usb-stream.c │ ├── usb-stream.h │ ├── usb.c │ ├── usb_console.c │ ├── usb_endpoints.S │ ├── usb_hid_keyboard.c │ ├── usb_hw.h │ ├── usb_spi.c │ ├── usb_spi.h │ ├── usb_upgrade.c │ └── watchdog.c ├── host │ ├── build.mk │ ├── clock.c │ ├── config_chip.h │ ├── flash.c │ ├── gpio.c │ ├── host_test.h │ ├── i2c.c │ ├── keyboard_raw.c │ ├── lpc.c │ ├── persistence.c │ ├── persistence.h │ ├── reboot.c │ ├── reboot.h │ ├── registers.h │ ├── system.c │ ├── uart.c │ └── usb_pd_phy.c ├── ish │ ├── build.mk │ ├── clock.c │ ├── config_chip.h │ ├── config_flash_layout.h │ ├── flash.c │ ├── gpio.c │ ├── hpet.h │ ├── hwtimer.c │ ├── i2c.c │ ├── ipc.c │ ├── ipc.h │ ├── ish_i2c.h │ ├── jtag.c │ ├── registers.h │ ├── system.c │ ├── uart.c │ └── uart_defs.h ├── it83xx │ ├── adc.c │ ├── adc_chip.h │ ├── build.mk │ ├── clock.c │ ├── config_chip.h │ ├── ec2i.c │ ├── ec2i_chip.h │ ├── fan.c │ ├── flash.c │ ├── gpio.c │ ├── hwtimer.c │ ├── hwtimer_chip.h │ ├── i2c.c │ ├── intc.c │ ├── intc.h │ ├── irq.c │ ├── jtag.c │ ├── keyboard_raw.c │ ├── kmsc_chip.h │ ├── lpc.c │ ├── peci.c │ ├── pwm.c │ ├── pwm_chip.h │ ├── registers.h │ ├── spi.c │ ├── system.c │ ├── uart.c │ └── watchdog.c ├── lm4 │ ├── adc.c │ ├── adc_chip.h │ ├── build.mk │ ├── chip_temp_sensor.c │ ├── clock.c │ ├── config_chip.h │ ├── eeprom.c │ ├── fan.c │ ├── flash.c │ ├── gpio.c │ ├── hwtimer.c │ ├── i2c.c │ ├── jtag.c │ ├── keyboard_raw.c │ ├── lpc.c │ ├── peci.c │ ├── pwm.c │ ├── pwm_chip.h │ ├── registers.h │ ├── spi.c │ ├── system.c │ ├── uart.c │ └── watchdog.c ├── mec1322 │ ├── adc.c │ ├── adc_chip.h │ ├── build.mk │ ├── clock.c │ ├── config_chip.h │ ├── config_flash_layout.h │ ├── dma.c │ ├── fan.c │ ├── flash.c │ ├── gpio.c │ ├── hwtimer.c │ ├── i2c.c │ ├── jtag.c │ ├── keyboard_raw.c │ ├── lfw │ │ ├── ec_lfw.c │ │ ├── ec_lfw.h │ │ └── ec_lfw.ld │ ├── lpc.c │ ├── port80.c │ ├── pwm.c │ ├── pwm_chip.h │ ├── registers.h │ ├── spi.c │ ├── system.c │ ├── uart.c │ ├── util │ │ ├── pack_ec.py │ │ ├── rsakey_sign_header.pem │ │ └── rsakey_sign_payload.pem │ └── watchdog.c ├── npcx │ ├── adc.c │ ├── adc_chip.h │ ├── build.mk │ ├── clock.c │ ├── clock_chip.h │ ├── config_chip.h │ ├── config_flash_layout.h │ ├── espi.c │ ├── fan.c │ ├── fan_chip.h │ ├── flash.c │ ├── gpio.c │ ├── header.c │ ├── hwtimer.c │ ├── hwtimer_chip.h │ ├── i2c.c │ ├── jtag.c │ ├── keyboard_raw.c │ ├── lfw │ │ └── ec_lfw.h │ ├── lpc.c │ ├── lpc_chip.h │ ├── peci.c │ ├── pwm.c │ ├── pwm_chip.h │ ├── registers.h │ ├── rom_chip.h │ ├── shi.c │ ├── shi_chip.h │ ├── spi.c │ ├── spiflashfw │ │ ├── ec_npcxflash.c │ │ └── ec_npcxflash.ld │ ├── system.c │ ├── system_chip.h │ ├── uart.c │ └── watchdog.c ├── nrf51 │ ├── bluetooth_le.c │ ├── bluetooth_le.h │ ├── build.mk │ ├── clock.c │ ├── config_chip.h │ ├── gpio.c │ ├── hwtimer.c │ ├── i2c.c │ ├── jtag.c │ ├── keyboard_raw.c │ ├── ppi.c │ ├── ppi.h │ ├── radio.c │ ├── radio.h │ ├── radio_test.c │ ├── radio_test.h │ ├── registers.h │ ├── system.c │ ├── uart.c │ └── watchdog.c └── stm32 │ ├── adc-stm32f0.c │ ├── adc-stm32f3.c │ ├── adc-stm32l.c │ ├── adc_chip.h │ ├── build.mk │ ├── charger_detect.c │ ├── clock-f.c │ ├── clock-f.h │ ├── clock-stm32f0.c │ ├── clock-stm32f3.c │ ├── clock-stm32f4.c │ ├── clock-stm32l.c │ ├── clock-stm32l4.c │ ├── config-stm32f03x.h │ ├── config-stm32f05x.h │ ├── config-stm32f07x.h │ ├── config-stm32f09x.h │ ├── config-stm32f373.h │ ├── config-stm32f446.h │ ├── config-stm32l100.h │ ├── config-stm32l15x.h │ ├── config-stm32l442.h │ ├── config-stm32l476.h │ ├── config_chip.h │ ├── crc_hw.h │ ├── debug_printf.c │ ├── debug_printf.h │ ├── dma-stm32f4.c │ ├── dma.c │ ├── flash-f.c │ ├── flash-stm32f0.c │ ├── flash-stm32f3.c │ ├── flash-stm32f4.c │ ├── flash-stm32l.c │ ├── gpio-f0-l.c │ ├── gpio-stm32f0.c │ ├── gpio-stm32f3.c │ ├── gpio-stm32f4.c │ ├── gpio-stm32l.c │ ├── gpio-stm32l4.c │ ├── gpio.c │ ├── gpio_chip.h │ ├── hwtimer.c │ ├── hwtimer32.c │ ├── i2c-stm32f0.c │ ├── i2c-stm32f3.c │ ├── i2c-stm32f4.c │ ├── i2c-stm32l.c │ ├── i2c-stm32l4.c │ ├── jtag-stm32f0.c │ ├── jtag-stm32f3.c │ ├── jtag-stm32f4.c │ ├── jtag-stm32l.c │ ├── jtag-stm32l4.c │ ├── keyboard_raw.c │ ├── power_led.c │ ├── pwm.c │ ├── pwm_chip.h │ ├── registers.h │ ├── spi.c │ ├── spi_master.c │ ├── stm32-dma.h │ ├── system.c │ ├── uart.c │ ├── usart-stm32f0.c │ ├── usart-stm32f0.h │ ├── usart-stm32f3.c │ ├── usart-stm32f3.h │ ├── usart-stm32l.c │ ├── usart-stm32l.h │ ├── usart.c │ ├── usart.h │ ├── usart_info_command.c │ ├── usart_rx_dma.c │ ├── usart_rx_dma.h │ ├── usart_rx_interrupt-stm32f0.c │ ├── usart_rx_interrupt-stm32f3.c │ ├── usart_rx_interrupt-stm32l.c │ ├── usart_rx_interrupt.c │ ├── usart_tx_dma.c │ ├── usart_tx_dma.h │ ├── usart_tx_interrupt.c │ ├── usb-stm32f0.c │ ├── usb-stm32f3.c │ ├── usb-stm32f3.h │ ├── usb-stm32l.c │ ├── usb-stream.c │ ├── usb-stream.h │ ├── usb.c │ ├── usb_console.c │ ├── usb_dwc.c │ ├── usb_dwc_console.c │ ├── usb_dwc_console.h │ ├── usb_dwc_hw.h │ ├── usb_dwc_registers.h │ ├── usb_dwc_stream.c │ ├── usb_dwc_stream.h │ ├── usb_dwc_update.h │ ├── usb_endpoints.S │ ├── usb_gpio.c │ ├── usb_gpio.h │ ├── usb_hid.c │ ├── usb_hid_hw.h │ ├── usb_hid_keyboard.c │ ├── usb_hid_touchpad.c │ ├── usb_hw.h │ ├── usb_i2c.c │ ├── usb_i2c.h │ ├── usb_pd_phy.c │ ├── usb_power.c │ ├── usb_power.h │ ├── usb_spi.c │ ├── usb_spi.h │ └── watchdog.c ├── common ├── acpi.c ├── adc.c ├── als.c ├── ap_hang_detect.c ├── backlight_lid.c ├── battery.c ├── bluetooth_le.c ├── btle_hci_controller.c ├── btle_ll.c ├── build.mk ├── button.c ├── capsense.c ├── case_closed_debug.c ├── charge_manager.c ├── charge_ramp.c ├── charge_state_v2.c ├── charger.c ├── charger_profile_override.c ├── chipset.c ├── clz.c ├── console.c ├── console_output.c ├── crc.c ├── crc8.c ├── device_state.c ├── dptf.c ├── ec.libsharedobjs.ld ├── extension.c ├── extpower_gpio.c ├── fan.c ├── firmware_image.S ├── firmware_image.lds.S ├── flash.c ├── fmap.c ├── gesture.c ├── gpio.c ├── gpio_commands.c ├── hooks.c ├── host_command.c ├── host_command_master.c ├── host_command_pd.c ├── host_event_commands.c ├── i2c.c ├── i2c_wedge.c ├── i2cs_tpm.c ├── inductive_charging.c ├── keyboard_8042.c ├── keyboard_8042_sharedlib.c ├── keyboard_mkbp.c ├── keyboard_scan.c ├── keyboard_test.c ├── lb_common.c ├── led_common.c ├── led_policy_std.c ├── lid_angle.c ├── lid_switch.c ├── lightbar.c ├── mag_cal.c ├── main.c ├── mat33.c ├── mat44.c ├── math_util.c ├── memory_commands.c ├── mkbp_event.c ├── motion_lid.c ├── motion_sense.c ├── nvmem.c ├── nvmem_vars.c ├── onewire.c ├── panic_output.c ├── pd_log.c ├── port80.c ├── power_button.c ├── power_button_x86.c ├── printf.c ├── pstore_commands.c ├── pwm.c ├── pwm_kblight.c ├── queue.c ├── queue_policies.c ├── rsa.c ├── rwsig.c ├── sensor_common.c ├── sha1.c ├── sha256.c ├── shared_mem.c ├── shmalloc.c ├── smbus.c ├── spi_commands.c ├── spi_flash.c ├── spi_flash_reg.c ├── spi_nor.c ├── switch.c ├── system.c ├── tablet_mode.c ├── temp_sensor.c ├── test_util.c ├── thermal.c ├── throttle_ap.c ├── timer.c ├── tpm_registers.c ├── uart_buffering.c ├── update_fw.c ├── usb_charger.c ├── usb_i2c.c ├── usb_pd_policy.c ├── usb_pd_protocol.c ├── usb_pd_tcpc.c ├── usb_port_power_dumb.c ├── usb_port_power_smart.c ├── usb_update.c ├── util.c ├── vboot_hash.c ├── vec3.c ├── version.c ├── virtual_battery.c ├── vstore.c └── wireless.c ├── core ├── cortex-m │ ├── atomic.h │ ├── build.mk │ ├── config_core.h │ ├── cpu.c │ ├── cpu.h │ ├── ec.lds.S │ ├── include │ │ ├── math.h │ │ └── mpu.h │ ├── init.S │ ├── irq_handler.h │ ├── ldivmod.S │ ├── mpu.c │ ├── panic.c │ ├── switch.S │ ├── task.c │ ├── uldivmod.S │ └── watchdog.c ├── cortex-m0 │ ├── atomic.h │ ├── build.mk │ ├── config_core.h │ ├── cpu.c │ ├── cpu.h │ ├── div.S │ ├── ec.lds.S │ ├── init.S │ ├── irq_handler.h │ ├── ldivmod.S │ ├── lmul.S │ ├── panic.c │ ├── switch.S │ ├── task.c │ ├── thumb_case.S │ ├── uldivmod.S │ └── watchdog.c ├── host │ ├── atomic.h │ ├── build.mk │ ├── cpu.h │ ├── disabled.c │ ├── host_exe.lds │ ├── host_task.h │ ├── irq_handler.h │ ├── main.c │ ├── panic.c │ ├── stack_trace.c │ ├── task.c │ └── timer.c ├── minute-ia │ ├── atomic.c │ ├── atomic.h │ ├── build.mk │ ├── config_core.h │ ├── cpu.c │ ├── cpu.h │ ├── ec.lds.S │ ├── include │ │ └── math.h │ ├── init.S │ ├── interrupts.c │ ├── interrupts.h │ ├── irq_handler.h │ ├── mpu.c │ ├── panic.c │ ├── switch.S │ ├── task.c │ └── task_defs.h └── nds32 │ ├── __muldi3.S │ ├── atomic.h │ ├── build.mk │ ├── config_core.h │ ├── cpu.c │ ├── cpu.h │ ├── ec.lds.S │ ├── include │ └── math.h │ ├── init.S │ ├── irq_chip.h │ ├── irq_handler.h │ ├── math.c │ ├── panic.c │ ├── switch.S │ └── task.c ├── cts ├── README ├── build.mk ├── common │ ├── __init__.py │ ├── board.py │ ├── cts.rc │ ├── cts_common.h │ ├── cts_testlist.h │ ├── dut_common.c │ ├── dut_common.h │ ├── th_common.c │ └── th_common.h ├── cts.py ├── cts.tasklist ├── gpio │ ├── cts.testlist │ ├── dut.c │ └── th.c ├── hook │ ├── dut.c │ └── th.c ├── i2c │ ├── cts.testlist │ ├── cts_i2c.h │ ├── dut.c │ └── th.c ├── interrupt │ ├── cts.testlist │ ├── dut.c │ └── th.c ├── meta │ ├── cts.testlist │ ├── dut.c │ └── th.c ├── mutex │ ├── cts.tasklist │ ├── dut.c │ └── th.c ├── task │ ├── cts.tasklist │ ├── cts.testlist │ ├── dut.c │ └── th.c └── timer │ ├── cts.testlist │ ├── dut.c │ └── th.c ├── docs └── case_closed_debugging.md ├── driver ├── accel_bma2x2.c ├── accel_bma2x2.h ├── accel_kionix.c ├── accel_kionix.h ├── accel_kx022.h ├── accel_kxcj9.h ├── accel_lis2dh.c ├── accel_lis2dh.h ├── accelgyro_bmi160.c ├── accelgyro_bmi160.h ├── accelgyro_lsm6ds0.c ├── accelgyro_lsm6ds0.h ├── accelgyro_lsm6dsm.c ├── accelgyro_lsm6dsm.h ├── als_al3010.c ├── als_al3010.h ├── als_isl29035.c ├── als_isl29035.h ├── als_opt3001.c ├── als_opt3001.h ├── als_si114x.c ├── als_si114x.h ├── baro_bmp280.c ├── baro_bmp280.h ├── battery │ ├── bq20z453.c │ ├── bq27541.c │ ├── bq27621_g1.c │ ├── sb_fw_update.c │ ├── sb_fw_update.h │ └── smart.c ├── build.mk ├── charger │ ├── bd9995x.c │ ├── bd9995x.h │ ├── bq24192.c │ ├── bq24192.h │ ├── bq24707a.c │ ├── bq24707a.h │ ├── bq24715.c │ ├── bq24715.h │ ├── bq24725.c │ ├── bq24725.h │ ├── bq24735.c │ ├── bq24735.h │ ├── bq24738.c │ ├── bq24738.h │ ├── bq24773.c │ ├── bq24773.h │ ├── bq2589x.c │ ├── bq2589x.h │ ├── isl923x.c │ └── isl923x.h ├── gyro_l3gd20h.c ├── gyro_l3gd20h.h ├── ina2xx.c ├── ina2xx.h ├── ioexpander_pca9534.c ├── ioexpander_pca9534.h ├── led │ ├── ds2413.c │ ├── lp5562.c │ └── lp5562.h ├── mag_bmm150.c ├── mag_bmm150.h ├── mcdp28x0.c ├── mcdp28x0.h ├── pi3usb30532.h ├── pi3usb9281.h ├── pmic_tps650830.h ├── pmu_tps65090.c ├── pmu_tps65090_charger.c ├── pmu_tps65090_powerinfo.c ├── ps8740.h ├── regulator_ir357x.c ├── stm_mems_common.c ├── stm_mems_common.h ├── tcpm │ ├── anx74xx.c │ ├── anx74xx.h │ ├── anx7688.c │ ├── anx7688.h │ ├── fusb302.c │ ├── fusb302.h │ ├── it83xx.c │ ├── it83xx_pd.h │ ├── ps8751.c │ ├── ps8751.h │ ├── stub.c │ ├── tcpci.c │ ├── tcpci.h │ └── tcpm.h ├── temp_sensor │ ├── bd99992gw.c │ ├── bd99992gw.h │ ├── ec_adc.c │ ├── ec_adc.h │ ├── g78x.c │ ├── g78x.h │ ├── thermistor.h │ ├── thermistor_ncp15wb.c │ ├── tmp006.c │ ├── tmp006.h │ ├── tmp112.c │ ├── tmp112.h │ ├── tmp432.c │ └── tmp432.h ├── touchpad_elan.c ├── touchpad_elan.h ├── usb_mux.c ├── usb_mux_pi3usb30532.c ├── usb_mux_ps8740.c ├── usb_mux_virtual.c └── usb_switch_pi3usb9281.c ├── extra ├── README ├── ftdi_hostcmd │ ├── .gitignore │ ├── Makefile │ ├── README │ └── test_cmds.c ├── lightbar │ ├── .gitignore │ ├── Makefile │ ├── README │ ├── input.c │ ├── main.c │ ├── programs │ │ ├── bad-decode-32.bin │ │ ├── bad-decode-8.bin │ │ ├── bad-jump.bin │ │ ├── bad-opcode.bin │ │ ├── green-pulse.bin │ │ ├── green-pulse.lbs │ │ ├── infinite-jump.bin │ │ ├── infinite-jump.lbs │ │ ├── konami.bin │ │ ├── konami.lbs │ │ ├── rainbow-shift.bin │ │ ├── rainbow-shift.lbs │ │ ├── red-green-blink.bin │ │ ├── red-green-blink.lbs │ │ ├── s0.bin │ │ ├── s0.lbs │ │ ├── s0s3.bin │ │ ├── s0s3.lbs │ │ ├── s3.bin │ │ ├── s3.lbs │ │ ├── s3s0.bin │ │ └── s3s0.lbs │ ├── simulation.h │ └── windows.c ├── sps_errs │ ├── .gitignore │ ├── Makefile │ ├── README │ └── prog.c ├── usb_console │ ├── .gitignore │ ├── Makefile │ └── usb_console.c ├── usb_gpio │ ├── .gitignore │ ├── Makefile │ └── usb_gpio.c ├── usb_power │ ├── board.README │ ├── board │ │ ├── kevin │ │ │ ├── kevin.board │ │ │ └── kevin_all.scenario │ │ └── marlin │ │ │ ├── marlin.board │ │ │ ├── marlin_all_A.scenario │ │ │ ├── marlin_all_B.scenario │ │ │ ├── marlin_common.scenario │ │ │ ├── marlin_short.scenario │ │ │ └── marlin_vbat.scenario │ └── powerlog.py ├── usb_serial │ ├── .gitignore │ ├── 51-google-serial-fallback.rules │ ├── 51-google-serial.rules │ ├── Makefile │ ├── README.md │ ├── add_usb_serial_id │ ├── console.py │ ├── install │ └── raiden.c ├── usb_spi │ └── stm32spi.py └── usb_updater │ ├── .gitignore │ ├── Makefile │ ├── fw_update.py │ ├── servo_micro.json │ ├── servo_v4.json │ ├── sweetberry.json │ └── usb_updater.c ├── include ├── 2id.h ├── accelgyro.h ├── acpi.h ├── adc.h ├── als.h ├── ap_hang_detect.h ├── backlight.h ├── battery.h ├── battery_bq27621_g1.h ├── battery_smart.h ├── bluetooth_le.h ├── bluetooth_le_ll.h ├── board_config.h ├── btle_hci2.h ├── btle_hci_int.h ├── button.h ├── byteorder.h ├── capsense.h ├── case_closed_debug.h ├── charge_manager.h ├── charge_ramp.h ├── charge_state.h ├── charge_state_v1.h ├── charge_state_v2.h ├── charger.h ├── charger_detect.h ├── charger_profile_override.h ├── chipset.h ├── clock.h ├── common.h ├── compile_time_macros.h ├── config.h ├── config_std_internal_flash.h ├── console.h ├── console_channel.inc ├── consumer.h ├── crc.h ├── crc8.h ├── crypto_api.h ├── device_state.h ├── dma.h ├── dptf.h ├── ec_commands.h ├── eeprom.h ├── espi.h ├── extension.h ├── extpower.h ├── fan.h ├── flash.h ├── gesture.h ├── gpio.h ├── gpio.wrap ├── gpio_list.h ├── gpio_signal.h ├── hooks.h ├── host_command.h ├── hwtimer.h ├── i2c.h ├── i8042_protocol.h ├── inductive_charging.h ├── jtag.h ├── keyboard_8042.h ├── keyboard_8042_sharedlib.h ├── keyboard_config.h ├── keyboard_mkbp.h ├── keyboard_protocol.h ├── keyboard_raw.h ├── keyboard_scan.h ├── keyboard_test.h ├── lb_common.h ├── led_common.h ├── libsharedobjs.h ├── lid_angle.h ├── lid_switch.h ├── lightbar.h ├── lightbar_msg_list.h ├── lightbar_opcode_list.h ├── link_defs.h ├── lpc.h ├── mag_cal.h ├── mat33.h ├── mat44.h ├── math_util.h ├── memory_commands.h ├── mkbp_event.h ├── module_id.h ├── motion_lid.h ├── motion_sense.h ├── nvmem.h ├── nvmem_vars.h ├── onewire.h ├── panic.h ├── peci.h ├── pmu_tpschrome.h ├── port80.h ├── power.h ├── power_button.h ├── power_led.h ├── printf.h ├── producer.h ├── pwm.h ├── queue.h ├── queue_policies.h ├── rsa.h ├── sfdp.h ├── sha1.h ├── sha256.h ├── shared_mem.h ├── smbus.h ├── software_panic.h ├── spi.h ├── spi_flash.h ├── spi_flash_reg.h ├── spi_nor.h ├── stack_trace.h ├── switch.h ├── system.h ├── tablet_mode.h ├── task.h ├── task_id.h ├── temp_sensor.h ├── temp_sensor_chip.h ├── test_util.h ├── thermal.h ├── throttle_ap.h ├── timer.h ├── tpm_manufacture.h ├── tpm_registers.h ├── tpm_vendor_cmds.h ├── trng.h ├── uart.h ├── update_fw.h ├── usb_api.h ├── usb_bb.h ├── usb_charge.h ├── usb_console.h ├── usb_descriptor.h ├── usb_hid.h ├── usb_hid_touchpad.h ├── usb_i2c.h ├── usb_mux.h ├── usb_pd.h ├── usb_pd_tcpc.h ├── usb_pd_tcpm.h ├── util.h ├── vb21_struct.h ├── vboot_hash.h ├── vec3.h ├── vec4.h ├── version.h ├── virtual_battery.h ├── watchdog.h └── wireless.h ├── power ├── apollolake.c ├── apollolake.h ├── braswell.c ├── build.mk ├── common.c ├── ec_driven.c ├── gaia.c ├── intel_x86.c ├── intel_x86.h ├── mediatek.c ├── rk3399.c ├── rockchip.c ├── skylake.c ├── skylake.h └── tegra.c ├── setup.py ├── test ├── battery_get_params_smart.c ├── battery_get_params_smart.tasklist ├── bklight_lid.c ├── bklight_lid.tasklist ├── bklight_passthru.c ├── bklight_passthru.tasklist ├── build.mk ├── button.c ├── button.tasklist ├── charge_manager.c ├── charge_manager.tasklist ├── charge_manager_drp_charging.tasklist ├── charge_ramp.c ├── charge_ramp.tasklist ├── console_edit.c ├── console_edit.tasklist ├── extpwr_gpio.c ├── extpwr_gpio.tasklist ├── fan.c ├── fan.tasklist ├── flash.c ├── flash.tasklist ├── hooks.c ├── hooks.tasklist ├── host_command.c ├── host_command.tasklist ├── inductive_charging.c ├── inductive_charging.tasklist ├── interrupt.c ├── interrupt.tasklist ├── kb_8042.c ├── kb_8042.tasklist ├── kb_mkbp.c ├── kb_mkbp.tasklist ├── kb_scan.c ├── kb_scan.tasklist ├── key_sequence.txt ├── lid_sw.c ├── lid_sw.tasklist ├── lightbar.c ├── lightbar.tasklist ├── math_util.c ├── math_util.tasklist ├── motion_lid.c ├── motion_lid.tasklist ├── mutex.c ├── mutex.tasklist ├── nvmem.c ├── nvmem.tasklist ├── nvmem_vars.c ├── nvmem_vars.tasklist ├── pingpong.c ├── pingpong.tasklist ├── power_button.c ├── power_button.tasklist ├── powerdemo.c ├── powerdemo.h ├── powerdemo.tasklist ├── queue.c ├── queue.tasklist ├── rsa.c ├── rsa.tasklist ├── rsa2048-3.h ├── rsa2048-3.pem ├── rsa2048-F4.h ├── rsa2048-F4.pem ├── rsa3.tasklist ├── sbs_charging_v2.c ├── sbs_charging_v2.tasklist ├── shmalloc.c ├── shmalloc.tasklist ├── stress.c ├── stress.tasklist ├── system.c ├── system.tasklist ├── test-matrix.bin ├── test_config.h ├── thermal.c ├── thermal.tasklist ├── timer_calib.c ├── timer_calib.py ├── timer_calib.tasklist ├── timer_dos.c ├── timer_dos.tasklist ├── timer_jump.py ├── timer_jump.tasklist ├── tpm_test │ ├── Makefile │ ├── bn_test.c │ ├── crypto_test.py │ ├── crypto_test.xml │ ├── ecc_test.py │ ├── ecies_test.py │ ├── ftdi_spi_tpm.c │ ├── ftdi_spi_tpm.h │ ├── ftdi_spi_tpm.i │ ├── genvectors.py │ ├── hash_test.py │ ├── hkdf_test.py │ ├── mpsse.c │ ├── mpsse.h │ ├── rsa1024.pem │ ├── rsa2048.pem │ ├── rsa4096.pem │ ├── rsa768.pem │ ├── rsa_test.py │ ├── subcmd.py │ ├── support.c │ ├── support.h │ ├── testlib │ │ ├── common.c │ │ ├── common.h │ │ ├── trng.h │ │ └── util.h │ ├── tpmtest.py │ ├── upgrade_test.py │ └── utils.py ├── usb_pd.c ├── usb_pd.tasklist ├── usb_pd_giveback.tasklist ├── usb_pd_test_util.h ├── usb_test │ ├── Makefile │ ├── README │ └── device_configuration.c ├── utils.c └── utils.tasklist └── util ├── build.mk ├── comm-dev.c ├── comm-host.c ├── comm-host.h ├── comm-i2c.c ├── comm-lpc.c ├── config_option_check.py ├── cros_ec_dev.h ├── ec3po ├── __init__.py ├── console.py ├── console_unittest.py ├── interpreter.py ├── interpreter_unittest.py └── run_tests.sh ├── ec_flash.c ├── ec_flash.h ├── ec_panicinfo.c ├── ec_panicinfo.h ├── ec_parse_panicinfo.c ├── ec_sb_firmware_update.c ├── ec_sb_firmware_update.h ├── ec_uartd.c ├── ecst.c ├── ecst.h ├── ectool.c ├── ectool.h ├── ectool_keyscan.c ├── flash_ec ├── flash_pd.py ├── g_regs ├── getversion.sh ├── inject-keys.py ├── iteflash.c ├── lbcc.c ├── lbplay.c ├── lock ├── android.c ├── android.h ├── build.mk ├── file_lock.c ├── gec_lock.c ├── gec_lock.h ├── ipc_lock.h └── locks.h ├── misc_util.c ├── misc_util.h ├── openocd ├── lm4_chip.cfg ├── lm4x_cmds.tcl ├── npcx.cfg ├── npcx_chip.cfg ├── npcx_cmds.tcl ├── nrf51_chip.cfg ├── nrf51_cmds.tcl └── servo.cfg ├── powerd_lock.c ├── powerd_lock.h ├── presubmit_check.sh ├── run_host_test ├── signer ├── .gitignore ├── aes.cc ├── bs ├── build.mk ├── codesigner.cc ├── common │ ├── aes.h │ ├── ecdh.h │ ├── gnubby.h │ ├── image.h │ ├── publickey.h │ └── signed_header.h ├── cr50_RW-prod.pem.pub ├── cr50_rom0-dev-blsign.pem.pub ├── ec_RW-manifest-dev.json ├── ec_RW-manifest-prod.json ├── ecdh.cc ├── fuses.xml ├── gnubby.cc ├── image.cc ├── loader-testkey-A.pem ├── publickey.cc └── rom-testkey-A.pem ├── stm32mon.c ├── temp_metrics.conf └── test-inject-keys.sh /.checkpatch.conf: -------------------------------------------------------------------------------- 1 | # Not Linux, so don't expect a Linux tree. 2 | --no-tree 3 | 4 | # Ignore aspects we don't follow here. 5 | --ignore SPLIT_STRING 6 | 7 | --ignore GIT_COMMIT_ID 8 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | build/ 2 | private*/ 3 | *.swp 4 | *.pyc 5 | tags 6 | TAGS 7 | cscope.* 8 | .tests-passed 9 | .failedboards/ 10 | .sizes.txt 11 | -------------------------------------------------------------------------------- /COMMIT-QUEUE.ini: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2013 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 | # Per-project Commit Queue settings. 6 | # Documentation: http://goo.gl/4rZhAx 7 | 8 | [GENERAL] 9 | 10 | # Board-specific no-vmtest-pre-cq, include boards that actually build 11 | # chromeos-ec. We use the no-vmtest-pre-cq configs since the tests won't 12 | # actually test against our EC changes. (That's what FAFT is for) 13 | pre-cq-configs: gru-no-vmtest-pre-cq reef-no-vmtest-pre-cq chell-no-vmtest-pre-cq 14 | 15 | # Stages to ignore in the commit queue. If these steps break, your CL will be 16 | # submitted anyway. Use with caution. 17 | ignored-stages: HWTest ImageTest VMTest 18 | -------------------------------------------------------------------------------- /OWNERS: -------------------------------------------------------------------------------- 1 | # Chromium EC owners 2 | rspangler@chromium.org 3 | victoryang@chromium.org 4 | vpalatin@chromium.org 5 | wfrichar@chromium.org 6 | 7 | # Don't inherit owners from elsewhere in the manifest 8 | set noparent 9 | -------------------------------------------------------------------------------- /PRESUBMIT.cfg: -------------------------------------------------------------------------------- 1 | [Hook Overrides] 2 | branch_check: true 3 | checkpatch_check: true 4 | 5 | # We are using Linux style indentation with tabs 6 | # The indentation is checked by checkpatch not the python script 7 | tab_check: false 8 | 9 | [Hook Overrides Options] 10 | checkpatch_check: --no-tree --ignore=MSLEEP,VOLATILE 11 | 12 | [Hook Scripts] 13 | hook0 = util/presubmit_check.sh 2>&1 14 | hook1 = util/config_option_check.py 2>&1 15 | -------------------------------------------------------------------------------- /README: -------------------------------------------------------------------------------- 1 | For an overview of the Embedded Controller firmware, refer to 2 | 3 | http://www.chromium.org/chromium-os/2014-firmware-summit 4 | 5 | For instructions on building from source, refer to 6 | 7 | http://www.chromium.org/chromium-os/ec-development/getting-started-building-ec-images-quickly 8 | -------------------------------------------------------------------------------- /board/OWNERS: -------------------------------------------------------------------------------- 1 | # Additional owners for board directory 2 | dparker@chromium.org 3 | -------------------------------------------------------------------------------- /board/bds/build.mk: -------------------------------------------------------------------------------- 1 | # -*- makefile -*- 2 | # Copyright (c) 2012 The Chromium OS Authors. All rights reserved. 3 | # Use of this source code is governed by a BSD-style license that can be 4 | # found in the LICENSE file. 5 | # 6 | # Board specific files build 7 | # 8 | 9 | # the IC is TI Stellaris LM4 10 | CHIP:=lm4 11 | 12 | board-y=board.o 13 | -------------------------------------------------------------------------------- /board/big/build.mk: -------------------------------------------------------------------------------- 1 | # -*- makefile -*- 2 | # Copyright (c) 2014 The Chromium OS Authors. All rights reserved. 3 | # Use of this source code is governed by a BSD-style license that can be 4 | # found in the LICENSE file. 5 | # 6 | # Board specific files build 7 | 8 | # the IC is STmicro STM32L100RBT6 9 | CHIP:=stm32 10 | CHIP_FAMILY:=stm32l 11 | CHIP_VARIANT:=stm32l100 12 | 13 | board-y=board.o battery.o led.o 14 | -------------------------------------------------------------------------------- /board/chell/build.mk: -------------------------------------------------------------------------------- 1 | # -*- makefile -*- 2 | # Copyright 2015 The Chromium OS Authors. All rights reserved. 3 | # Use of this source code is governed by a BSD-style license that can be 4 | # found in the LICENSE file. 5 | # 6 | # Board specific files build 7 | # 8 | 9 | # the IC is SMSC MEC1322 / external SPI is 512KB / external clock is crystal 10 | CHIP:=mec1322 11 | CHIP_SPI_SIZE_KB:=512 12 | 13 | board-y=board.o led.o 14 | board-$(CONFIG_BATTERY_SMART)+=battery.o 15 | board-$(CONFIG_USB_POWER_DELIVERY)+=usb_pd_policy.o 16 | -------------------------------------------------------------------------------- /board/chell/lfw/gpio.inc: -------------------------------------------------------------------------------- 1 | /* -*- mode:c -*- 2 | * 3 | * Copyright (c) 2015 The Chromium OS Authors. All rights reserved. 4 | * Use of this source code is governed by a BSD-style license that can be 5 | * found in the LICENSE file. 6 | * 7 | * Minimal set of GPIOs needed for LFW loader 8 | */ 9 | 10 | /* Declare symbolic names for all the GPIOs that we care about. 11 | * Note: Those with interrupt handlers must be declared first. */ 12 | 13 | /* SPI PVT chip select */ 14 | GPIO(PVT_CS0, PIN(146), GPIO_ODR_HIGH) 15 | 16 | /* Alternate functions GPIO definition */ 17 | /* UART */ 18 | ALTERNATE(PIN_MASK(16, 0x24), 1, MODULE_UART, 0) 19 | /* SPI pins */ 20 | ALTERNATE(PIN_MASK(5, 0x10), 1, MODULE_SPI, 0) 21 | ALTERNATE(PIN_MASK(16, 0x10), 1, MODULE_SPI, 0) 22 | ALTERNATE(PIN_MASK(15, 0x08), 1, MODULE_SPI, 0) 23 | -------------------------------------------------------------------------------- /board/chell_pd: -------------------------------------------------------------------------------- 1 | glados_pd/ -------------------------------------------------------------------------------- /board/cr50/tpm2/endian.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2015 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 | #ifndef __EC_BOARD_CR50_TPM2_ENDIAN_H 7 | #define __EC_BOARD_CR50_TPM2_ENDIAN_H 8 | 9 | #include "byteorder.h" 10 | 11 | #endif /* __EC_BOARD_CR50_TPM2_ENDIAN_H */ 12 | -------------------------------------------------------------------------------- /board/cr50/tpm2/hash_data.c: -------------------------------------------------------------------------------- 1 | /* Copyright 2015 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 | #include "CryptoEngine.h" 6 | 7 | /* 8 | * This is unfortunate, but this is the only way to bring in necessary data 9 | * from the TPM2 library, as this file is not compiled in embedded mode. 10 | */ 11 | #include "CpriHashData.c" 12 | -------------------------------------------------------------------------------- /board/cr50/tpm2/trng.c: -------------------------------------------------------------------------------- 1 | /* Copyright 2016 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 | #include "CryptoEngine.h" 7 | 8 | CRYPT_RESULT _cpri__StirRandom(int32_t num, uint8_t *entropy) 9 | { 10 | return CRYPT_SUCCESS; /* NO-OP on CR50. */ 11 | } 12 | -------------------------------------------------------------------------------- /board/cr50/tpm2/upgrade.c: -------------------------------------------------------------------------------- 1 | /* Copyright 2016 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 | #include "extension.h" 7 | #include "upgrade_fw.h" 8 | 9 | DECLARE_EXTENSION_COMMAND(EXTENSION_FW_UPGRADE, fw_upgrade_command_handler); 10 | -------------------------------------------------------------------------------- /board/cr50/wp.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2017 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 | #include "common.h" 7 | 8 | /** 9 | * Set the current write protect state in RBOX and long life scratch register. 10 | * 11 | * @param asserted: 0 to disable write protect, otherwise enable write protect. 12 | */ 13 | void set_wp_state(int asserted); 14 | -------------------------------------------------------------------------------- /board/dingdong/build.mk: -------------------------------------------------------------------------------- 1 | # -*- makefile -*- 2 | # Copyright (c) 2014 The Chromium OS Authors. All rights reserved. 3 | # Use of this source code is governed by a BSD-style license that can be 4 | # found in the LICENSE file. 5 | # 6 | # Board specific files build 7 | 8 | # the IC is STmicro STM32F072B 9 | CHIP:=stm32 10 | CHIP_FAMILY:=stm32f0 11 | CHIP_VARIANT:=stm32f07x 12 | 13 | board-y=board.o 14 | board-$(CONFIG_USB_POWER_DELIVERY)+=usb_pd_policy.o 15 | -------------------------------------------------------------------------------- /board/discovery-stm32f072/build.mk: -------------------------------------------------------------------------------- 1 | # -*- makefile -*- 2 | # Copyright (c) 2014 The Chromium OS Authors. All rights reserved. 3 | # Use of this source code is governed by a BSD-style license that can be 4 | # found in the LICENSE file. 5 | # 6 | # Board specific files build 7 | 8 | # the IC is STmicro STM32F072RBT6 9 | CHIP:=stm32 10 | CHIP_FAMILY:=stm32f0 11 | CHIP_VARIANT:=stm32f07x 12 | 13 | board-y=board.o 14 | -------------------------------------------------------------------------------- /board/discovery-stm32f072/ec.tasklist: -------------------------------------------------------------------------------- 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 | /** 7 | * List of enabled tasks in the priority order 8 | * 9 | * The first one has the lowest priority. 10 | * 11 | * For each task, use the macro TASK_ALWAYS(n, r, d, s) for base tasks and 12 | * TASK_NOTEST(n, r, d, s) for tasks that can be excluded in test binaries, 13 | * where : 14 | * 'n' in the name of the task 15 | * 'r' in the main routine of the task 16 | * 'd' in an opaque parameter passed to the routine at startup 17 | * 's' is the stack size in bytes; must be a multiple of 8 18 | */ 19 | #define CONFIG_TASK_LIST \ 20 | TASK_ALWAYS(HOOKS, hook_task, NULL, TASK_STACK_SIZE) \ 21 | TASK_ALWAYS(CONSOLE, console_task, NULL, TASK_STACK_SIZE) 22 | -------------------------------------------------------------------------------- /board/discovery-stm32f072/openocd-flash.cfg: -------------------------------------------------------------------------------- 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 | source [find board/stm32f0discovery.cfg] 6 | 7 | # For flashing, force the board into reset on connect, this ensures that 8 | # code running on the core can't interfere with programming. 9 | reset_config connect_assert_srst 10 | 11 | gdb_port 0 12 | tcl_port 0 13 | telnet_port 0 14 | init 15 | reset init 16 | flash write_image erase $BUILD_DIR/ec.bin 0x08000000 17 | reset halt 18 | resume 19 | shutdown 20 | -------------------------------------------------------------------------------- /board/discovery/build.mk: -------------------------------------------------------------------------------- 1 | # -*- makefile -*- 2 | # Copyright (c) 2013 The Chromium OS Authors. All rights reserved. 3 | # Use of this source code is governed by a BSD-style license that can be 4 | # found in the LICENSE file. 5 | # 6 | # Board specific files build 7 | 8 | # the IC is STmicro STM32L152RCT6 9 | CHIP:=stm32 10 | CHIP_FAMILY:=stm32l 11 | CHIP_VARIANT:=stm32l15x 12 | 13 | board-y=board.o 14 | -------------------------------------------------------------------------------- /board/discovery/ec.tasklist: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2013 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 | /** 7 | * List of enabled tasks in the priority order 8 | * 9 | * The first one has the lowest priority. 10 | * 11 | * For each task, use the macro TASK_ALWAYS(n, r, d, s) for base tasks and 12 | * TASK_NOTEST(n, r, d, s) for tasks that can be excluded in test binaries, 13 | * where : 14 | * 'n' in the name of the task 15 | * 'r' in the main routine of the task 16 | * 'd' in an opaque parameter passed to the routine at startup 17 | * 's' is the stack size in bytes; must be a multiple of 8 18 | */ 19 | #define CONFIG_TASK_LIST \ 20 | TASK_ALWAYS(HOOKS, hook_task, NULL, TASK_STACK_SIZE) \ 21 | TASK_ALWAYS(CONSOLE, console_task, NULL, TASK_STACK_SIZE) 22 | -------------------------------------------------------------------------------- /board/discovery/openocd-flash.cfg: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2015 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 | source [find board/stm32ldiscovery.cfg] 6 | 7 | # For flashing, force the board into reset on connect, this ensures that 8 | # code running on the core can't interfere with programming. 9 | reset_config connect_assert_srst 10 | 11 | gdb_port 0 12 | tcl_port 0 13 | telnet_port 0 14 | init 15 | reset init 16 | flash write_image erase $BUILD_DIR/ec.bin 0x08000000 17 | reset halt 18 | resume 19 | shutdown 20 | -------------------------------------------------------------------------------- /board/elm/build.mk: -------------------------------------------------------------------------------- 1 | #-*- makefile -*- 2 | # Copyright 2016 The Chromium OS Authors. All rights reserved. 3 | # Use of this source code is governed by a BSD-style license that can be 4 | # found in the LICENSE file. 5 | # 6 | # Board specific files build 7 | 8 | # STmicro STM32F091VC 9 | CHIP := stm32 10 | CHIP_FAMILY := stm32f0 11 | CHIP_VARIANT:= stm32f09x 12 | 13 | board-y = board.o battery.o led.o 14 | board-$(CONFIG_USB_POWER_DELIVERY)+=usb_pd_policy.o 15 | -------------------------------------------------------------------------------- /board/eve/build.mk: -------------------------------------------------------------------------------- 1 | # -*- makefile -*- 2 | # Copyright 2016 The Chromium OS Authors. All rights reserved. 3 | # Use of this source code is governed by a BSD-style license that can be 4 | # found in the LICENSE file. 5 | # 6 | # Board specific files build 7 | # 8 | 9 | CHIP:=npcx 10 | CHIP_VARIANT:=npcx5m6g 11 | 12 | board-y=board.o led.o 13 | board-$(CONFIG_BATTERY_SMART)+=battery.o 14 | board-$(CONFIG_USB_POWER_DELIVERY)+=usb_pd_policy.o 15 | -------------------------------------------------------------------------------- /board/eve_fp/build.mk: -------------------------------------------------------------------------------- 1 | # Copyright 2017 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 | # Board specific files build 6 | 7 | # the IC is STmicroelectronics STM32L442KC 8 | CHIP:=stm32 9 | CHIP_FAMILY:=stm32l4 10 | CHIP_VARIANT:=stm32l442 11 | 12 | board-y=board.o 13 | -------------------------------------------------------------------------------- /board/glados/build.mk: -------------------------------------------------------------------------------- 1 | # -*- makefile -*- 2 | # Copyright 2015 The Chromium OS Authors. All rights reserved. 3 | # Use of this source code is governed by a BSD-style license that can be 4 | # found in the LICENSE file. 5 | # 6 | # Board specific files build 7 | # 8 | 9 | # the IC is SMSC MEC1322 / external SPI is 512KB / external clock is crystal 10 | CHIP:=mec1322 11 | CHIP_SPI_SIZE_KB:=512 12 | 13 | board-y=board.o led.o 14 | board-$(CONFIG_BATTERY_SMART)+=battery.o 15 | board-$(CONFIG_USB_POWER_DELIVERY)+=usb_pd_policy.o 16 | -------------------------------------------------------------------------------- /board/glados/lfw/gpio.inc: -------------------------------------------------------------------------------- 1 | /* -*- mode:c -*- 2 | * 3 | * Copyright (c) 2015 The Chromium OS Authors. All rights reserved. 4 | * Use of this source code is governed by a BSD-style license that can be 5 | * found in the LICENSE file. 6 | * 7 | * Minimal set of GPIOs needed for LFW loader 8 | */ 9 | 10 | /* Declare symbolic names for all the GPIOs that we care about. 11 | * Note: Those with interrupt handlers must be declared first. */ 12 | 13 | /* SPI PVT chip select */ 14 | GPIO(PVT_CS0, PIN(146), GPIO_ODR_HIGH) 15 | 16 | /* Alternate functions GPIO definition */ 17 | /* UART */ 18 | ALTERNATE(PIN_MASK(16, 0x24), 1, MODULE_UART, 0) 19 | /* SPI pins */ 20 | ALTERNATE(PIN_MASK(5, 0x10), 1, MODULE_SPI, 0) 21 | ALTERNATE(PIN_MASK(16, 0x10), 1, MODULE_SPI, 0) 22 | ALTERNATE(PIN_MASK(15, 0x08), 1, MODULE_SPI, 0) 23 | -------------------------------------------------------------------------------- /board/glados_pd/block.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MrChromebox/chrome-ec/a3f152f1b2e9fcd00c7871cc44285cba554ae966/board/glados_pd/block.png -------------------------------------------------------------------------------- /board/glados_pd/build.mk: -------------------------------------------------------------------------------- 1 | # -*- makefile -*- 2 | # Copyright 2015 The Chromium OS Authors. All rights reserved. 3 | # Use of this source code is governed by a BSD-style license that can be 4 | # found in the LICENSE file. 5 | # 6 | # Board specific files build 7 | 8 | # the IC is STmicro STM32F051C8T 9 | CHIP:=stm32 10 | CHIP_FAMILY:=stm32f0 11 | CHIP_VARIANT:=stm32f05x 12 | 13 | board-y=board.o 14 | 15 | # This target builds RW only. Therefore, remove RO from dependencies. 16 | all_deps=$(patsubst ro,,$(def_all_deps)) 17 | -------------------------------------------------------------------------------- /board/glados_pd/glados_pd.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MrChromebox/chrome-ec/a3f152f1b2e9fcd00c7871cc44285cba554ae966/board/glados_pd/glados_pd.pdf -------------------------------------------------------------------------------- /board/glados_pd/glados_pd.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MrChromebox/chrome-ec/a3f152f1b2e9fcd00c7871cc44285cba554ae966/board/glados_pd/glados_pd.png -------------------------------------------------------------------------------- /board/gru: -------------------------------------------------------------------------------- 1 | kevin -------------------------------------------------------------------------------- /board/hadoken/board.c: -------------------------------------------------------------------------------- 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 | #include "gpio.h" 6 | #include "registers.h" 7 | #include "util.h" 8 | 9 | 10 | /* To define the gpio_list[] instance. */ 11 | #include "gpio_list.h" 12 | 13 | -------------------------------------------------------------------------------- /board/hadoken/build.mk: -------------------------------------------------------------------------------- 1 | # -*- makefile -*- 2 | # Copyright (c) 2014 The Chromium OS Authors. All rights reserved. 3 | # Use of this source code is governed by a BSD-style license that can be 4 | # found in the LICENSE file. 5 | # 6 | # Board specific files build 7 | 8 | # the IC is Nordic nRF51822 9 | CHIP:=nrf51 10 | CHIP_FAMILY:=nrf51x22 11 | CHIP_VARIANT:=nrf51822 12 | 13 | board-y=board.o 14 | -------------------------------------------------------------------------------- /board/hadoken/ec.tasklist: -------------------------------------------------------------------------------- 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 | /** 7 | * List of enabled tasks in the priority order 8 | * 9 | * The first one has the lowest priority. 10 | * 11 | * For each task, use the macro TASK(n, r, d, s) where : 12 | * 'n' in the name of the task 13 | * 'r' in the main routine of the task 14 | * 'd' in an opaque parameter passed to the routine at startup 15 | * 's' is the stack size in bytes; must be a multiple of 8 16 | */ 17 | #define CONFIG_TASK_LIST \ 18 | TASK_ALWAYS(HOOKS, hook_task, NULL, LARGER_TASK_STACK_SIZE) \ 19 | TASK_ALWAYS(CONSOLE, console_task, NULL, TASK_STACK_SIZE) \ 20 | TASK_ALWAYS(BLE_LL, bluetooth_ll_task, NULL, TASK_STACK_SIZE) 21 | 22 | -------------------------------------------------------------------------------- /board/hammer/build.mk: -------------------------------------------------------------------------------- 1 | # -*- makefile -*- 2 | # Copyright 2016 The Chromium OS Authors. All rights reserved. 3 | # Use of this source code is governed by a BSD-style license that can be 4 | # found in the LICENSE file. 5 | # 6 | # Board specific files build 7 | 8 | # the IC is STmicro STM32F072RBT6 9 | CHIP:=stm32 10 | CHIP_FAMILY:=stm32f0 11 | CHIP_VARIANT:=stm32f07x 12 | 13 | board-y=board.o 14 | -------------------------------------------------------------------------------- /board/hoho/build.mk: -------------------------------------------------------------------------------- 1 | # -*- makefile -*- 2 | # Copyright (c) 2014 The Chromium OS Authors. All rights reserved. 3 | # Use of this source code is governed by a BSD-style license that can be 4 | # found in the LICENSE file. 5 | # 6 | # Board specific files build 7 | 8 | # the IC is STmicro STM32F072B 9 | CHIP:=stm32 10 | CHIP_FAMILY:=stm32f0 11 | CHIP_VARIANT:=stm32f07x 12 | 13 | board-y=board.o 14 | board-$(CONFIG_USB_POWER_DELIVERY)+=usb_pd_policy.o 15 | -------------------------------------------------------------------------------- /board/honeybuns/build.mk: -------------------------------------------------------------------------------- 1 | # -*- makefile -*- 2 | # Copyright 2015 The Chromium OS Authors. All rights reserved. 3 | # Use of this source code is governed by a BSD-style license that can be 4 | # found in the LICENSE file. 5 | # 6 | # Board specific files build 7 | 8 | # the IC is STmicro STM32F072CBU6 9 | CHIP:=stm32 10 | CHIP_FAMILY:=stm32f0 11 | CHIP_VARIANT:=stm32f07x 12 | 13 | board-y=board.o hx3.o 14 | board-$(CONFIG_USB_POWER_DELIVERY)+=usb_mux.o usb_pd_policy.o 15 | -------------------------------------------------------------------------------- /board/host/build.mk: -------------------------------------------------------------------------------- 1 | # -*- makefile -*- 2 | # Copyright (c) 2013 The Chromium OS Authors. All rights reserved. 3 | # Use of this source code is governed by a BSD-style license that can be 4 | # found in the LICENSE file. 5 | # 6 | # Board specific files build 7 | # 8 | 9 | CHIP:=host 10 | 11 | board-y=board.o 12 | board-$(HAS_TASK_CHIPSET)+=chipset.o 13 | board-$(CONFIG_BATTERY_MOCK)+=battery.o charger.o 14 | board-$(CONFIG_FANS)+=fan.o 15 | board-$(CONFIG_USB_POWER_DELIVERY)+=usb_pd_policy.o usb_pd_config.o 16 | -------------------------------------------------------------------------------- /board/host/usb_pd_config.c: -------------------------------------------------------------------------------- 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 | /* USB Power delivery board configuration */ 7 | 8 | #include "test_util.h" 9 | 10 | test_mockable void pd_select_polarity(int port, int polarity) 11 | { 12 | /* Not implemented */ 13 | } 14 | 15 | test_mockable void pd_tx_init(void) 16 | { 17 | /* Not implemented */ 18 | } 19 | 20 | test_mockable void pd_set_host_mode(int port, int enable) 21 | { 22 | /* Not implemented */ 23 | } 24 | 25 | test_mockable void pd_config_init(int port, uint8_t power_role) 26 | { 27 | /* Not implemented */ 28 | } 29 | 30 | test_mockable int pd_adc_read(int port, int cc) 31 | { 32 | /* Not implemented */ 33 | return 0; 34 | } 35 | 36 | -------------------------------------------------------------------------------- /board/host/usb_pd_config.h: -------------------------------------------------------------------------------- 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 | /* USB Power delivery board configuration */ 7 | 8 | #ifndef __CROS_EC_USB_PD_CONFIG_H 9 | #define __CROS_EC_USB_PD_CONFIG_H 10 | 11 | /* Use software CRC */ 12 | #define CONFIG_SW_CRC 13 | 14 | void pd_select_polarity(int port, int polarity); 15 | 16 | void pd_tx_init(void); 17 | 18 | void pd_set_host_mode(int port, int enable); 19 | 20 | void pd_config_init(int port, uint8_t power_role); 21 | 22 | int pd_adc_read(int port, int cc); 23 | 24 | #endif /* __CROS_EC_USB_PD_CONFIG_H */ 25 | -------------------------------------------------------------------------------- /board/it83xx_evb/build.mk: -------------------------------------------------------------------------------- 1 | # -*- makefile -*- 2 | # Copyright (c) 2013 The Chromium OS Authors. All rights reserved. 3 | # Use of this source code is governed by a BSD-style license that can be 4 | # found in the LICENSE file. 5 | # 6 | # Board specific files build 7 | 8 | # the IC is ITE IT8390/IT8320 9 | CHIP:=it83xx 10 | 11 | board-y=board.o 12 | board-$(CONFIG_USB_POWER_DELIVERY)+=usb_pd_policy.o 13 | -------------------------------------------------------------------------------- /board/jerry/build.mk: -------------------------------------------------------------------------------- 1 | # -*- makefile -*- 2 | # Copyright (c) 2014 The Chromium OS Authors. All rights reserved. 3 | # Use of this source code is governed by a BSD-style license that can be 4 | # found in the LICENSE file. 5 | # 6 | # Board specific files build 7 | 8 | # the IC is STmicro STM32F071RB 9 | CHIP:=stm32 10 | CHIP_FAMILY:=stm32f0 11 | CHIP_VARIANT:=stm32f07x 12 | 13 | board-y=board.o battery.o 14 | -------------------------------------------------------------------------------- /board/kevin/build.mk: -------------------------------------------------------------------------------- 1 | # -*- makefile -*- 2 | # Copyright 2016 The Chromium OS Authors. All rights reserved. 3 | # Use of this source code is governed by a BSD-style license that can be 4 | # found in the LICENSE file. 5 | # 6 | # Board specific files build 7 | # 8 | 9 | # the IC is Nuvoton M-Series EC (npcx5m5g, npcx5m6g) 10 | CHIP:=npcx 11 | CHIP_VARIANT:=npcx5m5g 12 | 13 | board-y=battery.o board.o charge_ramp.o usb_pd_policy.o 14 | board-$(BOARD_GRU)+=led_gru.o 15 | board-$(BOARD_KEVIN)+=led_kevin.o 16 | -------------------------------------------------------------------------------- /board/llama/build.mk: -------------------------------------------------------------------------------- 1 | #-*- makefile -*- 2 | #Copyright 2015 The Chromium OS Authors. All rights reserved. 3 | #Use of this source code is governed by a BSD-style license that can be 4 | #found in the LICENSE file. 5 | # 6 | #Board specific files build 7 | 8 | #the IC is STmicro STM32F071RB 9 | CHIP := stm32 10 | CHIP_FAMILY := stm32f0 11 | CHIP_VARIANT:= stm32f07x 12 | 13 | board-y = board.o battery.o led.o 14 | -------------------------------------------------------------------------------- /board/lucid/build.mk: -------------------------------------------------------------------------------- 1 | # -*- makefile -*- 2 | # Copyright 2015 The Chromium OS Authors. All rights reserved. 3 | # Use of this source code is governed by a BSD-style license that can be 4 | # found in the LICENSE file. 5 | # 6 | # Board specific files build 7 | 8 | # the IC is STmicro STM32F072CBU7 9 | CHIP:=stm32 10 | CHIP_FAMILY:=stm32f0 11 | CHIP_VARIANT:=stm32f07x 12 | 13 | board-y=board.o led.o 14 | board-$(CONFIG_BATTERY_SMART)+=battery.o 15 | board-$(CONFIG_USB_POWER_DELIVERY)+=usb_pd_policy.o 16 | -------------------------------------------------------------------------------- /board/minimuffin: -------------------------------------------------------------------------------- 1 | zinger/ -------------------------------------------------------------------------------- /board/npcx_evb/build.mk: -------------------------------------------------------------------------------- 1 | # -*- makefile -*- 2 | # Copyright (c) 2014 The Chromium OS Authors. All rights reserved. 3 | # Use of this source code is governed by a BSD-style license that can be 4 | # found in the LICENSE file. 5 | # 6 | # Board specific files build 7 | # 8 | 9 | # the IC is Nuvoton M-Series EC (npcx5m5g, npcx5m6g) 10 | CHIP:=npcx 11 | CHIP_VARIANT:=npcx5m5g 12 | 13 | board-y=board.o 14 | -------------------------------------------------------------------------------- /board/npcx_evb_arm/build.mk: -------------------------------------------------------------------------------- 1 | # -*- makefile -*- 2 | # Copyright 2015 The Chromium OS Authors. All rights reserved. 3 | # Use of this source code is governed by a BSD-style license that can be 4 | # found in the LICENSE file. 5 | # 6 | # Board specific files build 7 | # 8 | 9 | # the IC is Nuvoton M-Series EC (npcx5m5g, npcx5m6g) 10 | CHIP:=npcx 11 | CHIP_VARIANT:=npcx5m5g 12 | 13 | board-y=board.o 14 | -------------------------------------------------------------------------------- /board/nucleo-f072rb/build.mk: -------------------------------------------------------------------------------- 1 | # -*- makefile -*- 2 | # Copyright 2016 The Chromium OS Authors. All rights reserved. 3 | # Use of this source code is governed by a BSD-style license that can be 4 | # found in the LICENSE file. 5 | # 6 | # Board specific files build 7 | 8 | # the IC is STmicro STM32F072RBT6 9 | CHIP:=stm32 10 | CHIP_FAMILY:=stm32f0 11 | CHIP_VARIANT:=stm32f07x 12 | 13 | board-y=board.o 14 | -------------------------------------------------------------------------------- /board/nucleo-f072rb/ec.tasklist: -------------------------------------------------------------------------------- 1 | /* Copyright 2016 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 | /** 7 | * List of enabled tasks in the priority order 8 | * 9 | * The first one has the lowest priority. 10 | * 11 | * For each task, use the macro TASK_ALWAYS(n, r, d, s) for base tasks and 12 | * TASK_NOTEST(n, r, d, s) for tasks that can be excluded in test binaries, 13 | * where : 14 | * 'n' in the name of the task 15 | * 'r' in the main routine of the task 16 | * 'd' in an opaque parameter passed to the routine at startup 17 | * 's' is the stack size in bytes; must be a multiple of 8 18 | */ 19 | #define CONFIG_TASK_LIST \ 20 | TASK_ALWAYS(HOOKS, hook_task, NULL, TASK_STACK_SIZE) \ 21 | TASK_ALWAYS(CONSOLE, console_task, NULL, TASK_STACK_SIZE) 22 | -------------------------------------------------------------------------------- /board/nucleo-f072rb/openocd-flash.cfg: -------------------------------------------------------------------------------- 1 | # Copyright 2016 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 | source [find board/st_nucleo_f0.cfg] 6 | 7 | # For flashing, force the board into reset on connect, this ensures that 8 | # code running on the core can't interfere with programming. 9 | reset_config connect_assert_srst 10 | 11 | gdb_port 0 12 | tcl_port 0 13 | telnet_port 0 14 | init 15 | reset init 16 | flash write_image erase $BUILD_DIR/ec.bin 0x08000000 17 | reset halt 18 | resume 19 | shutdown 20 | -------------------------------------------------------------------------------- /board/oak/board_revs.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2015 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 | #ifndef __CROS_EC_BOARD_REVS_H 7 | #define __CROS_EC_BOARD_REVS_H 8 | 9 | #define OAK_REV0 0 10 | #define OAK_REV1 1 11 | #define OAK_REV2 2 12 | #define OAK_REV3 3 13 | #define OAK_REV4 4 14 | #define OAK_REV5 5 15 | #define OAK_REV_LAST OAK_REV5 16 | #define OAK_REV_DEFAULT OAK_REV5 17 | 18 | #if !defined(BOARD_REV) 19 | #define BOARD_REV OAK_REV_DEFAULT 20 | #endif 21 | 22 | #if BOARD_REV < OAK_REV1 || BOARD_REV > OAK_REV_LAST 23 | #error "Board revision out of range" 24 | #endif 25 | 26 | #endif /* __CROS_EC_BOARD_REVS_H */ 27 | -------------------------------------------------------------------------------- /board/oak/build.mk: -------------------------------------------------------------------------------- 1 | #-*- makefile -*- 2 | # Copyright 2015 The Chromium OS Authors. All rights reserved. 3 | # Use of this source code is governed by a BSD-style license that can be 4 | # found in the LICENSE file. 5 | # 6 | # Board specific files build 7 | 8 | # STmicro STM32F091VC 9 | CHIP := stm32 10 | CHIP_FAMILY := stm32f0 11 | CHIP_VARIANT:= stm32f09x 12 | 13 | board-y = board.o battery.o led.o 14 | board-$(CONFIG_USB_POWER_DELIVERY)+=usb_pd_policy.o 15 | -------------------------------------------------------------------------------- /board/oak_pd: -------------------------------------------------------------------------------- 1 | glados_pd -------------------------------------------------------------------------------- /board/pdeval-stm32f072/build.mk: -------------------------------------------------------------------------------- 1 | # -*- makefile -*- 2 | # Copyright 2015 The Chromium OS Authors. All rights reserved. 3 | # Use of this source code is governed by a BSD-style license that can be 4 | # found in the LICENSE file. 5 | # 6 | # Board specific files build 7 | 8 | # the IC is STmicro STM32F072RBT6 9 | CHIP:=stm32 10 | CHIP_FAMILY:=stm32f0 11 | CHIP_VARIANT:=stm32f07x 12 | 13 | board-y=board.o usb_pd_policy.o 14 | -------------------------------------------------------------------------------- /board/pdeval-stm32f072/openocd-flash.cfg: -------------------------------------------------------------------------------- 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 | source [find board/stm32f0discovery.cfg] 6 | 7 | # For flashing, force the board into reset on connect, this ensures that 8 | # code running on the core can't interfere with programming. 9 | reset_config connect_assert_srst 10 | 11 | gdb_port 0 12 | tcl_port 0 13 | telnet_port 0 14 | init 15 | reset init 16 | flash write_image erase $BUILD_DIR/ec.bin 0x08000000 17 | reset halt 18 | resume 19 | shutdown 20 | -------------------------------------------------------------------------------- /board/pit/build.mk: -------------------------------------------------------------------------------- 1 | # -*- makefile -*- 2 | # Copyright (c) 2013 The Chromium OS Authors. All rights reserved. 3 | # Use of this source code is governed by a BSD-style license that can be 4 | # found in the LICENSE file. 5 | # 6 | # Board specific files build 7 | 8 | # the IC is STmicro STM32L151RBH6 9 | CHIP:=stm32 10 | CHIP_FAMILY:=stm32l 11 | CHIP_VARIANT:=stm32l15x 12 | 13 | board-y=board.o 14 | -------------------------------------------------------------------------------- /board/plankton/build.mk: -------------------------------------------------------------------------------- 1 | # -*- makefile -*- 2 | # Copyright (c) 2014 The Chromium OS Authors. All rights reserved. 3 | # Use of this source code is governed by a BSD-style license that can be 4 | # found in the LICENSE file. 5 | # 6 | # Board specific files build 7 | 8 | # the IC is STmicro STM32F072CBU6 9 | CHIP:=stm32 10 | CHIP_FAMILY:=stm32f0 11 | CHIP_VARIANT:=stm32f07x 12 | 13 | board-y=board.o 14 | board-$(CONFIG_USB_POWER_DELIVERY)+=usb_pd_policy.o 15 | -------------------------------------------------------------------------------- /board/polyberry/build.mk: -------------------------------------------------------------------------------- 1 | # -*- makefile -*- 2 | # Copyright 2016 The Chromium OS Authors. All rights reserved. 3 | # Use of this source code is governed by a BSD-style license that can be 4 | # found in the LICENSE file. 5 | # 6 | # Board specific files build 7 | 8 | CHIP:=stm32 9 | CHIP_FAMILY:=stm32f4 10 | CHIP_VARIANT:=stm32f446 11 | 12 | board-y=board.o 13 | -------------------------------------------------------------------------------- /board/polyberry/ec.tasklist: -------------------------------------------------------------------------------- 1 | /* Copyright 2016 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 | /** 7 | * List of enabled tasks in the priority order 8 | * 9 | * The first one has the lowest priority. 10 | * 11 | * For each task, use the macro TASK_ALWAYS(n, r, d, s) for base tasks and 12 | * TASK_NOTEST(n, r, d, s) for tasks that can be excluded in test binaries, 13 | * where : 14 | * 'n' in the name of the task 15 | * 'r' in the main routine of the task 16 | * 'd' in an opaque parameter passed to the routine at startup 17 | * 's' is the stack size in bytes; must be a multiple of 8 18 | */ 19 | #define CONFIG_TASK_LIST \ 20 | TASK_ALWAYS(HOOKS, hook_task, NULL, VENTI_TASK_STACK_SIZE) \ 21 | TASK_ALWAYS(CONSOLE, console_task, NULL, VENTI_TASK_STACK_SIZE) 22 | -------------------------------------------------------------------------------- /board/poppy/build.mk: -------------------------------------------------------------------------------- 1 | # -*- makefile -*- 2 | # Copyright 2016 The Chromium OS Authors. All rights reserved. 3 | # Use of this source code is governed by a BSD-style license that can be 4 | # found in the LICENSE file. 5 | # 6 | # Board specific files build 7 | # 8 | 9 | CHIP:=npcx 10 | CHIP_VARIANT:=npcx5m6g 11 | 12 | board-y=board.o 13 | board-$(CONFIG_BATTERY_SMART)+=battery.o 14 | board-$(CONFIG_USB_POWER_DELIVERY)+=usb_pd_policy.o 15 | -------------------------------------------------------------------------------- /board/pyro/build.mk: -------------------------------------------------------------------------------- 1 | # -*- makefile -*- 2 | # Copyright 2015 The Chromium OS Authors. All rights reserved. 3 | # Use of this source code is governed by a BSD-style license that can be 4 | # found in the LICENSE file. 5 | # 6 | # Board specific files build 7 | # 8 | 9 | CHIP:=npcx 10 | CHIP_VARIANT:=npcx5m6g 11 | 12 | board-y=board.o led.o 13 | board-$(CONFIG_BATTERY_SMART)+=battery.o 14 | board-$(CONFIG_USB_POWER_DELIVERY)+=usb_pd_policy.o 15 | -------------------------------------------------------------------------------- /board/reef/build.mk: -------------------------------------------------------------------------------- 1 | # -*- makefile -*- 2 | # Copyright 2015 The Chromium OS Authors. All rights reserved. 3 | # Use of this source code is governed by a BSD-style license that can be 4 | # found in the LICENSE file. 5 | # 6 | # Board specific files build 7 | # 8 | 9 | CHIP:=npcx 10 | CHIP_VARIANT:=npcx5m6g 11 | 12 | board-y=board.o led.o 13 | board-$(CONFIG_BATTERY_SMART)+=battery.o 14 | board-$(CONFIG_USB_POWER_DELIVERY)+=usb_pd_policy.o 15 | -------------------------------------------------------------------------------- /board/rowan/build.mk: -------------------------------------------------------------------------------- 1 | #-*- makefile -*- 2 | # Copyright 2016 The Chromium OS Authors. All rights reserved. 3 | # Use of this source code is governed by a BSD-style license that can be 4 | # found in the LICENSE file. 5 | # 6 | # Board specific files build 7 | 8 | # STmicro STM32F091VC 9 | CHIP := stm32 10 | CHIP_FAMILY := stm32f0 11 | CHIP_VARIANT:= stm32f09x 12 | 13 | board-y = board.o battery.o led.o 14 | board-$(CONFIG_USB_POWER_DELIVERY)+=usb_pd_policy.o 15 | -------------------------------------------------------------------------------- /board/ryu/build.mk: -------------------------------------------------------------------------------- 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 | # Board specific files build 6 | 7 | # the IC is STmicro STM32F373VB 8 | CHIP:=stm32 9 | CHIP_FAMILY:=stm32f3 10 | CHIP_VARIANT:=stm32f373 11 | 12 | board-y=battery.o board.o 13 | board-$(CONFIG_USB_POWER_DELIVERY)+=usb_mux.o usb_pd_policy.o 14 | -------------------------------------------------------------------------------- /board/ryu/dfu: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | dfu-util -a 0 -d 0483:df11 -s 0x08000000:262144 -D $1 4 | -------------------------------------------------------------------------------- /board/samus/build.mk: -------------------------------------------------------------------------------- 1 | # -*- makefile -*- 2 | # Copyright (c) 2013 The Chromium OS Authors. All rights reserved. 3 | # Use of this source code is governed by a BSD-style license that can be 4 | # found in the LICENSE file. 5 | # 6 | # Board specific files build 7 | # 8 | 9 | # the IC is TI Stellaris LM4 10 | CHIP:=lm4 11 | 12 | board-y=battery.o board.o power_sequence.o panel.o extpower.o 13 | -------------------------------------------------------------------------------- /board/samus_pd/build.mk: -------------------------------------------------------------------------------- 1 | # -*- makefile -*- 2 | # Copyright (c) 2014 The Chromium OS Authors. All rights reserved. 3 | # Use of this source code is governed by a BSD-style license that can be 4 | # found in the LICENSE file. 5 | # 6 | # Board specific files build 7 | 8 | # the IC is STmicro STM32F072VBH6 9 | CHIP:=stm32 10 | CHIP_FAMILY:=stm32f0 11 | CHIP_VARIANT:=stm32f07x 12 | 13 | board-y=board.o 14 | board-$(CONFIG_USB_POWER_DELIVERY)+=usb_mux.o usb_pd_policy.o 15 | -------------------------------------------------------------------------------- /board/servo_micro/build.mk: -------------------------------------------------------------------------------- 1 | # -*- makefile -*- 2 | # Copyright 2016 The Chromium OS Authors. All rights reserved. 3 | # Use of this source code is governed by a BSD-style license that can be 4 | # found in the LICENSE file. 5 | # 6 | # Board specific files build 7 | 8 | # the IC is STmicro STM32F072RBT6 9 | CHIP:=stm32 10 | CHIP_FAMILY:=stm32f0 11 | CHIP_VARIANT:=stm32f07x 12 | 13 | board-y=board.o 14 | -------------------------------------------------------------------------------- /board/servo_micro/ec.tasklist: -------------------------------------------------------------------------------- 1 | /* Copyright 2016 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 | /** 7 | * List of enabled tasks in the priority order 8 | * 9 | * The first one has the lowest priority. 10 | * 11 | * For each task, use the macro TASK_ALWAYS(n, r, d, s) for base tasks and 12 | * TASK_NOTEST(n, r, d, s) for tasks that can be excluded in test binaries, 13 | * where : 14 | * 'n' in the name of the task 15 | * 'r' in the main routine of the task 16 | * 'd' in an opaque parameter passed to the routine at startup 17 | * 's' is the stack size in bytes; must be a multiple of 8 18 | */ 19 | #define CONFIG_TASK_LIST \ 20 | TASK_ALWAYS(HOOKS, hook_task, NULL, VENTI_TASK_STACK_SIZE) \ 21 | TASK_ALWAYS(CONSOLE, console_task, NULL, TASK_STACK_SIZE) 22 | -------------------------------------------------------------------------------- /board/servo_v4/build.mk: -------------------------------------------------------------------------------- 1 | # -*- makefile -*- 2 | # Copyright 2016 The Chromium OS Authors. All rights reserved. 3 | # Use of this source code is governed by a BSD-style license that can be 4 | # found in the LICENSE file. 5 | # 6 | # Board specific files build 7 | 8 | # the IC is STmicro STM32F072RBT6 9 | CHIP:=stm32 10 | CHIP_FAMILY:=stm32f0 11 | CHIP_VARIANT:=stm32f07x 12 | 13 | board-y=board.o 14 | board-$(CONFIG_USB_POWER_DELIVERY)+=usb_pd_policy.o 15 | 16 | all_deps=$(patsubst ro,,$(def_all_deps)) 17 | -------------------------------------------------------------------------------- /board/snappy/build.mk: -------------------------------------------------------------------------------- 1 | # -*- makefile -*- 2 | # Copyright 2015 The Chromium OS Authors. All rights reserved. 3 | # Use of this source code is governed by a BSD-style license that can be 4 | # found in the LICENSE file. 5 | # 6 | # Board specific files build 7 | # 8 | 9 | CHIP:=npcx 10 | CHIP_VARIANT:=npcx5m6g 11 | 12 | board-y=board.o led.o 13 | board-$(CONFIG_BATTERY_SMART)+=battery.o 14 | board-$(CONFIG_USB_POWER_DELIVERY)+=usb_pd_policy.o 15 | -------------------------------------------------------------------------------- /board/snoball/build.mk: -------------------------------------------------------------------------------- 1 | # -*- makefile -*- 2 | # Copyright 2015 The Chromium OS Authors. All rights reserved. 3 | # Use of this source code is governed by a BSD-style license that can be 4 | # found in the LICENSE file. 5 | # 6 | # Board specific files build 7 | 8 | # the IC is STmicro STM32F030C8 9 | CHIP:=stm32 10 | CHIP_FAMILY:=stm32f0 11 | CHIP_VARIANT:=stm32f03x8 12 | 13 | board-y=board.o 14 | 15 | # This target builds RW only. Therefore, remove RO from dependencies. 16 | all_deps=$(patsubst ro,,$(def_all_deps)) 17 | -------------------------------------------------------------------------------- /board/snoball/ec.tasklist: -------------------------------------------------------------------------------- 1 | /* Copyright 2015 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 | /** 7 | * List of enabled tasks in the priority order 8 | * 9 | * The first one has the lowest priority. 10 | * 11 | * For each task, use the macro TASK_ALWAYS(n, r, d, s) for base tasks and 12 | * TASK_NOTEST(n, r, d, s) for tasks that can be excluded in test binaries, 13 | * where : 14 | * 'n' in the name of the task 15 | * 'r' in the main routine of the task 16 | * 'd' in an opaque parameter passed to the routine at startup 17 | * 's' is the stack size in bytes; must be a multiple of 8 18 | */ 19 | #define CONFIG_TASK_LIST \ 20 | TASK_ALWAYS(HOOKS, hook_task, NULL, TASK_STACK_SIZE) \ 21 | TASK_ALWAYS(CONSOLE, console_task, NULL, TASK_STACK_SIZE) 22 | -------------------------------------------------------------------------------- /board/stm32f446e-eval/build.mk: -------------------------------------------------------------------------------- 1 | # -*- makefile -*- 2 | # Copyright 2016 The Chromium OS Authors. All rights reserved. 3 | # Use of this source code is governed by a BSD-style license that can be 4 | # found in the LICENSE file. 5 | # 6 | # Board specific files build 7 | 8 | CHIP:=stm32 9 | CHIP_FAMILY:=stm32f4 10 | CHIP_VARIANT:=stm32f446 11 | 12 | board-y=board.o 13 | -------------------------------------------------------------------------------- /board/stm32f446e-eval/ec.tasklist: -------------------------------------------------------------------------------- 1 | /* Copyright 2016 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 | /** 7 | * List of enabled tasks in the priority order 8 | * 9 | * The first one has the lowest priority. 10 | * 11 | * For each task, use the macro TASK_ALWAYS(n, r, d, s) for base tasks and 12 | * TASK_NOTEST(n, r, d, s) for tasks that can be excluded in test binaries, 13 | * where : 14 | * 'n' in the name of the task 15 | * 'r' in the main routine of the task 16 | * 'd' in an opaque parameter passed to the routine at startup 17 | * 's' is the stack size in bytes; must be a multiple of 8 18 | */ 19 | #define CONFIG_TASK_LIST \ 20 | TASK_ALWAYS(HOOKS, hook_task, NULL, TASK_STACK_SIZE) \ 21 | TASK_ALWAYS(CONSOLE, console_task, NULL, VENTI_TASK_STACK_SIZE) 22 | -------------------------------------------------------------------------------- /board/stm32l476g-eval/build.mk: -------------------------------------------------------------------------------- 1 | # -*- makefile -*- 2 | # Copyright 2016 The Chromium OS Authors. All rights reserved. 3 | # Use of this source code is governed by a BSD-style license that can be 4 | # found in the LICENSE file. 5 | # 6 | # Board specific files build 7 | 8 | CHIP:=stm32 9 | CHIP_FAMILY:=stm32l4 10 | CHIP_VARIANT:=stm32l476 11 | 12 | board-y=board.o 13 | -------------------------------------------------------------------------------- /board/stm32l476g-eval/ec.tasklist: -------------------------------------------------------------------------------- 1 | /* Copyright 2016 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 | /** 7 | * List of enabled tasks in the priority order 8 | * 9 | * The first one has the lowest priority. 10 | * 11 | * For each task, use the macro TASK_ALWAYS(n, r, d, s) for base tasks and 12 | * TASK_NOTEST(n, r, d, s) for tasks that can be excluded in test binaries, 13 | * where : 14 | * 'n' in the name of the task 15 | * 'r' in the main routine of the task 16 | * 'd' in an opaque parameter passed to the routine at startup 17 | * 's' is the stack size in bytes; must be a multiple of 8 18 | */ 19 | #define CONFIG_TASK_LIST \ 20 | TASK_ALWAYS(HOOKS, hook_task, NULL, TASK_STACK_SIZE) \ 21 | TASK_ALWAYS(CONSOLE, console_task, NULL, TASK_STACK_SIZE) 22 | 23 | -------------------------------------------------------------------------------- /board/stm32l476g-eval/openocd-flash.cfg: -------------------------------------------------------------------------------- 1 | # Copyright 2016 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 | source [find board/stm32l4discovery.cfg] 6 | 7 | # For flashing, force the board into reset on connect, this ensures that 8 | # code running on the core can't interfere with programming. 9 | reset_config connect_assert_srst 10 | 11 | gdb_port 0 12 | tcl_port 0 13 | telnet_port 0 14 | init 15 | reset init 16 | flash write_image erase $BUILD_DIR/ec.bin 0x08000000 17 | reset halt 18 | resume 19 | shutdown 20 | -------------------------------------------------------------------------------- /board/strago/build.mk: -------------------------------------------------------------------------------- 1 | # -*- makefile -*- 2 | # Copyright (c) 2014 The Chromium OS Authors. All rights reserved. 3 | # Use of this source code is governed by a BSD-style license that can be 4 | # found in the LICENSE file. 5 | # 6 | # Board specific files build 7 | # 8 | 9 | # the IC is SMSC MEC1322 / external SPI is 512KB / external clock is crystal 10 | CHIP:=mec1322 11 | CHIP_SPI_SIZE_KB:=512 12 | 13 | board-y=board.o led.o 14 | board-$(CONFIG_BATTERY_SMART)+=battery.o 15 | board-$(CONFIG_USB_POWER_DELIVERY)+=usb_pd_policy.o 16 | -------------------------------------------------------------------------------- /board/sweetberry/build.mk: -------------------------------------------------------------------------------- 1 | # -*- makefile -*- 2 | # Copyright 2016 The Chromium OS Authors. All rights reserved. 3 | # Use of this source code is governed by a BSD-style license that can be 4 | # found in the LICENSE file. 5 | # 6 | # Board specific files build 7 | 8 | CHIP:=stm32 9 | CHIP_FAMILY:=stm32f4 10 | CHIP_VARIANT:=stm32f446 11 | 12 | board-y=board.o 13 | -------------------------------------------------------------------------------- /board/sweetberry/ec.tasklist: -------------------------------------------------------------------------------- 1 | /* Copyright 2016 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 | /** 7 | * List of enabled tasks in the priority order 8 | * 9 | * The first one has the lowest priority. 10 | * 11 | * For each task, use the macro TASK_ALWAYS(n, r, d, s) for base tasks and 12 | * TASK_NOTEST(n, r, d, s) for tasks that can be excluded in test binaries, 13 | * where : 14 | * 'n' in the name of the task 15 | * 'r' in the main routine of the task 16 | * 'd' in an opaque parameter passed to the routine at startup 17 | * 's' is the stack size in bytes; must be a multiple of 8 18 | */ 19 | #define CONFIG_TASK_LIST \ 20 | TASK_ALWAYS(HOOKS, hook_task, NULL, VENTI_TASK_STACK_SIZE) \ 21 | TASK_ALWAYS(CONSOLE, console_task, NULL, VENTI_TASK_STACK_SIZE) 22 | -------------------------------------------------------------------------------- /board/twinkie/build.mk: -------------------------------------------------------------------------------- 1 | # -*- makefile -*- 2 | # Copyright (c) 2014 The Chromium OS Authors. All rights reserved. 3 | # Use of this source code is governed by a BSD-style license that can be 4 | # found in the LICENSE file. 5 | # 6 | # Board specific files build 7 | 8 | # the IC is STmicro STM32F072B 9 | CHIP:=stm32 10 | CHIP_FAMILY:=stm32f0 11 | CHIP_VARIANT:=stm32f07x 12 | 13 | board-y=board.o usb_pd_policy.o injector.o simpletrace.o 14 | board-$(HAS_TASK_SNIFFER)+=sniffer.o 15 | -------------------------------------------------------------------------------- /board/wheatley/build.mk: -------------------------------------------------------------------------------- 1 | # -*- makefile -*- 2 | # Copyright 2015 The Chromium OS Authors. All rights reserved. 3 | # Use of this source code is governed by a BSD-style license that can be 4 | # found in the LICENSE file. 5 | # 6 | # Board specific files build 7 | # 8 | 9 | # the IC is Nuvoton M-Series EC (npcx5m5g, npcx5m6g) 10 | CHIP:=npcx 11 | CHIP_VARIANT:=npcx5m5g 12 | 13 | board-y=board.o led.o 14 | board-$(CONFIG_BATTERY_SMART)+=battery.o 15 | board-$(CONFIG_USB_POWER_DELIVERY)+=usb_pd_policy.o 16 | -------------------------------------------------------------------------------- /board/zinger/build.mk: -------------------------------------------------------------------------------- 1 | # -*- makefile -*- 2 | # Copyright (c) 2014 The Chromium OS Authors. All rights reserved. 3 | # Use of this source code is governed by a BSD-style license that can be 4 | # found in the LICENSE file. 5 | # 6 | # Board specific files build 7 | 8 | # the IC is STmicro STM32F031F6 9 | CHIP:=stm32 10 | CHIP_FAMILY:=stm32f0 11 | CHIP_VARIANT:=stm32f03x 12 | 13 | board-y=board.o hardware.o runtime.o usb_pd_policy.o 14 | -------------------------------------------------------------------------------- /board/zinger/ec.irqlist: -------------------------------------------------------------------------------- 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 | /** 7 | * List of enabled IRQ. To enable an IRQ, use ENABLE_IRQ(irq_num). Any 8 | * IRQ that is not listed here is disabled. 9 | */ 10 | 11 | ENABLE_IRQ(STM32_IRQ_EXTI4_15) 12 | ENABLE_IRQ(STM32_IRQ_ADC_COMP) 13 | ENABLE_IRQ(STM32_IRQ_TIM2) 14 | ENABLE_IRQ(STM32_IRQ_RTC_WAKEUP) 15 | -------------------------------------------------------------------------------- /board/zinger/ec.tasklist: -------------------------------------------------------------------------------- 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 | /** 7 | * List of enabled tasks in the priority order 8 | * 9 | * The first one has the lowest priority. 10 | * 11 | * For each task, use the macro TASK_ALWAYS(n, r, d, s) for base tasks and 12 | * TASK_NOTEST(n, r, d, s) for tasks that can be excluded in test binaries, 13 | * where : 14 | * 'n' in the name of the task 15 | * 'r' in the main routine of the task 16 | * 'd' in an opaque parameter passed to the routine at startup 17 | * 's' is the stack size in bytes; must be a multiple of 8 18 | */ 19 | #define CONFIG_TASK_LIST 20 | -------------------------------------------------------------------------------- /builtin/stdarg.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2016 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 | #ifndef __CROS_EC_STDARG_H__ 7 | #define __CROS_EC_STDARG_H__ 8 | 9 | /* We use -nostdinc -ffreestanding to keep host system include files 10 | * from contaminating our build. 11 | * Unfortunately this also gets us rid of the _compiler_ includes, like 12 | * stdarg.h. To work around the issue, we define varargs directly here. 13 | */ 14 | 15 | #ifdef __GNUC__ 16 | #define va_start(v, l) __builtin_va_start(v, l) 17 | #define va_end(v) __builtin_va_end(v) 18 | #define va_arg(v, l) __builtin_va_arg(v, l) 19 | typedef __builtin_va_list va_list; 20 | #else 21 | #include_next 22 | #endif 23 | 24 | #endif /* __CROS_EC_STDARG_H__ */ 25 | -------------------------------------------------------------------------------- /builtin/stdbool.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2016 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 | #ifndef __CROS_EC_STDBOOL_H__ 7 | #define __CROS_EC_STDBOOL_H__ 8 | 9 | #define bool _Bool 10 | #define true 1 11 | #define false 0 12 | 13 | #endif /* __CROS_EC_STDBOOL_H__ */ 14 | -------------------------------------------------------------------------------- /builtin/string.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2016 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 | /* This header is only needed for CR50 compatibility */ 7 | 8 | #ifndef __CROS_EC_STRINGS_H__ 9 | #define __CROS_EC_STRINGS_H__ 10 | 11 | #include 12 | 13 | int memcmp(const void *s1, const void *s2, size_t len); 14 | void *memcpy(void *dest, const void *src, size_t len); 15 | void *memmove(void *dest, const void *src, size_t n); 16 | void *memset(void *dest, int c, size_t len); 17 | void *memchr(const void *buffer, int c, size_t n); 18 | 19 | size_t strnlen(const char *s, size_t maxlen); 20 | char *strncpy(char *dest, const char *src, size_t n); 21 | int strncmp(const char *s1, const char *s2, size_t n); 22 | 23 | #endif /* __CROS_EC_STRINGS_H__ */ 24 | -------------------------------------------------------------------------------- /builtin/time.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2016 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 | /* This header is only needed for CR50 compatibility */ 7 | 8 | #ifndef __CROS_EC_TIME_H__ 9 | #define __CROS_EC_TIME_H__ 10 | 11 | #include 12 | 13 | #endif /* __CROS_EC_TIME_H__ */ 14 | -------------------------------------------------------------------------------- /chip/g/dcrypto/compare.c: -------------------------------------------------------------------------------- 1 | /* Copyright 2016 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 | #include "dcrypto.h" 7 | 8 | /* Constant time comparator. */ 9 | int DCRYPTO_equals(const void *a, const void *b, size_t len) 10 | { 11 | size_t i; 12 | const uint8_t *pa = a; 13 | const uint8_t *pb = b; 14 | uint8_t diff = 0; 15 | 16 | for (i = 0; i < len; i++) 17 | diff |= pa[i] ^ pb[i]; 18 | 19 | return !diff; 20 | } 21 | -------------------------------------------------------------------------------- /chip/g/dcrypto/p256.c: -------------------------------------------------------------------------------- 1 | /* Copyright 2015 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 | #include "dcrypto.h" 7 | 8 | #include "cryptoc/p256.h" 9 | 10 | static const p256_int p256_one = P256_ONE; 11 | 12 | /* 13 | * Key selection based on FIPS-186-4, section B.4.2 (Key Pair 14 | * Generation by Testing Candidates). 15 | */ 16 | int DCRYPTO_p256_key_from_bytes(p256_int *x, p256_int *y, p256_int *d, 17 | const uint8_t key_bytes[P256_NBYTES]) 18 | { 19 | p256_int key; 20 | 21 | p256_from_bin(key_bytes, &key); 22 | if (p256_cmp(&SECP256r1_nMin2, &key) < 0) 23 | return 0; 24 | p256_add(&key, &p256_one, d); 25 | dcrypto_memset(&key, 0, sizeof(key)); 26 | if (x == NULL || y == NULL) 27 | return 1; 28 | return dcrypto_p256_base_point_mul(d, x, y); 29 | } 30 | -------------------------------------------------------------------------------- /chip/g/dcrypto/sha384.c: -------------------------------------------------------------------------------- 1 | /* Copyright 2016 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 | #include "dcrypto.h" 7 | #include "internal.h" 8 | 9 | #include "cryptoc/sha384.h" 10 | 11 | void DCRYPTO_SHA384_init(LITE_SHA512_CTX *ctx) 12 | { 13 | SHA384_init(ctx); 14 | } 15 | 16 | const uint8_t *DCRYPTO_SHA384_hash(const void *data, uint32_t n, 17 | uint8_t *digest) 18 | { 19 | return SHA384_hash(data, n, digest); 20 | } 21 | -------------------------------------------------------------------------------- /chip/g/dcrypto/sha512.c: -------------------------------------------------------------------------------- 1 | /* Copyright 2016 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 | #include "dcrypto.h" 7 | #include "internal.h" 8 | 9 | #include "cryptoc/sha512.h" 10 | 11 | void DCRYPTO_SHA512_init(LITE_SHA512_CTX *ctx) 12 | { 13 | SHA512_init(ctx); 14 | } 15 | 16 | const uint8_t *DCRYPTO_SHA512_hash(const void *data, uint32_t n, 17 | uint8_t *digest) 18 | { 19 | return SHA512_hash(data, n, digest); 20 | } 21 | -------------------------------------------------------------------------------- /chip/g/flash_info.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016 The Chromium OS Authors. All rights reserved. 3 | * Use of this source code is governed by a BSD-style license that can be 4 | * found in the LICENSE file. 5 | */ 6 | #ifndef __EC_CHIP_G_FLASH_INFO_H 7 | #define __EC_CHIP_G_FLASH_INFO_H 8 | 9 | void flash_info_write_enable(void); 10 | void flash_info_write_disable(void); 11 | int flash_info_physical_write(int byte_offset, int num_bytes, const char *data); 12 | int flash_physical_info_read_word(int byte_offset, uint32_t *dst); 13 | 14 | #endif /* ! __EC_CHIP_G_FLASH_INFO_H */ 15 | -------------------------------------------------------------------------------- /chip/g/init_chip.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2016 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 | #ifndef __CROS_EC_INIT_CHIP_H 7 | #define __CROS_EC_INIT_CHIP_H 8 | 9 | enum permission_level { 10 | PERMISSION_LOW = 0x00, 11 | PERMISSION_MEDIUM = 0x33, /* APPS run at medium */ 12 | PERMISSION_HIGH = 0x3C, 13 | PERMISSION_HIGHEST = 0x55 14 | }; 15 | 16 | int runlevel_is_high(void); 17 | void init_runlevel(const enum permission_level desired_level); 18 | 19 | void init_jittery_clock(int highsec); 20 | void init_sof_clock(void); 21 | 22 | #endif /* __CROS_EC_INIT_CHIP_H */ 23 | -------------------------------------------------------------------------------- /chip/g/loader/debug_printf.c: -------------------------------------------------------------------------------- 1 | /* Copyright 2016 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 | #include "debug_printf.h" 6 | 7 | #include "printf.h" 8 | #include "uart.h" 9 | 10 | #include "stddef.h" 11 | 12 | static int printchar(void *context, int c) 13 | { 14 | if (c == '\n') 15 | uart_write_char('\r'); 16 | uart_write_char(c); 17 | 18 | return 0; 19 | } 20 | 21 | void debug_printf(const char *format, ...) 22 | { 23 | va_list args; 24 | 25 | va_start(args, format); 26 | vfnprintf(printchar, NULL, format, args); 27 | va_end(args); 28 | } 29 | -------------------------------------------------------------------------------- /chip/g/loader/debug_printf.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2015 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 | #ifndef __EC_CHIP_G_LOADER_DEBUG_PRINTF_H 6 | #define __EC_CHIP_G_LOADER_DEBUG_PRINTF_H 7 | 8 | void debug_printf(const char *format, ...); 9 | 10 | #ifdef DEBUG 11 | #define VERBOSE debug_printf 12 | #else 13 | #define VERBOSE(...) 14 | #endif 15 | 16 | #endif /* __EC_CHIP_G_LOADER_DEBUG_PRINTF_H */ 17 | -------------------------------------------------------------------------------- /chip/g/loader/key_ladder.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2015 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 | #ifndef __EC_CHIP_G_LOADER_KEY_LADDER_H 7 | #define __EC_CHIP_G_LOADER_KEY_LADDER_H 8 | 9 | #include 10 | #include 11 | 12 | void key_ladder_step(uint32_t certificate, const uint32_t *input); 13 | 14 | #endif /* ! __EC_CHIP_G_LOADER_KEY_LADDER_H */ 15 | -------------------------------------------------------------------------------- /chip/g/loader/setup.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2015 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 | #ifndef __EC_CHIP_G_LOADER_SETUP_H 7 | #define __EC_CHIP_G_LOADER_SETUP_H 8 | 9 | #include 10 | #include 11 | 12 | void checkBuildVersion(void); 13 | void disarmRAMGuards(void); 14 | void halt(void); 15 | void tryLaunch(uint32_t adr, size_t max_size); 16 | void unlockFlashForRW(void); 17 | 18 | #endif /* __EC_CHIP_G_LOADER_SETUP_H */ 19 | -------------------------------------------------------------------------------- /chip/g/loader/verify.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2015 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 | #ifndef __EC_CHIP_G_LOADER_VERIFY_H 7 | #define __EC_CHIP_G_LOADER_VERIFY_H 8 | 9 | /* 10 | * Verify a RSA PKCS1.5 signature against an expected sha256. Unlocks for 11 | * execution upon success. 12 | */ 13 | void LOADERKEY_verify(uint32_t keyid, 14 | const uint32_t *signature, const uint32_t *sha256); 15 | 16 | #endif /* __EC_CHIP_G_LOADER_VERIFY_H */ 17 | -------------------------------------------------------------------------------- /chip/g/rbox.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2016 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 | #ifndef __CROS_RBOX_H 7 | #define __CROS_RBOX_H 8 | 9 | /** 10 | * Return true if the power button output shows it is pressed 11 | */ 12 | int rbox_powerbtn_is_pressed(void); 13 | 14 | /** 15 | * Return true if power button rbox output override is enabled 16 | */ 17 | int rbox_powerbtn_override_is_enabled(void); 18 | 19 | /** 20 | * Disable the output override 21 | */ 22 | void rbox_powerbtn_release(void); 23 | 24 | /** 25 | * Override power button output to force a power button press 26 | */ 27 | void rbox_powerbtn_press(void); 28 | #endif /* __CROS_RBOX_H */ 29 | -------------------------------------------------------------------------------- /chip/g/rdd.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2016 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 | #ifndef __CROS_RDD_H 7 | #define __CROS_RDD_H 8 | 9 | /* Detach from debug cable */ 10 | void rdd_detached(void); 11 | 12 | /* Attach to debug cable */ 13 | void rdd_attached(void); 14 | 15 | /* 16 | * USB is only used for CCD, so only enable UTMI wakeups when RDD detects that 17 | * a debug accessory is attached and disable it as a wakeup source when the 18 | * cable is detached. 19 | */ 20 | int is_utmi_wakeup_allowed(void); 21 | #endif /* __CROS_RDD_H */ 22 | -------------------------------------------------------------------------------- /chip/g/spi_master.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015 The Chromium OS Authors. All rights reserved. 3 | * Use of this source code is governed by a BSD-style license that can be 4 | * found in the LICENSE file. 5 | */ 6 | 7 | #ifndef __CROS_EC_INCLUDE_SPI_MASTER_H 8 | #define __CROS_EC_INCLUDE_SPI_MASTER_H 9 | 10 | #include "spi.h" 11 | 12 | void configure_spi0_passthrough(int enable); 13 | void set_spi_clock_mode(int port, enum spi_clock_mode mode); 14 | 15 | #endif 16 | -------------------------------------------------------------------------------- /chip/host/build.mk: -------------------------------------------------------------------------------- 1 | # -*- makefile -*- 2 | # Copyright (c) 2013 The Chromium OS Authors. All rights reserved. 3 | # Use of this source code is governed by a BSD-style license that can be 4 | # found in the LICENSE file. 5 | # 6 | # emulator specific files build 7 | # 8 | 9 | CORE:=host 10 | 11 | chip-y=system.o gpio.o uart.o persistence.o flash.o lpc.o reboot.o i2c.o \ 12 | clock.o 13 | chip-$(HAS_TASK_KEYSCAN)+=keyboard_raw.o 14 | chip-$(CONFIG_USB_POWER_DELIVERY)+=usb_pd_phy.o 15 | -------------------------------------------------------------------------------- /chip/host/clock.c: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2013 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 | * Dummy clock driver for unit test. 6 | */ 7 | 8 | #include "clock.h" 9 | 10 | int clock_get_freq(void) 11 | { 12 | return 16000000; 13 | } 14 | -------------------------------------------------------------------------------- /chip/host/host_test.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2013 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 | /* Unit testing for Chrome EC */ 7 | 8 | #ifndef __CROS_EC_HOST_TEST_H 9 | #define __CROS_EC_HOST_TEST_H 10 | 11 | /* Emulator exit codes */ 12 | #define EXIT_CODE_HIBERNATE (1 << 7) 13 | 14 | /* Get emulator executable name */ 15 | const char *__get_prog_name(void); 16 | 17 | #endif /* __CROS_EC_HOST_TEST_H */ 18 | -------------------------------------------------------------------------------- /chip/host/lpc.c: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2013 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 | /* LPC module for Chrome EC emulator */ 7 | 8 | #include "lpc.h" 9 | 10 | test_mockable int lpc_keyboard_has_char(void) 11 | { 12 | return 0; 13 | } 14 | 15 | test_mockable int lpc_keyboard_input_pending(void) 16 | { 17 | return 0; 18 | } 19 | 20 | test_mockable void lpc_keyboard_put_char(uint8_t chr, int send_irq) 21 | { 22 | /* Do nothing */ 23 | } 24 | 25 | test_mockable void lpc_keyboard_clear_buffer(void) 26 | { 27 | /* Do nothing */ 28 | } 29 | 30 | test_mockable void lpc_keyboard_resume_irq(void) 31 | { 32 | /* Do nothing */ 33 | } 34 | -------------------------------------------------------------------------------- /chip/host/persistence.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2013 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 | /* Persistence module for emulator */ 7 | 8 | #ifndef __CROS_EC_PERSISTENCE_H 9 | #define __CROS_EC_PERSISTENCE_H 10 | 11 | #include 12 | 13 | FILE *get_persistent_storage(const char *tag, const char *mode); 14 | 15 | void release_persistent_storage(FILE *ps); 16 | 17 | void remove_persistent_storage(const char *tag); 18 | 19 | #endif /* __CROS_EC_PERSISTENCE_H */ 20 | -------------------------------------------------------------------------------- /chip/host/reboot.c: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2013 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 | /* Emulator self-reboot procedure */ 7 | 8 | #include 9 | #include 10 | 11 | #include "host_test.h" 12 | #include "reboot.h" 13 | #include "test_util.h" 14 | 15 | void emulator_reboot(void) 16 | { 17 | char *argv[] = {strdup(__get_prog_name()), NULL}; 18 | emulator_flush(); 19 | execv(__get_prog_name(), argv); 20 | } 21 | -------------------------------------------------------------------------------- /chip/host/reboot.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2013 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 | /* Emulator self-reboot procedure */ 7 | 8 | #ifndef __CROS_EC_REBOOT_H 9 | #define __CROS_EC_REBOOT_H 10 | 11 | void emulator_reboot(void); 12 | 13 | #endif 14 | -------------------------------------------------------------------------------- /chip/host/registers.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2013 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 | /* Empty registers header for emulator */ 7 | 8 | /* 9 | * There is no register for emulator, but this file exists to prevent 10 | * compilation failure if any file includes registers.h 11 | */ 12 | -------------------------------------------------------------------------------- /chip/ish/clock.c: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2016 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 | /* Clocks and power management settings */ 7 | 8 | #include "clock.h" 9 | #include "common.h" 10 | #include "util.h" 11 | 12 | /* Console output macros */ 13 | #define CPUTS(outstr) cputs(CC_CLOCK, outstr) 14 | #define CPRINTS(format, args...) cprints(CC_CLOCK, format, ## args) 15 | 16 | 17 | void clock_init(void) 18 | { 19 | /* No initialization for ISH clock since D0ix is not enabled yet */ 20 | } 21 | -------------------------------------------------------------------------------- /chip/ish/flash.c: -------------------------------------------------------------------------------- 1 | /* Copyright 2015 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 | #include "common.h" 7 | #include "flash.h" 8 | 9 | 10 | /** 11 | * Initialize the module. 12 | * 13 | * Applies at-boot protection settings if necessary. 14 | */ 15 | int flash_pre_init(void) 16 | { 17 | return EC_SUCCESS; 18 | } 19 | -------------------------------------------------------------------------------- /chip/ish/gpio.c: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2016 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 | /* GPIO module for ISH */ 7 | 8 | #include "common.h" 9 | #include "gpio.h" 10 | #include "hooks.h" 11 | #include "registers.h" 12 | #include "system.h" 13 | #include "task.h" 14 | #include "timer.h" 15 | #include "util.h" 16 | 17 | test_mockable int gpio_get_level(enum gpio_signal signal) 18 | { 19 | return 0; 20 | } 21 | 22 | void gpio_set_level(enum gpio_signal signal, int value) 23 | { 24 | } 25 | 26 | void gpio_pre_init(void) 27 | { 28 | } 29 | 30 | static void gpio_init(void) 31 | { 32 | /* TBD */ 33 | } 34 | DECLARE_HOOK(HOOK_INIT, gpio_init, HOOK_PRIO_DEFAULT); 35 | -------------------------------------------------------------------------------- /chip/ish/jtag.c: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2016 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 | /* Settings to enable JTAG debugging */ 6 | 7 | #include "jtag.h" 8 | #include "registers.h" 9 | 10 | void jtag_pre_init(void) 11 | { 12 | /* Not implemented yet */ 13 | } 14 | -------------------------------------------------------------------------------- /chip/it83xx/build.mk: -------------------------------------------------------------------------------- 1 | # -*- makefile -*- 2 | # Copyright (c) 2013 The Chromium OS Authors. All rights reserved. 3 | # Use of this source code is governed by a BSD-style license that can be 4 | # found in the LICENSE file. 5 | # 6 | # IT83xx chip specific files build 7 | # 8 | 9 | # IT83xx SoC family has an Andes N801 core. 10 | CORE:=nds32 11 | 12 | CFLAGS_CPU+=-mno-gp-direct 13 | 14 | # Required chip modules 15 | chip-y=hwtimer.o uart.o gpio.o system.o jtag.o clock.o irq.o intc.o 16 | 17 | # Optional chip modules 18 | chip-$(CONFIG_WATCHDOG)+=watchdog.o 19 | chip-$(CONFIG_FANS)+=fan.o pwm.o 20 | chip-$(CONFIG_FLASH_PHYSICAL)+=flash.o 21 | chip-$(CONFIG_PWM)+=pwm.o 22 | chip-$(CONFIG_ADC)+=adc.o 23 | chip-$(CONFIG_EC2I)+=ec2i.o 24 | chip-$(CONFIG_LPC)+=lpc.o 25 | chip-$(CONFIG_SPI)+=spi.o 26 | chip-$(CONFIG_PECI)+=peci.o 27 | chip-$(HAS_TASK_KEYSCAN)+=keyboard_raw.o 28 | chip-$(CONFIG_I2C)+=i2c.o 29 | -------------------------------------------------------------------------------- /chip/it83xx/jtag.c: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2013 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 | #include "clock.h" 7 | #include "gpio.h" 8 | #include "jtag.h" 9 | #include "registers.h" 10 | #include "system.h" 11 | 12 | void jtag_pre_init(void) 13 | { 14 | /* bit4, enable debug mode through SMBus */ 15 | IT83XX_SMB_SLVISELR &= ~(1 << 4); 16 | } 17 | -------------------------------------------------------------------------------- /chip/it83xx/kmsc_chip.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2015 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 | /* Keyboard matrix scan control module for IT83xx. */ 7 | 8 | #ifndef __CROS_EC_KMSC_CHIP_H 9 | #define __CROS_EC_KMSC_CHIP_H 10 | 11 | void keyboard_raw_interrupt(void); 12 | 13 | #endif /* __CROS_EC_KMSC_CHIP_H */ 14 | -------------------------------------------------------------------------------- /chip/lm4/chip_temp_sensor.c: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2012 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 | /* Temperature sensor module for Chrome EC */ 7 | 8 | #include "adc.h" 9 | #include "adc_chip.h" 10 | #include "common.h" 11 | #include "hooks.h" 12 | 13 | /* Initialize temperature reading to a sane value (27 C) */ 14 | static int last_val = C_TO_K(27); 15 | 16 | static void chip_temp_sensor_poll(void) 17 | { 18 | last_val = adc_read_channel(ADC_CH_EC_TEMP); 19 | } 20 | DECLARE_HOOK(HOOK_SECOND, chip_temp_sensor_poll, HOOK_PRIO_TEMP_SENSOR); 21 | 22 | int chip_temp_sensor_get_val(int idx, int *temp_ptr) 23 | { 24 | if (last_val == ADC_READ_ERROR) 25 | return EC_ERROR_UNKNOWN; 26 | 27 | *temp_ptr = last_val; 28 | 29 | return EC_SUCCESS; 30 | } 31 | -------------------------------------------------------------------------------- /chip/lm4/pwm_chip.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2013 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 | /* LM4-specific PWM module for Chrome EC */ 7 | 8 | #ifndef __CROS_EC_PWM_CHIP_H 9 | #define __CROS_EC_PWM_CHIP_H 10 | 11 | /* Data structure to define PWM channels. */ 12 | struct pwm_t { 13 | /* PWM channel ID */ 14 | int channel; 15 | /* PWM channel flags. See include/pwm.h */ 16 | uint32_t flags; 17 | }; 18 | 19 | extern const struct pwm_t pwm_channels[]; 20 | 21 | #endif /* __CROS_EC_PWM_CHIP_H */ 22 | -------------------------------------------------------------------------------- /chip/mec1322/jtag.c: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2013 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 | /* Settings to enable JTAG debugging */ 6 | 7 | #include "jtag.h" 8 | #include "registers.h" 9 | 10 | void jtag_pre_init(void) 11 | { 12 | /* Not implemented yet */ 13 | } 14 | -------------------------------------------------------------------------------- /chip/mec1322/lfw/ec_lfw.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2015 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 | * MEC1322 SoC little FW 6 | * 7 | */ 8 | 9 | void lfw_main(void) __attribute__ ((noreturn, naked)); 10 | void fault_handler(void) __attribute__((naked)); 11 | 12 | struct int_vector_t { 13 | void *stack_ptr; 14 | void *reset_vector; 15 | void *nmi; 16 | void *hard_fault; 17 | void *bus_fault; 18 | void *usage_fault; 19 | }; 20 | 21 | #define SPI_CHUNK_SIZE 1024 22 | -------------------------------------------------------------------------------- /chip/mec1322/pwm_chip.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2013 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 | /* MEC1322-specific PWM module for Chrome EC */ 7 | #ifndef __CROS_EC_PWM_CHIP_H 8 | #define __CROS_EC_PWM_CHIP_H 9 | 10 | /* Data structure to define PWM channels. */ 11 | struct pwm_t { 12 | /* PWM Channel ID */ 13 | int channel; 14 | 15 | /* PWM channel flags. See include/pwm.h */ 16 | uint32_t flags; 17 | }; 18 | 19 | extern const struct pwm_t pwm_channels[]; 20 | 21 | /* 22 | * Returns PWMs that must remain active in low-power idle - 23 | * MEC1322_PCR_EC_SLP_EN bit mask. 24 | */ 25 | uint32_t pwm_get_keep_awake_mask(void); 26 | #endif /* __CROS_EC_PWM_CHIP_H */ 27 | -------------------------------------------------------------------------------- /chip/npcx/clock_chip.h: -------------------------------------------------------------------------------- 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 | /* NPCX-specific clock module for Chrome EC */ 7 | 8 | #ifndef __CROS_EC_CLOCK_CHIP_H 9 | #define __CROS_EC_CLOCK_CHIP_H 10 | 11 | /* Default is 40MHz (target is 15MHz) */ 12 | #define OSC_CLK 15000000 13 | 14 | /** 15 | * Return the current APB1 clock frequency in Hz. 16 | */ 17 | int clock_get_apb1_freq(void); 18 | 19 | /** 20 | * Return the current APB2 clock frequency in Hz. 21 | */ 22 | int clock_get_apb2_freq(void); 23 | 24 | /** 25 | * Set the CPU clock to maximum freq for better performance. 26 | */ 27 | void clock_turbo(void); 28 | 29 | #endif /* __CROS_EC_CLOCK_CHIP_H */ 30 | -------------------------------------------------------------------------------- /chip/npcx/lfw/ec_lfw.h: -------------------------------------------------------------------------------- 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 | * NPCX5M5G SoC little FW used by booter 6 | */ 7 | 8 | #ifndef __CROS_EC_EC_LFW_H 9 | #define __CROS_EC_EC_LFW_H 10 | 11 | /* Begin address for the .iram section; defined in linker script */ 12 | extern unsigned int __iram_fw_start; 13 | /* End address for the .iram section; defined in linker script */ 14 | extern unsigned int __iram_fw_end; 15 | /* Begin address for the iram codes; defined in linker script */ 16 | extern unsigned int __flash_fw_start; 17 | 18 | #endif /* __CROS_EC_EC_LFW_H */ 19 | -------------------------------------------------------------------------------- /chip/npcx/lpc_chip.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2015 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 | /* NPCX-specific hwtimer module for Chrome EC */ 7 | 8 | #ifndef __CROS_EC_LPC_CHIP_H 9 | #define __CROS_EC_LPC_CHIP_H 10 | 11 | /* For host registers initialization via SIB module */ 12 | void host_register_init(void); 13 | 14 | #ifdef CONFIG_ESPI 15 | /* eSPI Initialization functions */ 16 | void espi_init(void); 17 | /* eSPI reset assert/de-assert interrupt */ 18 | void espi_espirst_handler(void); 19 | #else 20 | /* LPC PLTRST assert/de-assert interrupt */ 21 | void lpc_lreset_pltrst_handler(void); 22 | #endif 23 | #endif /* __CROS_EC_LPC_CHIP_H */ 24 | -------------------------------------------------------------------------------- /chip/npcx/pwm_chip.h: -------------------------------------------------------------------------------- 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 | /* NPCX-specific PWM module for Chrome EC */ 7 | 8 | #ifndef __CROS_EC_PWM_CHIP_H 9 | #define __CROS_EC_PWM_CHIP_H 10 | 11 | /* Data structure to define PWM channels. */ 12 | struct pwm_t { 13 | /* PWM channel ID */ 14 | int channel; 15 | /* PWM channel flags. See include/pwm.h */ 16 | uint32_t flags; 17 | /* PWM freq. */ 18 | uint32_t freq; 19 | }; 20 | 21 | extern const struct pwm_t pwm_channels[]; 22 | void pwm_config(enum pwm_channel ch); 23 | 24 | #endif /* __CROS_EC_PWM_CHIP_H */ 25 | -------------------------------------------------------------------------------- /chip/npcx/shi_chip.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2015 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 | /* NPCX-specific SHI module for Chrome EC */ 7 | 8 | #ifndef SHI_CHIP_H_ 9 | #define SHI_CHIP_H_ 10 | 11 | #ifdef CONFIG_HOSTCMD_SPS 12 | /** 13 | * Called when the NSS level changes, signalling the start of a SHI 14 | * transaction. 15 | * 16 | * @param signal GPIO signal that changed 17 | */ 18 | void shi_cs_event(enum gpio_signal signal); 19 | #endif 20 | 21 | #endif /* SHI_CHIP_H_ */ 22 | -------------------------------------------------------------------------------- /chip/nrf51/build.mk: -------------------------------------------------------------------------------- 1 | # -*- makefile -*- 2 | # Copyright (c) 2014 The Chromium OS Authors. All rights reserved. 3 | # Use of this source code is governed by a BSD-style license that can be 4 | # found in the LICENSE file. 5 | # 6 | # nRF51822 chip specific files build 7 | # 8 | 9 | CORE:=cortex-m0 10 | # Force ARMv6-M ISA used by the Cortex-M0 11 | CFLAGS_CPU+=-march=armv6-m -mcpu=cortex-m0 12 | 13 | chip-y+=gpio.o system.o uart.o 14 | chip-y+=jtag.o watchdog.o ppi.o 15 | 16 | chip-$(CONFIG_BLUETOOTH_LE)+=radio.o bluetooth_le.o 17 | chip-$(CONFIG_BLUETOOTH_LE_RADIO_TEST)+=radio_test.o 18 | chip-$(CONFIG_COMMON_TIMER)+=hwtimer.o clock.o 19 | chip-$(CONFIG_I2C)+=i2c.o 20 | chip-$(HAS_TASK_KEYSCAN)+=keyboard_raw.o 21 | -------------------------------------------------------------------------------- /chip/nrf51/clock.c: -------------------------------------------------------------------------------- 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 | /* Clocks and power management settings */ 7 | 8 | void clock_init(void) 9 | { 10 | } 11 | 12 | int clock_get_freq(void) 13 | { 14 | /* constant 16 MHz clock */ 15 | return 16000000; 16 | } 17 | -------------------------------------------------------------------------------- /chip/nrf51/jtag.c: -------------------------------------------------------------------------------- 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 | /* Settings to enable JTAG debugging */ 6 | 7 | void jtag_pre_init(void) 8 | { 9 | } 10 | -------------------------------------------------------------------------------- /chip/nrf51/watchdog.c: -------------------------------------------------------------------------------- 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 | /* Watchdog driver */ 7 | 8 | #include "common.h" 9 | #include "console.h" 10 | 11 | /* Console output macros */ 12 | #define CPUTS(outstr) cputs(CC_SYSTEM, outstr) 13 | #define CPRINTS(format, args...) cprints(CC_SYSTEM, format, ## args) 14 | 15 | 16 | int watchdog_init(void) 17 | { 18 | CPRINTS("TODO: implement %s()", __func__); 19 | return EC_ERROR_UNIMPLEMENTED; 20 | } 21 | -------------------------------------------------------------------------------- /chip/stm32/clock-stm32f3.c: -------------------------------------------------------------------------------- 1 | clock-stm32f0.c -------------------------------------------------------------------------------- /chip/stm32/config-stm32f05x.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2015 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 | /* Memory mapping */ 7 | #define CONFIG_FLASH_SIZE (64 * 1024) 8 | #define CONFIG_FLASH_BANK_SIZE 0x1000 9 | #define CONFIG_FLASH_ERASE_SIZE 0x0400 /* erase bank size */ 10 | #define CONFIG_FLASH_WRITE_SIZE 0x0002 /* minimum write size */ 11 | 12 | /* No page mode on STM32F, so no benefit to larger write sizes */ 13 | #define CONFIG_FLASH_WRITE_IDEAL_SIZE 0x0002 14 | 15 | #define CONFIG_RAM_BASE 0x20000000 16 | #define CONFIG_RAM_SIZE 0x00002000 17 | 18 | /* Number of IRQ vectors on the NVIC */ 19 | #define CONFIG_IRQ_COUNT 32 20 | 21 | /* Reduced history because of limited RAM */ 22 | #undef CONFIG_CONSOLE_HISTORY 23 | #define CONFIG_CONSOLE_HISTORY 3 24 | -------------------------------------------------------------------------------- /chip/stm32/config-stm32f09x.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2015 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 | /* Memory mapping */ 7 | #define CONFIG_FLASH_SIZE 0x00040000 8 | #define CONFIG_FLASH_BANK_SIZE 0x2000 9 | #define CONFIG_FLASH_ERASE_SIZE 0x0800 /* erase bank size */ 10 | #define CONFIG_FLASH_WRITE_SIZE 0x0002 /* minimum write size */ 11 | 12 | /* No page mode on STM32F, so no benefit to larger write sizes */ 13 | #define CONFIG_FLASH_WRITE_IDEAL_SIZE 0x0002 14 | 15 | #define CONFIG_RAM_BASE 0x20000000 16 | #define CONFIG_RAM_SIZE 0x00008000 17 | 18 | /* Number of IRQ vectors on the NVIC */ 19 | #define CONFIG_IRQ_COUNT 32 20 | -------------------------------------------------------------------------------- /chip/stm32/config-stm32l476.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2016 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 | /* Memory mapping */ 7 | #define CONFIG_FLASH_SIZE 0x00100000 /* 1 MB */ 8 | #define CONFIG_FLASH_BANK_SIZE 0x800 /* 2 kB */ 9 | #define CONFIG_FLASH_ERASE_SIZE 0x800 /* 2 KB */ 10 | #define CONFIG_FLASH_WRITE_SIZE 0x8 /* 64 bits (without 8 bits ECC) */ 11 | 12 | /* Ideal write size in page-mode */ 13 | #define CONFIG_FLASH_WRITE_IDEAL_SIZE 0x100 /* 256 (32 double words) */ 14 | 15 | #define CONFIG_RAM_BASE 0x20000000 16 | /* Only using SRAM1. SRAM2 (32 KB) is ignored. */ 17 | #define CONFIG_RAM_SIZE 0x00018000 /* 96 kB */ 18 | 19 | /* Number of IRQ vectors on the NVIC */ 20 | #define CONFIG_IRQ_COUNT 82 21 | -------------------------------------------------------------------------------- /chip/stm32/debug_printf.h: -------------------------------------------------------------------------------- 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 | /* Synchronous UART debug printf */ 6 | 7 | #ifndef __CROS_EC_DEBUG_H 8 | #define __CROS_EC_DEBUG_H 9 | 10 | #ifdef CONFIG_DEBUG_PRINTF 11 | void debug_printf(const char *format, ...); 12 | #else 13 | #define debug_printf(...) 14 | #endif 15 | 16 | #endif /* __CROS_EC_DEBUG_H */ 17 | -------------------------------------------------------------------------------- /chip/stm32/gpio-stm32f4.c: -------------------------------------------------------------------------------- 1 | /* Copyright 2016 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 | /* GPIO module for Chrome EC */ 7 | 8 | #include "clock.h" 9 | #include "common.h" 10 | #include "registers.h" 11 | 12 | void gpio_enable_clocks(void) 13 | { 14 | /* 15 | * Enable all GPIOs clocks 16 | * 17 | * TODO(crosbug.com/p/23770): only enable the banks we need to, 18 | * and support disabling some of them in low-power idle. 19 | */ 20 | STM32_RCC_AHB1ENR |= STM32_RCC_AHB1ENR_GPIOMASK; 21 | 22 | /* Delay 1 AHB clock cycle after the clock is enabled */ 23 | clock_wait_bus_cycles(BUS_AHB, 1); 24 | } 25 | 26 | #include "gpio-f0-l.c" 27 | -------------------------------------------------------------------------------- /chip/stm32/gpio_chip.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2016 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 | #ifndef __CROS_EC_CHIP_STM32_GPIO_CHIP_H 7 | #define __CROS_EC_CHIP_STM32_GPIO_CHIP_H 8 | 9 | #include "include/gpio.h" 10 | 11 | /** 12 | * Enable GPIO peripheral clocks. 13 | */ 14 | void gpio_enable_clocks(void); 15 | 16 | #endif /* __CROS_EC_CHIP_STM32_GPIO_CHIP_H */ 17 | -------------------------------------------------------------------------------- /chip/stm32/i2c-stm32f3.c: -------------------------------------------------------------------------------- 1 | i2c-stm32f0.c -------------------------------------------------------------------------------- /chip/stm32/jtag-stm32f0.c: -------------------------------------------------------------------------------- 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 | /* Settings to enable JTAG debugging */ 6 | 7 | #include "jtag.h" 8 | #include "registers.h" 9 | 10 | void jtag_pre_init(void) 11 | { 12 | /* 13 | * Stop all timers we might use (TIM1-3,14-17) and watchdogs when 14 | * the JTAG stops the CPU. 15 | */ 16 | STM32_DBGMCU_APB1FZ |= 17 | STM32_RCC_PB1_TIM2 | STM32_RCC_PB1_TIM3 | STM32_RCC_PB1_TIM6 | 18 | STM32_RCC_PB1_TIM7 | STM32_RCC_PB1_WWDG | STM32_RCC_PB1_IWDG; 19 | STM32_DBGMCU_APB2FZ |= STM32_RCC_PB2_TIM15 | STM32_RCC_PB2_TIM16 | 20 | STM32_RCC_PB2_TIM17 | STM32_RCC_PB2_TIM1; 21 | } 22 | -------------------------------------------------------------------------------- /chip/stm32/jtag-stm32f3.c: -------------------------------------------------------------------------------- 1 | /* Copyright 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 | /* Settings to enable JTAG debugging */ 6 | 7 | #include "jtag.h" 8 | #include "registers.h" 9 | 10 | void jtag_pre_init(void) 11 | { 12 | /* 13 | * Stop all timers we might use and watchdogs when the JTAG stops 14 | * the CPU. 15 | */ 16 | STM32_DBGMCU_APB1FZ |= 17 | STM32_RCC_PB1_TIM2 | STM32_RCC_PB1_TIM3 | STM32_RCC_PB1_TIM4 | 18 | STM32_RCC_PB1_TIM5 | STM32_RCC_PB1_TIM6 | STM32_RCC_PB1_TIM7 | 19 | STM32_RCC_PB1_WWDG | STM32_RCC_PB1_IWDG; 20 | STM32_DBGMCU_APB2FZ |= 21 | STM32_RCC_PB2_TIM15 | STM32_RCC_PB2_TIM16 | STM32_RCC_PB2_TIM17; 22 | } 23 | -------------------------------------------------------------------------------- /chip/stm32/jtag-stm32f4.c: -------------------------------------------------------------------------------- 1 | /* Copyright 2016 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 | /* Settings to enable JTAG debugging */ 6 | 7 | #include "jtag.h" 8 | #include "registers.h" 9 | 10 | void jtag_pre_init(void) 11 | { 12 | /* 13 | * Stop all timers we might use (TIM1-8) and watchdogs when 14 | * the JTAG stops the CPU. 15 | */ 16 | /* TODO(nsanders): Implement this if someone needs jtag. */ 17 | } 18 | -------------------------------------------------------------------------------- /chip/stm32/jtag-stm32l.c: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2012 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 | /* Settings to enable JTAG debugging */ 6 | 7 | #include "jtag.h" 8 | #include "registers.h" 9 | 10 | void jtag_pre_init(void) 11 | { 12 | /* 13 | * Stop all timers we might use (TIM2-4,9-11) and watchdogs when 14 | * the JTAG stops the CPU. 15 | */ 16 | STM32_DBGMCU_APB1FZ |= 17 | STM32_RCC_PB1_TIM2 | STM32_RCC_PB1_TIM3 | STM32_RCC_PB1_TIM4 | 18 | STM32_RCC_PB1_WWDG | STM32_RCC_PB1_IWDG; 19 | STM32_DBGMCU_APB2FZ |= STM32_RCC_PB2_TIM9 | STM32_RCC_PB2_TIM10 | 20 | STM32_RCC_PB2_TIM11; 21 | } 22 | -------------------------------------------------------------------------------- /chip/stm32/jtag-stm32l4.c: -------------------------------------------------------------------------------- 1 | /* Copyright 2016 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 | /* Settings to enable JTAG debugging */ 6 | 7 | #include "jtag.h" 8 | #include "registers.h" 9 | 10 | void jtag_pre_init(void) 11 | { 12 | /* 13 | * Stop all timers we might use (TIM1-8) and watchdogs when 14 | * the JTAG stops the CPU. 15 | */ 16 | STM32_DBGMCU_APB1FZ |= 17 | STM32_RCC_PB1_TIM2 | STM32_RCC_PB1_TIM3 | STM32_RCC_PB1_TIM4 | 18 | STM32_RCC_PB1_TIM5 | STM32_RCC_PB1_TIM6 | STM32_RCC_PB1_TIM7 | 19 | STM32_RCC_PB1_WWDG | STM32_RCC_PB1_IWDG; 20 | STM32_DBGMCU_APB2FZ |= STM32_RCC_PB2_TIM1 | STM32_RCC_PB2_TIM8; 21 | } 22 | -------------------------------------------------------------------------------- /chip/stm32/stm32-dma.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2016 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 | /** 7 | * Select DMA stream-channel mapping 8 | * 9 | * This selects which stream (peripheral) to be used on a specific channel. 10 | * Some STM32 chips simply logically OR requests, thus do not require this 11 | * selection. 12 | * 13 | * @param channel: (Global) channel # base 0 (Note some STM32s use base 1) 14 | * @param peripheral: Refer to the TRM for 'peripheral request signals' 15 | */ 16 | void dma_select_channel(enum dma_channel channel, unsigned char stream); 17 | -------------------------------------------------------------------------------- /chip/stm32/usart-stm32f0.h: -------------------------------------------------------------------------------- 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 | #ifndef __CROS_EC_USART_STM32F0_H 6 | #define __CROS_EC_USART_STM32F0_H 7 | 8 | #include "usart.h" 9 | 10 | /* 11 | * The STM32F0 series can have as many as four UARTS. These are the HW configs 12 | * for those UARTS. They can be used to initialize STM32 generic UART configs. 13 | */ 14 | extern struct usart_hw_config const usart1_hw; 15 | extern struct usart_hw_config const usart2_hw; 16 | extern struct usart_hw_config const usart3_hw; 17 | extern struct usart_hw_config const usart4_hw; 18 | 19 | #endif /* __CROS_EC_USART_STM32F0_H */ 20 | -------------------------------------------------------------------------------- /chip/stm32/usart-stm32f3.h: -------------------------------------------------------------------------------- 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 | #ifndef __CROS_EC_USART_STM32F3_H 6 | #define __CROS_EC_USART_STM32F3_H 7 | 8 | #include "usart.h" 9 | 10 | /* 11 | * The STM32F3 series can have as many as three UARTS. These are the HW configs 12 | * for those UARTS. They can be used to initialize STM32 generic UART configs. 13 | */ 14 | extern struct usart_hw_config const usart1_hw; 15 | extern struct usart_hw_config const usart2_hw; 16 | extern struct usart_hw_config const usart3_hw; 17 | 18 | #endif /* __CROS_EC_USART_STM32F3_H */ 19 | -------------------------------------------------------------------------------- /chip/stm32/usart-stm32l.h: -------------------------------------------------------------------------------- 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 | #ifndef __CROS_EC_USART_STM32L_H 6 | #define __CROS_EC_USART_STM32L_H 7 | 8 | #include "usart.h" 9 | 10 | /* 11 | * The STM32L series can have as many as three UARTS. These are the HW configs 12 | * for those UARTS. They can be used to initialize STM32 generic UART configs. 13 | */ 14 | extern struct usart_hw_config const usart1_hw; 15 | extern struct usart_hw_config const usart2_hw; 16 | extern struct usart_hw_config const usart3_hw; 17 | 18 | #endif /* __CROS_EC_USART_STM32L_H */ 19 | -------------------------------------------------------------------------------- /chip/stm32/usart_rx_interrupt-stm32f0.c: -------------------------------------------------------------------------------- 1 | usart_rx_interrupt.c -------------------------------------------------------------------------------- /chip/stm32/usart_rx_interrupt-stm32f3.c: -------------------------------------------------------------------------------- 1 | usart_rx_interrupt.c -------------------------------------------------------------------------------- /chip/stm32/usb-stm32f0.c: -------------------------------------------------------------------------------- 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 | * STM32F0 Family specific USB functionality 6 | */ 7 | 8 | #include "registers.h" 9 | #include "usb_api.h" 10 | 11 | void usb_connect(void) 12 | { 13 | STM32_USB_BCDR |= (1 << 15) /* DPPU */; 14 | } 15 | 16 | void usb_disconnect(void) 17 | { 18 | /* disable pull-up on DP to disconnect */ 19 | STM32_USB_BCDR &= ~(1 << 15) /* DPPU */; 20 | } 21 | -------------------------------------------------------------------------------- /chip/stm32/usb-stm32f3.c: -------------------------------------------------------------------------------- 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 | * STM32F3 Family specific USB functionality 6 | */ 7 | 8 | #include "usb-stm32f3.h" 9 | 10 | #include "usb_api.h" 11 | 12 | void usb_connect(void) 13 | { 14 | usb_board_connect(); 15 | } 16 | 17 | void usb_disconnect(void) 18 | { 19 | usb_board_disconnect(); 20 | } 21 | -------------------------------------------------------------------------------- /chip/stm32/usb-stm32f3.h: -------------------------------------------------------------------------------- 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 | * STM32F3 Family specific USB functionality 6 | */ 7 | 8 | /* 9 | * A device that uses an STM32F3 part will need to define these two functions 10 | * which are used to connect and disconnect the device from the USB bus. This 11 | * is usually accomplished by enabling a pullup on the DP USB line. The pullup 12 | * should be enabled by default so that the STM32 will enumerate correctly in 13 | * DFU mode (which doesn't know how to enable the DP pullup, so it assumes that 14 | * the pullup is always there). 15 | */ 16 | void usb_board_connect(void); 17 | void usb_board_disconnect(void); 18 | -------------------------------------------------------------------------------- /chip/stm32/usb-stm32l.c: -------------------------------------------------------------------------------- 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 | * STM32L Family specific USB functionality 6 | */ 7 | 8 | #include "registers.h" 9 | #include "usb_api.h" 10 | 11 | void usb_connect(void) 12 | { 13 | STM32_SYSCFG_PMC |= 1; 14 | } 15 | 16 | void usb_disconnect(void) 17 | { 18 | /* disable pull-up on DP to disconnect */ 19 | STM32_SYSCFG_PMC &= ~1; 20 | } 21 | -------------------------------------------------------------------------------- /chip/stm32/usb_dwc_console.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2016 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 | #ifndef __CHIP_STM32_USB_DWC_CONSOLE_H 7 | #define __CHIP_STM32_USB_DWC_CONSOLE_H 8 | 9 | #include "usb_dwc_hw.h" 10 | 11 | extern struct dwc_usb_ep ep_console_ctl; 12 | 13 | #endif /* __CHIP_STM32_USB_DWC_CONSOLE_H */ 14 | -------------------------------------------------------------------------------- /chip/stm32/usb_dwc_update.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2016 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 | #ifndef __CROS_EC_STM32_USB_DWC_UPDATE_H 6 | #define __CROS_EC_STM32_USB_DWC_UPDATE_H 7 | 8 | extern struct dwc_usb_ep usb_update_ep_ctl; 9 | 10 | #endif /* __CROS_EC_STM32_USB_DWC_UPDATE_H */ 11 | -------------------------------------------------------------------------------- /chip/stm32/usb_hid_hw.h: -------------------------------------------------------------------------------- 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 | * USB HID HW definitions, to be used by class drivers. 6 | */ 7 | 8 | #ifndef __CROS_EC_USB_HID_HW_H 9 | #define __CROS_EC_USB_HID_HW_H 10 | 11 | /* internal callbacks for HID class drivers */ 12 | void hid_tx(int ep); 13 | void hid_reset(int ep, usb_uint *hid_ep_buf, int len); 14 | int hid_iface_request(usb_uint *ep0_buf_rx, usb_uint *ep0_buf_tx, 15 | const uint8_t *report_desc, int report_size); 16 | 17 | #endif 18 | -------------------------------------------------------------------------------- /common/crc8.c: -------------------------------------------------------------------------------- 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 | #include "common.h" 6 | #include "crc8.h" 7 | 8 | inline uint8_t crc8(const uint8_t *data, int len) 9 | { 10 | return crc8_arg(data, len, 0); 11 | } 12 | 13 | uint8_t crc8_arg(const uint8_t *data, int len, uint8_t previous_crc) 14 | { 15 | unsigned crc = previous_crc << 8; 16 | int i, j; 17 | 18 | for (j = len; j; j--, data++) { 19 | crc ^= (*data << 8); 20 | for (i = 8; i; i--) { 21 | if (crc & 0x8000) 22 | crc ^= (0x1070 << 3); 23 | crc <<= 1; 24 | } 25 | } 26 | 27 | return (uint8_t)(crc >> 8); 28 | } 29 | -------------------------------------------------------------------------------- /common/ec.libsharedobjs.ld: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2015 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 | SECTIONS 7 | { 8 | .roshared : { KEEP(*(.roshared*)) } 9 | /* 10 | * Save the .ARM.atrributes section to make the linker not complain 11 | * about conflicting CPU architectures when linking with the RW objs. 12 | * This section will be discarded by the main EC linker script. 13 | */ 14 | .ARM.attributes : { KEEP(*(.ARM.*)) } 15 | } 16 | -------------------------------------------------------------------------------- /common/sensor_common.c: -------------------------------------------------------------------------------- 1 | /* Copyright 2017 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 | /* Sensor common routines. */ 7 | 8 | #include "common.h" 9 | #include "console.h" 10 | #include "motion_sense.h" 11 | 12 | /* Console output macros */ 13 | #define CPUTS(outstr) cputs(CC_MOTION_SENSE, outstr) 14 | #define CPRINTS(format, args...) cprints(CC_MOTION_SENSE, format, ## args) 15 | #define CPRINTF(format, args...) cprintf(CC_MOTION_SENSE, format, ## args) 16 | 17 | void sensor_init_done(const struct motion_sensor_t *s, int range) 18 | { 19 | #ifdef CONFIG_CONSOLE_VERBOSE 20 | CPRINTS("%s: MS Done Init type:0x%X range:%d", 21 | s->name, s->type, range); 22 | #else 23 | CPRINTS("%c%d InitDone r:%d", s->name[0], s->type, range); 24 | #endif 25 | } 26 | -------------------------------------------------------------------------------- /common/tablet_mode.c: -------------------------------------------------------------------------------- 1 | /* Copyright 2016 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 | #include "hooks.h" 7 | 8 | /* Return 1 if in tablet mode, 0 otherwise */ 9 | static int tablet_mode = 1; 10 | 11 | int tablet_get_mode(void) 12 | { 13 | return tablet_mode; 14 | } 15 | 16 | void tablet_set_mode(int mode) 17 | { 18 | if (tablet_mode != mode) { 19 | tablet_mode = mode; 20 | hook_notify(HOOK_TABLET_MODE_CHANGE); 21 | } 22 | } 23 | 24 | -------------------------------------------------------------------------------- /common/vec3.c: -------------------------------------------------------------------------------- 1 | /* Copyright 2015 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 | #include "common.h" 7 | #include "math.h" 8 | #include "math_util.h" 9 | #include "vec3.h" 10 | #include "util.h" 11 | 12 | void vec3_scalar_mul(vec3_t v, float c) 13 | { 14 | v[X] *= c; 15 | v[Y] *= c; 16 | v[Z] *= c; 17 | } 18 | 19 | float vec3_dot(const vec3_t v, const vec3_t w) 20 | { 21 | return v[X] * w[X] + v[Y] * w[Y] + v[Z] * w[Z]; 22 | } 23 | 24 | float vec3_norm_squared(const vec3_t v) 25 | { 26 | return vec3_dot(v, v); 27 | } 28 | 29 | float vec3_norm(const vec3_t v) 30 | { 31 | return sqrtf(vec3_norm_squared(v)); 32 | } 33 | 34 | -------------------------------------------------------------------------------- /core/cortex-m/config_core.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2013 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 | #ifndef __CROS_EC_CONFIG_CORE_H 7 | #define __CROS_EC_CONFIG_CORE_H 8 | 9 | /* Linker binary architecture and format */ 10 | #define BFD_ARCH arm 11 | #define BFD_FORMAT "elf32-littlearm" 12 | 13 | #define CONFIG_SOFTWARE_PANIC 14 | 15 | #endif /* __CROS_EC_CONFIG_CORE_H */ 16 | -------------------------------------------------------------------------------- /core/cortex-m/cpu.c: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2012 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 | * Set up the Cortex-M core 6 | */ 7 | 8 | #include "cpu.h" 9 | 10 | void cpu_init(void) 11 | { 12 | /* Catch divide by 0 and unaligned access */ 13 | CPU_NVIC_CCR |= CPU_NVIC_CCR_DIV_0_TRAP | CPU_NVIC_CCR_UNALIGN_TRAP; 14 | 15 | /* Enable reporting of memory faults, bus faults and usage faults */ 16 | CPU_NVIC_SHCSR |= CPU_NVIC_SHCSR_MEMFAULTENA | 17 | CPU_NVIC_SHCSR_BUSFAULTENA | CPU_NVIC_SHCSR_USGFAULTENA; 18 | } 19 | -------------------------------------------------------------------------------- /core/cortex-m/include/math.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2012 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 | /* Math utility functions for ARMv7 */ 7 | 8 | #ifndef __CROS_EC_MATH_H 9 | #define __CROS_EC_MATH_H 10 | 11 | #ifdef CONFIG_FPU 12 | static inline float sqrtf(float v) 13 | { 14 | float root; 15 | asm volatile( 16 | "fsqrts %0, %1" 17 | : "=w" (root) 18 | : "w" (v) 19 | ); 20 | return root; 21 | } 22 | 23 | static inline float fabsf(float v) 24 | { 25 | float root; 26 | asm volatile( 27 | "fabss %0, %1" 28 | : "=w" (root) 29 | : "w" (v) 30 | ); 31 | return root; 32 | } 33 | #endif /* CONFIG_FPU */ 34 | 35 | #endif /* __CROS_EC_MATH_H */ 36 | -------------------------------------------------------------------------------- /core/cortex-m0/build.mk: -------------------------------------------------------------------------------- 1 | # -*- makefile -*- 2 | # Copyright (c) 2014 The Chromium OS Authors. All rights reserved. 3 | # Use of this source code is governed by a BSD-style license that can be 4 | # found in the LICENSE file. 5 | # 6 | # Cortex-M0 core OS files build 7 | # 8 | 9 | # Select ARMv6-m compatible bare-metal toolchain 10 | CROSS_COMPILE?=arm-none-eabi- 11 | 12 | # CPU specific compilation flags 13 | CFLAGS_CPU+=-mthumb -Os -mno-sched-prolog 14 | CFLAGS_CPU+=-mno-unaligned-access 15 | 16 | ifneq ($(CONFIG_LTO),) 17 | CFLAGS_CPU+=-flto 18 | LDFLAGS_EXTRA+=-flto 19 | endif 20 | 21 | core-y=cpu.o init.o thumb_case.o div.o lmul.o ldivmod.o uldivmod.o 22 | core-$(CONFIG_COMMON_PANIC_OUTPUT)+=panic.o 23 | core-$(CONFIG_COMMON_RUNTIME)+=switch.o task.o 24 | core-$(CONFIG_WATCHDOG)+=watchdog.o 25 | -------------------------------------------------------------------------------- /core/cortex-m0/config_core.h: -------------------------------------------------------------------------------- 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 | #ifndef __CROS_EC_CONFIG_CORE_H 7 | #define __CROS_EC_CONFIG_CORE_H 8 | 9 | /* Linker binary architecture and format */ 10 | #define BFD_ARCH arm 11 | #define BFD_FORMAT "elf32-littlearm" 12 | 13 | /* Emulate the CLZ instruction since the CPU core is lacking support */ 14 | #define CONFIG_SOFTWARE_CLZ 15 | #define CONFIG_SOFTWARE_PANIC 16 | 17 | #endif /* __CROS_EC_CONFIG_CORE_H */ 18 | -------------------------------------------------------------------------------- /core/cortex-m0/cpu.c: -------------------------------------------------------------------------------- 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 | * Set up the Cortex-M0 core 6 | */ 7 | 8 | #include "cpu.h" 9 | 10 | void cpu_init(void) 11 | { 12 | /* Catch unaligned access */ 13 | CPU_NVIC_CCR |= CPU_NVIC_CCR_UNALIGN_TRAP; 14 | 15 | /* Set supervisor call (SVC) to priority 0 */ 16 | CPU_NVIC_SHCSR2 = 0; 17 | 18 | /* Set lowest priority for PendSV */ 19 | CPU_NVIC_SHCSR3 = (0xff << 16); 20 | } 21 | -------------------------------------------------------------------------------- /core/host/build.mk: -------------------------------------------------------------------------------- 1 | # -*- makefile -*- 2 | # Copyright (c) 2013 The Chromium OS Authors. All rights reserved. 3 | # Use of this source code is governed by a BSD-style license that can be 4 | # found in the LICENSE file. 5 | # 6 | # emulator specific files build 7 | # 8 | 9 | CFLAGS_CPU=-fno-builtin 10 | 11 | core-y=main.o task.o timer.o panic.o disabled.o stack_trace.o 12 | -------------------------------------------------------------------------------- /core/host/cpu.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2013 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 | /* CPU specific header file */ 7 | 8 | #ifndef __CROS_EC_CPU_H 9 | #define __CROS_EC_CPU_H 10 | 11 | static inline void cpu_init(void) { } 12 | 13 | #endif /* __CROS_EC_CPU_H */ 14 | -------------------------------------------------------------------------------- /core/host/disabled.c: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2013 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 | /* Disabled functions */ 7 | 8 | #define DISABLED(proto) proto { } 9 | 10 | DISABLED(void jtag_pre_init(void)); 11 | DISABLED(void clock_init(void)); 12 | -------------------------------------------------------------------------------- /core/host/panic.c: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2013 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 | #include 7 | #include 8 | 9 | #include "common.h" 10 | #include "panic.h" 11 | #include "stack_trace.h" 12 | #include "test_util.h" 13 | #include "util.h" 14 | 15 | void panic_assert_fail(const char *msg, const char *func, const char *fname, 16 | int linenum) 17 | { 18 | fprintf(stderr, "ASSERTION FAIL: %s:%d:%s - %s\n", 19 | fname, linenum, func, msg); 20 | task_dump_trace(); 21 | 22 | puts("Fail!"); /* Inform test runner */ 23 | fflush(stdout); 24 | 25 | exit(1); 26 | } 27 | -------------------------------------------------------------------------------- /core/minute-ia/config_core.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2016 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 | #ifndef __CROS_EC_CONFIG_CORE_H 7 | #define __CROS_EC_CONFIG_CORE_H 8 | 9 | /* Linker binary architecture and format */ 10 | #define BFD_ARCH "i386" 11 | #define BFD_FORMAT "elf32-i386" 12 | 13 | #define CONFIG_SOFTWARE_PANIC 14 | 15 | #endif /* __CROS_EC_CONFIG_CORE_H */ 16 | -------------------------------------------------------------------------------- /core/minute-ia/cpu.c: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2016 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 | * Set up the LM2 mIA core 6 | */ 7 | 8 | #include 9 | 10 | 11 | void cpu_init(void) 12 | { 13 | /* Nothing to do now */ 14 | return; 15 | } 16 | -------------------------------------------------------------------------------- /core/minute-ia/cpu.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2016 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 | * Registers map and definitions for mIA LM2 processor 6 | */ 7 | 8 | #ifndef __CROS_EC_CPU_H 9 | #define __CROS_EC_CPU_H 10 | 11 | 12 | void cpu_init(void); 13 | #endif /* __CROS_EC_CPU_H */ 14 | -------------------------------------------------------------------------------- /core/minute-ia/include/math.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2016 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 | /* Math utility functions for minute-IA */ 7 | 8 | #ifndef __CROS_EC_MATH_H 9 | #define __CROS_EC_MATH_H 10 | 11 | #ifdef CONFIG_FPU 12 | static inline float sqrtf(float v) 13 | { 14 | float root; 15 | 16 | /* root = fsqart (v); */ 17 | asm volatile( 18 | "fsqrt" 19 | : "=t" (root) 20 | : "0" (v) 21 | ); 22 | return root; 23 | } 24 | 25 | static inline float fabsf(float v) 26 | { 27 | float root; 28 | 29 | /* root = fabs (v); */ 30 | asm volatile( 31 | "fabs" 32 | : "=t" (root) 33 | : "0" (v) 34 | ); 35 | return root; 36 | } 37 | #endif /* CONFIG_FPU */ 38 | 39 | #endif /* __CROS_EC_MATH_H */ 40 | -------------------------------------------------------------------------------- /core/minute-ia/mpu.c: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2013 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 | /* MPU module for ISH */ 7 | 8 | #include "mpu.h" 9 | #include "console.h" 10 | #include "registers.h" 11 | #include "task.h" 12 | #include "util.h" 13 | 14 | int mpu_pre_init(void) 15 | { 16 | return EC_SUCCESS; 17 | } 18 | -------------------------------------------------------------------------------- /core/nds32/build.mk: -------------------------------------------------------------------------------- 1 | # -*- makefile -*- 2 | # Copyright (c) 2013 The Chromium OS Authors. All rights reserved. 3 | # Use of this source code is governed by a BSD-style license that can be 4 | # found in the LICENSE file. 5 | # 6 | # Andestar v3m architecture core OS files build 7 | # 8 | 9 | # Select Andes bare-metal toolchain 10 | CROSS_COMPILE?=nds32le-cros-elf- 11 | 12 | # CPU specific compilation flags 13 | CFLAGS_CPU+=-march=v3m -Os 14 | 15 | core-y=cpu.o init.o panic.o task.o switch.o __muldi3.o math.o 16 | -------------------------------------------------------------------------------- /core/nds32/config_core.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2013 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 | #ifndef __CROS_EC_CONFIG_CORE_H 7 | #define __CROS_EC_CONFIG_CORE_H 8 | 9 | /* Linker binary architecture and format */ 10 | #define BFD_ARCH nds32 11 | #define BFD_FORMAT "elf32-nds32le" 12 | 13 | #define CONFIG_SOFTWARE_PANIC 14 | 15 | /* 16 | * The Andestar v3m architecture has no CLZ instruction (contrary to v3), 17 | * so let's use the software implementation. 18 | */ 19 | #define CONFIG_SOFTWARE_CLZ 20 | 21 | #endif /* __CROS_EC_CONFIG_CORE_H */ 22 | -------------------------------------------------------------------------------- /core/nds32/cpu.c: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2013 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 | * Set up the N8 core 6 | */ 7 | 8 | #include "cpu.h" 9 | #include "registers.h" 10 | 11 | void cpu_init(void) 12 | { 13 | /* DLM initialization is done in init.S */ 14 | /* Global interrupt enable */ 15 | asm volatile ("setgie.e"); 16 | } 17 | -------------------------------------------------------------------------------- /core/nds32/include/math.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2017 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 | /* Math utility functions for N8 */ 7 | 8 | #ifndef __CROS_EC_MATH_H 9 | #define __CROS_EC_MATH_H 10 | 11 | float sqrtf(float x); 12 | float fabsf(float x); 13 | 14 | #endif /* __CROS_EC_MATH_H */ 15 | -------------------------------------------------------------------------------- /cts/README: -------------------------------------------------------------------------------- 1 | The first time you use this with a particular th, 2 | connect only th and run ./cts/cts.py --th from 3 | the ec directory. 4 | 5 | Then connect both boards and you can run 6 | ./cts/cts to flash both boards. -------------------------------------------------------------------------------- /cts/build.mk: -------------------------------------------------------------------------------- 1 | # -*- makefile -*- 2 | # Copyright 2016 The Chromium OS Authors. All rights reserved. 3 | # Use of this source code is governed by a BSD-style license that can be 4 | # found in the LICENSE file. 5 | 6 | CFLAGS_CTS=-DCTS_MODULE -DCTS_TASKFILE=cts.tasklist 7 | 8 | ifeq "$(CTS_MODULE)" "gpio" 9 | CFLAGS_CTS+=-DCTS_MODULE_GPIO 10 | endif 11 | 12 | ifeq "$(CTS_MODULE)" "i2c" 13 | CFLAGS_CTS+=-DCTS_MODULE_I2C 14 | CONFIG_I2C=y 15 | ifneq ($(BOARD),stm32l476g-eval) 16 | CONFIG_I2C_MASTER=y 17 | endif 18 | endif 19 | 20 | ifeq ($(BOARD),stm32l476g-eval) 21 | cts-y+=$(CTS_MODULE)/th.o 22 | cts-y+=common/th_common.o 23 | else 24 | cts-y+=$(CTS_MODULE)/dut.o 25 | cts-y+=common/dut_common.o 26 | endif -------------------------------------------------------------------------------- /cts/common/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MrChromebox/chrome-ec/a3f152f1b2e9fcd00c7871cc44285cba554ae966/cts/common/__init__.py -------------------------------------------------------------------------------- /cts/common/cts.rc: -------------------------------------------------------------------------------- 1 | /* Copyright 2016 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 | /* 7 | * This file is included by cts_common.h as an enumeration of error codes, 8 | * as well as being processed by cts.py to get error code names. 9 | * cts.py depends on CTS_RC_SUCCESS being the first error code listed so 10 | * that its value 11 | * is 0 when enumerated 12 | */ 13 | 14 | CTS_RC_SUCCESS, 15 | CTS_RC_FAILURE, 16 | CTS_RC_BAD_SYNC, 17 | CTS_RC_TIMEOUT, 18 | -------------------------------------------------------------------------------- /cts/common/cts_testlist.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2016 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 | struct cts_test { 7 | enum cts_rc (*run)(void); 8 | char *name; 9 | }; 10 | 11 | #define CTS_TEST(test) {test, STRINGIFY(test)}, 12 | struct cts_test tests[] = { 13 | #include "cts.testlist" 14 | }; 15 | 16 | #undef CTS_TEST 17 | #define CTS_TEST(test) CTS_TEST_ID_##test, 18 | enum { 19 | #include "cts.testlist" 20 | CTS_TEST_ID_COUNT, 21 | }; 22 | -------------------------------------------------------------------------------- /cts/common/dut_common.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2016 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 | #ifndef __DUT_COMMON_H 7 | #define __DUT_COMMON_H 8 | 9 | #include "cts_common.h" 10 | 11 | enum cts_rc sync(void); 12 | 13 | #endif 14 | -------------------------------------------------------------------------------- /cts/common/th_common.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2016 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 | #ifndef __TH_COMMON_H 7 | #define __TH_COMMON_H 8 | 9 | #include "cts_common.h" 10 | 11 | enum cts_rc sync(void); 12 | 13 | #endif 14 | -------------------------------------------------------------------------------- /cts/cts.tasklist: -------------------------------------------------------------------------------- 1 | /* Copyright 2016 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 | /** 7 | * List of enabled tasks in the priority order 8 | * 9 | * The first one has the lowest priority. 10 | * 11 | * For each task, use the macro TASK_ALWAYS(n, r, d, s) for base tasks and 12 | * TASK_NOTEST(n, r, d, s) for tasks that can be excluded in test binaries, 13 | * where : 14 | * 'n' in the name of the task 15 | * 'r' in the main routine of the task 16 | * 'd' in an opaque parameter passed to the routine at startup 17 | * 's' is the stack size in bytes; must be a multiple of 8 18 | */ 19 | 20 | /* Default task list for suites which don't define its own */ 21 | #define CONFIG_CTS_TASK_LIST \ 22 | TASK_ALWAYS(CTS, cts_task, NULL, TASK_STACK_SIZE) 23 | -------------------------------------------------------------------------------- /cts/gpio/cts.testlist: -------------------------------------------------------------------------------- 1 | /* Copyright 2016 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 | /* Currently tests will execute in the order they are listed here */ 7 | 8 | /* Test whether sync completes successfully */ 9 | CTS_TEST(sync_test) 10 | /* Check if the dut can set a line low */ 11 | CTS_TEST(set_low_test) 12 | /* Check if the dut can set a line high */ 13 | CTS_TEST(set_high_test) 14 | /* Check if the dut can read a line that is low */ 15 | CTS_TEST(read_high_test) 16 | /* Check if the dut can read a line that is high */ 17 | CTS_TEST(read_low_test) 18 | /* Check if the dut reads its true pin level (success) 19 | or its register level when configured as a low open drain output pin */ 20 | CTS_TEST(od_read_high_test) 21 | -------------------------------------------------------------------------------- /cts/i2c/cts.testlist: -------------------------------------------------------------------------------- 1 | /* Copyright 2016 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 | /* Currently tests will execute in the order they are listed here */ 7 | 8 | /* Test whether sync completes successfully */ 9 | CTS_TEST(write8_test) 10 | CTS_TEST(write16_test) 11 | CTS_TEST(write32_test) 12 | CTS_TEST(read8_test) 13 | CTS_TEST(read16_test) 14 | CTS_TEST(read32_test) -------------------------------------------------------------------------------- /cts/i2c/cts_i2c.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2016 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 | enum cts_i2c_packets { 7 | WRITE_8_OFFSET = 0, 8 | WRITE_16_OFFSET = 1, 9 | WRITE_32_OFFSET = 2, 10 | READ_8_OFFSET = 3, 11 | READ_16_OFFSET = 4, 12 | READ_32_OFFSET = 5, 13 | }; 14 | 15 | #define WRITE_8_DATA 0x42 16 | #define WRITE_16_DATA 0x1234 17 | #define WRITE_32_DATA 0xDEADBEEF 18 | #define READ_8_DATA 0x23 19 | #define READ_16_DATA 0xACED 20 | #define READ_32_DATA 0x01ABCDEF 21 | -------------------------------------------------------------------------------- /cts/task/cts.testlist: -------------------------------------------------------------------------------- 1 | /* Copyright 2016 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 | /* 7 | * Test task switching. Task A wakes up B and goes to sleep. Task B wakes 8 | * up C then goes to sleep. Task C wakes up A then goes to sleep. This is 9 | * repeated TEST_COUNT times. It's expected all tasks to run exactly 10 | * TEST_COUNT times. Tick task runs to inject some irregularity. 11 | */ 12 | CTS_TEST(test_task_switch) 13 | 14 | /* 15 | * Test task priority. CTS task wakes up A and C then goes to sleep. Since C 16 | * has a higher priority, C should run first. This should result in C running 17 | * one more time than A (or B). 18 | */ 19 | CTS_TEST(test_task_priority) -------------------------------------------------------------------------------- /cts/task/th.c: -------------------------------------------------------------------------------- 1 | dut.c -------------------------------------------------------------------------------- /cts/timer/cts.testlist: -------------------------------------------------------------------------------- 1 | /* Copyright 2016 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 | /* 7 | * Test timer accuracy 8 | * 9 | * After sync, DUT and TH start counting down one second. After one second, 10 | * DUT raises GPIO level, which triggers an interrupt on TH. TH determines 11 | * whether the test passes or not based on how much more or less time elapsed 12 | * than one second. 13 | * 14 | * Requirements: 15 | * - Sync connection 16 | * - GPIO_OUTPUT connection for sending notification from DUT 17 | * - Calibrated TH timer 18 | */ 19 | CTS_TEST(timer_calibration_test) 20 | -------------------------------------------------------------------------------- /driver/als_isl29035.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2013 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 | * Intersil ILS29035 light sensor driver 6 | */ 7 | 8 | #ifndef __CROS_EC_ALS_ISL29035_H 9 | #define __CROS_EC_ALS_ISL29035_H 10 | 11 | int isl29035_init(void); 12 | int isl29035_read_lux(int *lux, int af); 13 | 14 | #endif /* __CROS_EC_ALS_ISL29035_H */ 15 | -------------------------------------------------------------------------------- /driver/tcpm/anx7688.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2016 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 | /* USB Power delivery port management */ 7 | 8 | #ifndef __CROS_EC_USB_PD_TCPM_ANX7688_H 9 | #define __CROS_EC_USB_PD_TCPM_ANX7688_H 10 | 11 | int anx7688_update_hpd(int port, int level, int irq); 12 | int anx7688_set_dp_pin_mode(int port, int pin_mode); 13 | int anx7688_enable_cable_detection(int port); 14 | int anx7688_set_power_supply_ready(int port); 15 | int anx7688_power_supply_reset(int port); 16 | int anx7688_hpd_disable(int port); 17 | 18 | extern struct tcpm_drv anx7688_tcpm_drv; 19 | extern struct usb_mux_driver anx7688_usb_mux_driver; 20 | 21 | #endif /* __CROS_EC_USB_PD_TCPM_ANX7688_H */ 22 | -------------------------------------------------------------------------------- /driver/temp_sensor/ec_adc.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2015 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 | /* ec_adc which uses adc and thermistors module for Chrome EC 7 | * Some EC has it's own ADC modules, define here EC's max ADC channels. 8 | * We can consider every channel as a thermal sensor. 9 | */ 10 | 11 | #ifndef __CROS_EC_TEMP_SENSOR_EC_ADC_H 12 | #define __CROS_EC_TEMP_SENSOR_EC_ADC_H 13 | 14 | /** 15 | * Get the latest value from the sensor. 16 | * 17 | * @param idx ADC channel to read. 18 | * @param temp_ptr Destination for temperature in K. 19 | * 20 | * @return EC_SUCCESS if successful, non-zero if error. 21 | */ 22 | int ec_adc_get_val(int idx, int *temp_ptr); 23 | 24 | #endif /* __CROS_EC_TEMP_SENSOR_EC_ADC_H */ 25 | -------------------------------------------------------------------------------- /driver/temp_sensor/tmp112.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2016 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 | #ifndef __CROS_EC_TMP112_H 7 | #define __CROS_EC_TMP112_H 8 | 9 | #include "i2c.h" 10 | 11 | #define TMP112_I2C_ADDR 0x90 | I2C_FLAG_BIG_ENDIAN 12 | 13 | #define TMP112_REG_TEMP 0x00 14 | #define TMP112_REG_CONF 0x01 15 | #define TMP112_REG_HYST 0x02 16 | #define TMP112_REG_MAX 0x03 17 | 18 | /** 19 | * Get the last polled value of a sensor. 20 | * 21 | * @param idx Index to read. (Ignored) 22 | * 23 | * @param temp_ptr Destination for temperature in K. 24 | * 25 | * @return EC_SUCCESS if successful, non-zero if error. 26 | */ 27 | int tmp112_get_val(int idx, int *temp_ptr); 28 | 29 | #endif /* __CROS_EC_TMP112_H */ 30 | -------------------------------------------------------------------------------- /driver/touchpad_elan.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2016 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 | /* Elan touchpad driver for Chrome EC */ 7 | 8 | #ifndef __CROS_EC_TOUCHPAD_ELAN_H 9 | #define __CROS_EC_TOUCHPAD_ELAN_H 10 | 11 | void elan_tp_interrupt(enum gpio_signal signal); 12 | 13 | #endif 14 | -------------------------------------------------------------------------------- /extra/README: -------------------------------------------------------------------------------- 1 | 2 | This directory is for experiments only. It is not built automatically, 3 | required, supported, guaranteed to work, or necessarily well-documented. 4 | 5 | The contents may change without warning at any time. 6 | -------------------------------------------------------------------------------- /extra/ftdi_hostcmd/.gitignore: -------------------------------------------------------------------------------- 1 | test_cmds 2 | -------------------------------------------------------------------------------- /extra/ftdi_hostcmd/README: -------------------------------------------------------------------------------- 1 | 2 | Ubuntu Trusty uses an ancient version of libftdi. 3 | 4 | You'll probably want to grab the latest libftdi1-1.2.tar.bz2 from 5 | http://www.intra2net.com/en/developer/libftdi/ and install it into /usr 6 | instead. 7 | -------------------------------------------------------------------------------- /extra/lightbar/.gitignore: -------------------------------------------------------------------------------- 1 | lightbar 2 | -------------------------------------------------------------------------------- /extra/lightbar/Makefile: -------------------------------------------------------------------------------- 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 | PROG= lightbar 6 | HEADERS= simulation.h 7 | SRCS= main.c windows.c input.c ../../common/lightbar.c 8 | 9 | # comment this out if you don't have libreadline installed 10 | HAS_GNU_READLINE=1 11 | 12 | INCLUDE= -I. -I../../include 13 | CFLAGS= -g -Wall -Werror -pthread ${INCLUDE} -DLIGHTBAR_SIMULATION 14 | LDFLAGS = -lX11 -lxcb -lrt 15 | 16 | ifneq ($(HAS_GNU_READLINE),) 17 | CFLAGS += -DHAS_GNU_READLINE 18 | LDFLAGS += -lreadline 19 | endif 20 | 21 | all: ${PROG} 22 | 23 | ${PROG} : ${SRCS} ${HEADERS} Makefile 24 | gcc ${CFLAGS} ${SRCS} ${LDFLAGS} -o ${PROG} 25 | 26 | .PHONY: clean 27 | clean: 28 | rm -f ${PROG} 29 | -------------------------------------------------------------------------------- /extra/lightbar/programs/bad-decode-32.bin: -------------------------------------------------------------------------------- 1 | UUU -------------------------------------------------------------------------------- /extra/lightbar/programs/bad-decode-8.bin: -------------------------------------------------------------------------------- 1 |  -------------------------------------------------------------------------------- /extra/lightbar/programs/bad-jump.bin: -------------------------------------------------------------------------------- 1 | ? -------------------------------------------------------------------------------- /extra/lightbar/programs/bad-opcode.bin: -------------------------------------------------------------------------------- 1 | � -------------------------------------------------------------------------------- /extra/lightbar/programs/green-pulse.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MrChromebox/chrome-ec/a3f152f1b2e9fcd00c7871cc44285cba554ae966/extra/lightbar/programs/green-pulse.bin -------------------------------------------------------------------------------- /extra/lightbar/programs/green-pulse.lbs: -------------------------------------------------------------------------------- 1 | set.1 {0,1,2,3}.end.g 0xff 2 | delay.r 7813 3 | delay.w 2000000 4 | L0001: on 5 | cycle.1 6 | off 7 | wait 8 | jump L0001 9 | -------------------------------------------------------------------------------- /extra/lightbar/programs/infinite-jump.bin: -------------------------------------------------------------------------------- 1 |  -------------------------------------------------------------------------------- /extra/lightbar/programs/infinite-jump.lbs: -------------------------------------------------------------------------------- 1 | L0001: jump L0001 2 | -------------------------------------------------------------------------------- /extra/lightbar/programs/konami.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MrChromebox/chrome-ec/a3f152f1b2e9fcd00c7871cc44285cba554ae966/extra/lightbar/programs/konami.bin -------------------------------------------------------------------------------- /extra/lightbar/programs/rainbow-shift.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MrChromebox/chrome-ec/a3f152f1b2e9fcd00c7871cc44285cba554ae966/extra/lightbar/programs/rainbow-shift.bin -------------------------------------------------------------------------------- /extra/lightbar/programs/rainbow-shift.lbs: -------------------------------------------------------------------------------- 1 | # The rainbow cycle program. 2 | set.rgb {0,1,2,3}.end 0xff 0xff 0xff 3 | set.rgb {0}.phase 0x00 0x55 0xaa 4 | set.rgb {1}.phase 0x40 0x95 0xea 5 | set.rgb {2}.phase 0x80 0xd5 0x2a 6 | set.rgb {3}.phase 0xc0 0x15 0x6a 7 | delay.r 7813 8 | cycle 9 | -------------------------------------------------------------------------------- /extra/lightbar/programs/red-green-blink.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MrChromebox/chrome-ec/a3f152f1b2e9fcd00c7871cc44285cba554ae966/extra/lightbar/programs/red-green-blink.bin -------------------------------------------------------------------------------- /extra/lightbar/programs/red-green-blink.lbs: -------------------------------------------------------------------------------- 1 | # Blinks red and green with 1 second pauses. 2 | set.rgb {0,1,2,3}.beg 0xff 0x00 0x00 3 | set.rgb {0,1,2,3}.end 0x00 0xff 0x00 4 | delay.w 250000 5 | delay.r 0 6 | cycle.1 7 | wait 8 | ramp.1 9 | wait 10 | cycle.1 11 | wait 12 | ramp.1 13 | wait 14 | halt 15 | -------------------------------------------------------------------------------- /extra/lightbar/programs/s0.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MrChromebox/chrome-ec/a3f152f1b2e9fcd00c7871cc44285cba554ae966/extra/lightbar/programs/s0.bin -------------------------------------------------------------------------------- /extra/lightbar/programs/s0.lbs: -------------------------------------------------------------------------------- 1 | # S0 sequence: Google colors, unless battery is low. 2 | set.rgb {0}.end 0x33 0x69 0xe8 3 | set.rgb {1}.end 0xd5 0x0f 0x25 4 | set.rgb {2}.end 0xee 0xb2 0x11 5 | set.rgb {3}.end 0x00 0x99 0x25 6 | delay.r 1250 7 | ramp.1 8 | set.1 {0,1,2,3}.beg.r 0xff 9 | delay.r 2500 10 | delay.w 1000000 11 | wait 12 | jump L0003 13 | L0001: swap 14 | ramp.1 15 | L0002: wait 16 | L0003: jbat L0004 L0002 17 | jump L0002 18 | L0004: swap 19 | ramp.1 20 | L0005: wait 21 | jbat L0005 L0001 22 | jump L0001 23 | -------------------------------------------------------------------------------- /extra/lightbar/programs/s0s3.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MrChromebox/chrome-ec/a3f152f1b2e9fcd00c7871cc44285cba554ae966/extra/lightbar/programs/s0s3.bin -------------------------------------------------------------------------------- /extra/lightbar/programs/s0s3.lbs: -------------------------------------------------------------------------------- 1 | # S0S3 sequence: Fade out, Google color ramp up/down. 2 | get 3 | delay.r 2000 4 | ramp.1 5 | swap 6 | set.rgb {0}.end 0x33 0x69 0xe8 7 | set.rgb {1}.end 0xd5 0x0f 0x25 8 | set.rgb {2}.end 0xee 0xb2 0x11 9 | set.rgb {3}.end 0x00 0x99 0x25 10 | delay.r 1250 11 | ramp.1 12 | swap 13 | delay.r 10000 14 | ramp.1 15 | off 16 | halt 17 | -------------------------------------------------------------------------------- /extra/lightbar/programs/s3.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MrChromebox/chrome-ec/a3f152f1b2e9fcd00c7871cc44285cba554ae966/extra/lightbar/programs/s3.bin -------------------------------------------------------------------------------- /extra/lightbar/programs/s3.lbs: -------------------------------------------------------------------------------- 1 | # S3 sequence: Pulse red on low battery. 2 | set.rgb {0,1,2,3}.end 0xff 0x00 0x00 3 | cycle.1 4 | delay.w 5000000 5 | L0001: off 6 | wait 7 | jcharge L0001 8 | jbat L0002 L0001 9 | jump L0001 10 | L0002: on 11 | delay.r 1250 12 | ramp.1 13 | swap 14 | delay.r 10000 15 | ramp.1 16 | swap 17 | jump L0001 18 | -------------------------------------------------------------------------------- /extra/lightbar/programs/s3s0.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MrChromebox/chrome-ec/a3f152f1b2e9fcd00c7871cc44285cba554ae966/extra/lightbar/programs/s3s0.bin -------------------------------------------------------------------------------- /extra/lightbar/programs/s3s0.lbs: -------------------------------------------------------------------------------- 1 | # S3S0 sequence: Google color ramp up/down. 2 | set.rgb {0}.end 0x33 0x69 0xe8 3 | set.rgb {1}.end 0xd5 0x0f 0x25 4 | set.rgb {2}.end 0xee 0xb2 0x11 5 | set.rgb {3}.end 0x00 0x99 0x25 6 | delay.r 1250 7 | ramp.1 8 | swap 9 | delay.r 10000 10 | ramp.1 11 | halt 12 | -------------------------------------------------------------------------------- /extra/sps_errs/.gitignore: -------------------------------------------------------------------------------- 1 | prog 2 | -------------------------------------------------------------------------------- /extra/sps_errs/README: -------------------------------------------------------------------------------- 1 | SETUP: 2 | 3 | Attach an EC to the build host using an FTDI USB-to-SPI adapter. 4 | 5 | BUILD: 6 | 7 | make 8 | ./prog 9 | 10 | 11 | USAGE: 12 | 13 | Usage: ./prog [-v] [-c BYTES] 14 | 15 | This sends a EC_CMD_HELLO host command. The -c option can 16 | be used to truncate the exchange early, to see how the EC 17 | deals with the interruption. 18 | 19 | NOTE: 20 | 21 | Ubuntu Trusty uses an ancient version of libftdi. 22 | 23 | If building outside of the Chromium chroot, you'll probably want to grab the 24 | latest libftdi1-1.2.tar.bz2 from 25 | 26 | http://www.intra2net.com/en/developer/libftdi/ 27 | 28 | and install it into /usr instead. 29 | -------------------------------------------------------------------------------- /extra/usb_console/.gitignore: -------------------------------------------------------------------------------- 1 | usb_console 2 | -------------------------------------------------------------------------------- /extra/usb_gpio/.gitignore: -------------------------------------------------------------------------------- 1 | usb_gpio 2 | -------------------------------------------------------------------------------- /extra/usb_power/board/kevin/kevin_all.scenario: -------------------------------------------------------------------------------- 1 | [ 2 | "pp5000", 3 | "ppvar_gpu", 4 | "pp3300_wifi_bt", 5 | "pp1500_ap_io", 6 | "pp3300_alw", 7 | "ppvar_litcpu", 8 | "pp1800_s0", 9 | "pp3300_haven", 10 | "ppvar_bigcpu", 11 | "pp900_ap", 12 | "pp1800_ec", 13 | "pp1800_sensor", 14 | "pp1800_alw", 15 | "pp1200_lpddr", 16 | "pp3300_ec", 17 | "pp3300_s0" 18 | ] 19 | -------------------------------------------------------------------------------- /extra/usb_power/board/marlin/marlin_all_A.scenario: -------------------------------------------------------------------------------- 1 | [ "VBAT", 2 | "VDD_MEM", 3 | "VDD_EBI_PHY", 4 | "VDD_PCIE_1P8", 5 | "VDD_PCIE_CORE", 6 | "VDD_MIPI_CSI", 7 | "VDD_A1", 8 | "VDD_A2", 9 | "VDD_P2", 10 | "VDD_P5", 11 | "VDD_P6", 12 | "VDD_P10", 13 | "VDD_P12", 14 | "VDD_USB_HS_3P1", 15 | "VDD_CORE", 16 | "VDD_GFX", 17 | "VDD_MODEM", 18 | "VDD_APC", 19 | "VDD_P1", 20 | "VDD_SSC_CORE", 21 | "VDD_SSC_MEM", 22 | "V_EMMC_2V95", 23 | "V_LED_3V3", 24 | "V_SR_2V85", 25 | "V_USBSS_SW_1V8", 26 | "V_RF_2V7", 27 | "V_TP_3V3", 28 | "VCI_3V", 29 | "VDD_1V8_PANEL", 30 | "V_TP_1V8", 31 | "V_CAM2_D1V2", 32 | "V_CAMIO_1V8", 33 | "V_CAM1_D1V0", 34 | "VBAT_ADC_IN", 35 | "VDD_MIC_BIAS", 36 | "PVDD/VDD", 37 | "V_DCIN", 38 | "V_AUDIO_2V15", 39 | "V_AUDIO_1V3", 40 | "VDD_RF1_TVCO", 41 | "V_GPS_1V8", 42 | "VDD_FEM"] 43 | -------------------------------------------------------------------------------- /extra/usb_power/board/marlin/marlin_all_B.scenario: -------------------------------------------------------------------------------- 1 | [ "VBAT_", 2 | "VDD_P3", 3 | "VDD_DDR_CORE_1P8", 4 | "VCCQ2", 5 | "VDD/VDDIO", 6 | "VDD/VIO", 7 | "V_SRIO_1V8", 8 | "V_SRIO_1V8_", 9 | "VBAT/VDD/VDDA", 10 | "V_SRIO_1V8__", 11 | "", 12 | "V_ELVDD", 13 | "V_AVDD", 14 | "V_CAM1_VCM2V85", 15 | "V_CAM1_A2V85", 16 | "V_CAMIO_1V8_", 17 | "VDD_RX", 18 | "VBATT", 19 | "VCC_GSM", 20 | "VCC1_3G", 21 | "VAPT", 22 | "VCC1", 23 | "VPA_BATT", 24 | "VDD33", 25 | "DVDD11", 26 | "VDD(PAD)", 27 | "VBAT/VBAT2/VDD(UP)", 28 | "NFC_5V_BOOST" ] 29 | -------------------------------------------------------------------------------- /extra/usb_power/board/marlin/marlin_common.scenario: -------------------------------------------------------------------------------- 1 | ["VBAT", "VDD_MEM", "VDD_EBI_PHY", "VDD_PCIE_1P8", "VDD_PCIE_CORE", "VDD_MIPI_CSI", "VDD_A1", "VDD_CORE", "VDD_GFX", "VDD_MODEM", "VDD_APC", "VDD_P1", "VDD_SSC_CORE", "VDD_SSC_MEM", "VDD_1V8_PANEL", "V_CAM2_D1V2", "VBAT_ADC_IN", "VDD_FEM"] 2 | -------------------------------------------------------------------------------- /extra/usb_power/board/marlin/marlin_short.scenario: -------------------------------------------------------------------------------- 1 | ["VBAT", "VDD_MEM", "VDD_CORE", "VDD_GFX", "VDD_1V8_PANEL"] 2 | -------------------------------------------------------------------------------- /extra/usb_power/board/marlin/marlin_vbat.scenario: -------------------------------------------------------------------------------- 1 | ["VBAT"] 2 | -------------------------------------------------------------------------------- /extra/usb_serial/.gitignore: -------------------------------------------------------------------------------- 1 | .built-in.o.cmd 2 | .raiden.ko.cmd 3 | .raiden.mod.o.cmd 4 | .raiden.o.cmd 5 | .tmp_versions/ 6 | Module.symvers 7 | built-in.o 8 | modules.order 9 | raiden.ko 10 | raiden.mod.c 11 | raiden.mod.o 12 | raiden.o 13 | -------------------------------------------------------------------------------- /extra/usb_serial/51-google-serial-fallback.rules: -------------------------------------------------------------------------------- 1 | # 2 | # Add USB VID/PID for usb-serial compatible CCD devices. This is a fallback 3 | # rule that can be used if the raiden module can't be built, or used for some 4 | # reason. 5 | # 6 | SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", ATTR{idVendor}=="18d1", ENV{ID_USB_INTERFACES}=="*:ff5001:*", RUN+="add_usb_serial_id $attr{idVendor} $attr{idProduct}" 7 | -------------------------------------------------------------------------------- /extra/usb_serial/Makefile: -------------------------------------------------------------------------------- 1 | obj-m := raiden.o 2 | 3 | .PHONY: all 4 | 5 | all: modules 6 | 7 | .DEFAULT: 8 | $(MAKE) -C /lib/modules/$(shell uname -r)/build \ 9 | M=$(shell pwd) \ 10 | $(MAKECMDGOALS) 11 | -------------------------------------------------------------------------------- /extra/usb_serial/README.md: -------------------------------------------------------------------------------- 1 | Case Closed Debugging Serial Consoles over USB 2 | ============================================== 3 | 4 | Please see the documentation in `../../docs/case_closed_debugging.md`. 5 | -------------------------------------------------------------------------------- /extra/usb_updater/.gitignore: -------------------------------------------------------------------------------- 1 | usb_updater 2 | -------------------------------------------------------------------------------- /extra/usb_updater/servo_micro.json: -------------------------------------------------------------------------------- 1 | { 2 | "Comment": "This file describes the updateable sections of the flash.", 3 | "board": "servo micro", 4 | "vid": "0x18d1", 5 | "pid": "0x501a", 6 | "Comment on flash": "This is the base address of writeable flash", 7 | "flash": "0x8000000", 8 | "Comment on region format": "name: [baseoffset, length]", 9 | "regions": { 10 | "RW": ["0x10000", "0x10000"], 11 | "PSTATE": ["0xf000", "0x1000"], 12 | "RO": ["0x0000", "0xf000"] 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /extra/usb_updater/servo_v4.json: -------------------------------------------------------------------------------- 1 | { 2 | "Comment": "This file describes the updateable sections of the flash.", 3 | "board": "servo v4", 4 | "vid": "0x18d1", 5 | "pid": "0x501b", 6 | "Comment on flash": "This is the base address of writeable flash", 7 | "flash": "0x8000000", 8 | "Comment on region format": "name: [baseoffset, length]", 9 | "regions": { 10 | "RW": ["0x10000", "0x10000"], 11 | "PSTATE": ["0xf000", "0x1000"], 12 | "RO": ["0x0000", "0xf000"] 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /extra/usb_updater/sweetberry.json: -------------------------------------------------------------------------------- 1 | { 2 | "Comment": "This file describes the updateable sections of the flash.", 3 | "board": "sweetberry", 4 | "vid": "0x18d1", 5 | "pid": "0x5020", 6 | "Comment on flash": "This is the base address of writeable flash", 7 | "flash": "0x8000000", 8 | "Comment on region format": "name: [baseoffset, length]", 9 | "regions": { 10 | "RW": ["0x10000", "0x10000"], 11 | "PSTATE": ["0xc000", "0x4000"], 12 | "RO": ["0x0000", "0xc000"] 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /include/acpi.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2013 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 | /* ACPI EC interface block. */ 7 | 8 | #ifndef __CROS_EC_ACPI_H 9 | #define __CROS_EC_ACPI_H 10 | 11 | #include 12 | 13 | /** 14 | * Handle AP write to EC via the ACPI I/O port. 15 | * 16 | * @param is_cmd Is write command (is_cmd=1) or data (is_cmd=0) 17 | * @param value Value written to cmd or data register by AP 18 | * @param result Value for AP to read from data port, if any 19 | * @return True if *result was updated by this call 20 | */ 21 | int acpi_ap_to_ec(int is_cmd, uint8_t value, uint8_t *result); 22 | 23 | #endif /* __CROS_EC_ACPI_H */ 24 | -------------------------------------------------------------------------------- /include/ap_hang_detect.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2013 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 | /* Power button API for Chrome EC */ 7 | 8 | #ifndef __CROS_EC_AP_HANG_DETECT_H 9 | #define __CROS_EC_AP_HANG_DETECT_H 10 | 11 | #include "common.h" 12 | 13 | /** 14 | * If the hang detect timers were started and can be stopped by any host 15 | * command, stop them. This is intended to be called by the the host command 16 | * module. 17 | */ 18 | void hang_detect_stop_on_host_command(void); 19 | 20 | #endif /* __CROS_EC_AP_HANG_DETECT_H */ 21 | -------------------------------------------------------------------------------- /include/backlight.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2013 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 | /* Backlight API for Chrome EC */ 7 | 8 | #ifndef __CROS_EC_BACKLIGHT_H 9 | #define __CROS_EC_BACKLIGHT_H 10 | 11 | #include "common.h" 12 | #include "gpio.h" 13 | 14 | /** 15 | * Interrupt handler for backlight. 16 | * 17 | * @param signal Signal which triggered the interrupt. 18 | */ 19 | #ifdef CONFIG_BACKLIGHT_REQ_GPIO 20 | void backlight_interrupt(enum gpio_signal signal); 21 | #else 22 | static inline void backlight_interrupt(enum gpio_signal signal) { } 23 | #endif /* !CONFIG_BACKLIGHT_REQ_GPIO */ 24 | 25 | #endif /* __CROS_EC_BACKLIGHT_H */ 26 | -------------------------------------------------------------------------------- /include/battery_bq27621_g1.h: -------------------------------------------------------------------------------- 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 | * Battery driver for BQ27621-G1 6 | */ 7 | 8 | /* Sets percent to the battery life as a percentage (0-100) 9 | * 10 | * Returns EC_SUCCESS on success. 11 | */ 12 | int bq27621_state_of_charge(int *percent); 13 | 14 | /* Initializes the fuel gauge with the constants for the battery. 15 | * 16 | * Returns EC_SUCCESS on success. 17 | */ 18 | int bq27621_init(void); 19 | 20 | -------------------------------------------------------------------------------- /include/byteorder.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2015 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 | #ifndef __EC_INCLUDE_BYTEORDER_H 7 | #define __EC_INCLUDE_BYTEORDER_H 8 | 9 | #include 10 | 11 | #endif /* __EC_INCLUDE_BYTEORDER_H */ 12 | -------------------------------------------------------------------------------- /include/capsense.h: -------------------------------------------------------------------------------- 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 | #ifndef __CROS_EC_CAPSENSE_H 7 | #define __CROS_EC_CAPSENSE_H 8 | 9 | #include "common.h" 10 | #include "gpio.h" 11 | 12 | void capsense_interrupt(enum gpio_signal signal); 13 | 14 | #endif /* __CROS_EC_CAPSENSE_H */ 15 | -------------------------------------------------------------------------------- /include/charger_detect.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2016 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 | /* Detect what adapter is connected */ 6 | 7 | #ifndef __CROS_CHARGER_DETECT_H 8 | #define __CROS_CHARGER_DETECT_H 9 | 10 | /* 11 | * Get attached device type. 12 | * 13 | * @return CHARGE_SUPPLIER_BC12_* or 0 if the device type was not detected 14 | */ 15 | int charger_detect_get_device_type(void); 16 | 17 | #endif /* __CROS_CHARGER_DETECT_H */ 18 | -------------------------------------------------------------------------------- /include/crc.h: -------------------------------------------------------------------------------- 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 | #ifndef __CROS_EC_CRC_H 7 | #define __CROS_EC_CRC_H 8 | /* CRC-32 implementation with USB constants */ 9 | /* Note: it's a stateful CRC-32 to match the hardware block interface */ 10 | 11 | #ifdef CONFIG_HW_CRC 12 | #include "crc_hw.h" 13 | #else 14 | 15 | /* Use software implementation */ 16 | 17 | void crc32_init(void); 18 | 19 | void crc32_hash32(uint32_t val); 20 | 21 | void crc32_hash16(uint16_t val); 22 | 23 | uint32_t crc32_result(void); 24 | 25 | #endif /* CONFIG_HW_CRC */ 26 | 27 | #endif /* __CROS_EC_CRC_H */ 28 | -------------------------------------------------------------------------------- /include/extpower.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2013 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 | /* External power detection API for Chrome EC */ 7 | 8 | #ifndef __CROS_EC_EXTPOWER_H 9 | #define __CROS_EC_EXTPOWER_H 10 | 11 | #include "common.h" 12 | 13 | /** 14 | * Return non-zero if external power is present. 15 | */ 16 | int extpower_is_present(void); 17 | 18 | /** 19 | * Interrupt handler for external power GPIOs. 20 | * 21 | * @param signal Signal which triggered the interrupt. 22 | */ 23 | void extpower_interrupt(enum gpio_signal signal); 24 | 25 | #endif /* __CROS_EC_EXTPOWER_H */ 26 | -------------------------------------------------------------------------------- /include/gpio_signal.h: -------------------------------------------------------------------------------- 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 | #ifndef __CROS_EC_GPIO_SIGNAL_H 7 | #define __CROS_EC_GPIO_SIGNAL_H 8 | 9 | #define GPIO(name, pin, flags) GPIO_##name, 10 | #define UNIMPLEMENTED(name) GPIO_##name, 11 | #define GPIO_INT(name, pin, flags, signal) GPIO_##name, 12 | 13 | enum gpio_signal { 14 | #include "gpio.wrap" 15 | GPIO_COUNT 16 | }; 17 | 18 | #endif /* __CROS_EC_GPIO_SIGNAL_H */ 19 | -------------------------------------------------------------------------------- /include/inductive_charging.h: -------------------------------------------------------------------------------- 1 | /* Copyright 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 | /* Inductive charging control */ 7 | 8 | #include "gpio.h" 9 | 10 | #ifndef __CROS_EC_INDUCTIVE_CHARGING_H 11 | #define __CROS_EC_INDUCTIVE_CHARGING_H 12 | 13 | /* 14 | * Interrupt handler for inductive charging signal. 15 | * 16 | * @param signal Signal which triggered the interrupt. 17 | */ 18 | void inductive_charging_interrupt(enum gpio_signal); 19 | 20 | #endif 21 | -------------------------------------------------------------------------------- /include/jtag.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2012 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 | /* JTAG interface for Chrome EC */ 7 | 8 | #ifndef __CROS_EC_JTAG_H 9 | #define __CROS_EC_JTAG_H 10 | 11 | #include "common.h" 12 | #include "gpio.h" 13 | 14 | /** 15 | * Pre-initialize the JTAG module. 16 | */ 17 | void jtag_pre_init(void); 18 | 19 | #ifdef CONFIG_LOW_POWER_IDLE 20 | /** 21 | * Interrupt handler for JTAG clock. 22 | * 23 | * @param signal Signal which triggered the interrupt. 24 | */ 25 | void jtag_interrupt(enum gpio_signal signal); 26 | #else 27 | static inline void jtag_interrupt(enum gpio_signal signal) { } 28 | #endif /* !CONFIG_LOW_POWER_IDLE */ 29 | 30 | #endif /* __CROS_EC_JTAG_H */ 31 | -------------------------------------------------------------------------------- /include/lid_switch.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2013 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 | /* Lid switch API for Chrome EC */ 7 | 8 | #ifndef __CROS_EC_LID_SWITCH_H 9 | #define __CROS_EC_LID_SWITCH_H 10 | 11 | #include "common.h" 12 | 13 | /** 14 | * Return non-zero if lid is open. 15 | * 16 | * Uses the debounced lid state, not the raw signal from the GPIO. 17 | */ 18 | int lid_is_open(void); 19 | 20 | /** 21 | * Interrupt handler for lid switch. 22 | * 23 | * @param signal Signal which triggered the interrupt. 24 | */ 25 | void lid_interrupt(enum gpio_signal signal); 26 | 27 | #endif /* __CROS_EC_LID_SWITCH_H */ 28 | -------------------------------------------------------------------------------- /include/lightbar_msg_list.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2012 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 | * This defines a list of lightbar messages. It's done in this odd way so that 6 | * we can automatically derive the correct constants, functions, and message 7 | * types. 8 | */ 9 | #define LIGHTBAR_MSG_LIST \ 10 | LBMSG(ERROR), /* 0 */ \ 11 | LBMSG(S5), /* 1 */ \ 12 | LBMSG(S3), /* 2 */ \ 13 | LBMSG(S0), /* 3 */ \ 14 | LBMSG(S5S3), /* 4 */ \ 15 | LBMSG(S3S0), /* 5 */ \ 16 | LBMSG(S0S3), /* 6 */ \ 17 | LBMSG(S3S5), /* 7 */ \ 18 | LBMSG(STOP), /* 8 */ \ 19 | LBMSG(RUN), /* 9 */ \ 20 | LBMSG(KONAMI), /* A */ \ 21 | LBMSG(TAP), /* B */ \ 22 | LBMSG(PROGRAM), /* C */ 23 | -------------------------------------------------------------------------------- /include/mat44.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2015 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 | /* Header file for common math functions. */ 7 | #ifndef __CROS_EC_MAT_44_H 8 | 9 | #define __CROS_EC_MAT_44_H 10 | 11 | #include "vec4.h" 12 | #include "util.h" 13 | 14 | typedef float mat44_t[4][4]; 15 | typedef size_t size4_t[4]; 16 | 17 | void mat44_decompose_lup(mat44_t LU, size4_t pivot); 18 | 19 | void mat44_swap_rows(mat44_t A, const size_t i, const size_t j); 20 | 21 | void mat44_solve(mat44_t A, vec4_t x, const vec4_t b, const size4_t pivot); 22 | 23 | #endif /* __CROS_EC_MAT_44_H */ 24 | -------------------------------------------------------------------------------- /include/memory_commands.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2011 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 | /* Memory commands for Chrome EC */ 7 | 8 | #ifndef __CROS_EC_MEMORY_COMMANDS_H 9 | #define __CROS_EC_MEMORY_COMMANDS_H 10 | 11 | #include "common.h" 12 | 13 | /* Initializes the module. */ 14 | int memory_commands_init(void); 15 | 16 | #endif /* __CROS_EC_MEMORY_COMMANDS_H */ 17 | -------------------------------------------------------------------------------- /include/power_led.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2013 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 | /* Power button LED control for Chrome EC */ 7 | 8 | #ifndef __CROS_EC_POWER_LED_H 9 | #define __CROS_EC_POWER_LED_H 10 | 11 | #include "common.h" 12 | 13 | enum powerled_state { 14 | POWERLED_STATE_OFF, 15 | POWERLED_STATE_ON, 16 | POWERLED_STATE_SUSPEND, 17 | POWERLED_STATE_COUNT 18 | }; 19 | 20 | #ifdef HAS_TASK_POWERLED 21 | 22 | /** 23 | * Set the power LED 24 | * 25 | * @param state Target state 26 | */ 27 | void powerled_set_state(enum powerled_state state); 28 | 29 | #else 30 | 31 | static inline void powerled_set_state(enum powerled_state state) {} 32 | 33 | #endif 34 | 35 | #endif /* __CROS_EC_POWER_LED_H */ 36 | -------------------------------------------------------------------------------- /include/sha256.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2012 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 | /* SHA-256 functions */ 7 | 8 | #ifndef __CROS_EC_SHA256_H 9 | #define __CROS_EC_SHA256_H 10 | 11 | #include "common.h" 12 | 13 | #define SHA256_DIGEST_SIZE 32 14 | #define SHA256_BLOCK_SIZE 64 15 | 16 | /* SHA256 context */ 17 | struct sha256_ctx { 18 | uint32_t h[8]; 19 | uint32_t tot_len; 20 | uint32_t len; 21 | uint8_t block[2 * SHA256_BLOCK_SIZE]; 22 | uint8_t buf[SHA256_DIGEST_SIZE]; /* Used to store the final digest. */ 23 | }; 24 | 25 | void SHA256_init(struct sha256_ctx *ctx); 26 | void SHA256_update(struct sha256_ctx *ctx, const uint8_t *data, uint32_t len); 27 | uint8_t *SHA256_final(struct sha256_ctx *ctx); 28 | 29 | #endif /* __CROS_EC_SHA256_H */ 30 | -------------------------------------------------------------------------------- /include/stack_trace.h: -------------------------------------------------------------------------------- 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 | /* Trace dump module */ 7 | 8 | #ifndef __CROS_EC_STACK_TRACE_H 9 | #define __CROS_EC_STACK_TRACE_H 10 | 11 | #ifdef EMU_BUILD 12 | /* 13 | * Register trace dump handler for emulator. Trace dump is printed to stderr 14 | * when SIGUSR2 is received. 15 | */ 16 | void task_register_tracedump(void); 17 | 18 | /* Dump current stack trace */ 19 | void task_dump_trace(void); 20 | #else 21 | static inline void task_register_tracedump(void) { } 22 | static inline void task_dump_trace(void) { } 23 | #endif 24 | 25 | #endif /* __CROS_EC_STACK_TRACE_H */ 26 | -------------------------------------------------------------------------------- /include/switch.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2013 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 | /* Switch module for Chrome EC */ 7 | 8 | #ifndef __CROS_EC_SWITCH_H 9 | #define __CROS_EC_SWITCH_H 10 | 11 | #include "common.h" 12 | #include "gpio.h" 13 | 14 | #ifdef CONFIG_SWITCH 15 | /** 16 | * Interrupt handler for switch inputs. 17 | * 18 | * @param signal Signal which triggered the interrupt. 19 | */ 20 | void switch_interrupt(enum gpio_signal signal); 21 | #else 22 | static inline void switch_interrupt(enum gpio_signal signal) { } 23 | #endif /* !CONFIG_SWITCH */ 24 | 25 | #endif /* __CROS_EC_SWITCH_H */ 26 | -------------------------------------------------------------------------------- /include/tablet_mode.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2016 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 | /* Header for tablet_mode.c */ 7 | 8 | /* Return 1 if in tablet mode, 0 otherwise */ 9 | int tablet_get_mode(void); 10 | void tablet_set_mode(int mode); 11 | 12 | 13 | -------------------------------------------------------------------------------- /include/temp_sensor_chip.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2012 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 | /* Temperature sensor module for LM4 chip */ 7 | 8 | #ifndef __CROS_EC_TEMP_SENSOR_CHIP_H 9 | #define __CROS_EC_TEMP_SENSOR_CHIP_H 10 | 11 | /** 12 | * Get the last polled value of the sensor. 13 | * 14 | * @param idx Sensor index to read. 15 | * @param temp_ptr Destination for temperature in K. 16 | * 17 | * @return EC_SUCCESS if successful, non-zero if error. 18 | */ 19 | int chip_temp_sensor_get_val(int idx, int *temp_ptr); 20 | 21 | #endif /* __CROS_EC_TEMP_SENSOR_CHIP_H */ 22 | -------------------------------------------------------------------------------- /include/thermal.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2012 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 | /* Thermal engine module for Chrome EC */ 7 | 8 | #ifndef __CROS_EC_THERMAL_H 9 | #define __CROS_EC_THERMAL_H 10 | 11 | /* The thermal configuration for a single temp sensor is defined here. */ 12 | #include "ec_commands.h" 13 | 14 | /* We need to to hold a config for each board's sensors. Not const, so we can 15 | * tweak it at run-time if we have to. 16 | */ 17 | extern struct ec_thermal_config thermal_params[]; 18 | 19 | /* Helper function to compute percent cooling */ 20 | int thermal_fan_percent(int low, int high, int cur); 21 | 22 | #endif /* __CROS_EC_THERMAL_H */ 23 | -------------------------------------------------------------------------------- /include/tpm_manufacture.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2016 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 | /* 7 | * This header declares the TPM manufacture related interface. 8 | * Individual boards are expected to provide implementations. 9 | */ 10 | 11 | #ifndef __CROS_EC_TPM_MANUFACTURE_H 12 | #define __CROS_EC_TPM_MANUFACTURE_H 13 | 14 | /* Returns non-zero if the TPM manufacture steps have been completed. */ 15 | int tpm_manufactured(void); 16 | int tpm_endorse(void); 17 | 18 | #endif /* __CROS_EC_TPM_MANUFACTURE_H */ 19 | -------------------------------------------------------------------------------- /include/trng.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2015 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 | #ifndef __EC_INCLUDE_TRNG_H 6 | #define __EC_INCLUDE_TRNG_H 7 | 8 | #include 9 | #include 10 | 11 | /** 12 | * Initialize the true random number generator. 13 | * 14 | * Not supported by all platforms. 15 | **/ 16 | void init_trng(void); 17 | 18 | /** 19 | * Retrieve a 32 bit random value. 20 | * 21 | * Not supported on all platforms. 22 | **/ 23 | uint32_t rand(void); 24 | 25 | /** 26 | * Output len random bytes into buffer. 27 | * 28 | * Not supported on all platforms. 29 | **/ 30 | void rand_bytes(void *buffer, size_t len); 31 | 32 | #endif /* __EC_INCLUDE_TRNG_H */ 33 | -------------------------------------------------------------------------------- /include/usb_hid_touchpad.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2016 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 | * USB HID definitions. 6 | */ 7 | 8 | #ifndef __CROS_EC_USB_HID_KEYBOARD_H 9 | #define __CROS_EC_USB_HID_KEYBOARD_H 10 | 11 | struct __attribute__((__packed__)) usb_hid_touchpad_report { 12 | uint8_t id; /* 0x01 */ 13 | struct __attribute__((__packed__)) { 14 | uint8_t tip:1; 15 | uint8_t inrange:1; 16 | uint8_t id:6; 17 | unsigned width:12; 18 | unsigned height:12; 19 | unsigned x:12; 20 | unsigned y:12; 21 | uint8_t pressure; 22 | } finger[5]; 23 | uint8_t count:7; 24 | uint8_t button:1; 25 | }; 26 | 27 | /* class implementation interfaces */ 28 | void set_touchpad_report(struct usb_hid_touchpad_report *report); 29 | 30 | #endif 31 | -------------------------------------------------------------------------------- /include/vec3.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2015 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 | /* Header file for common math functions. */ 7 | #ifndef __CROS_EC_VEC_3_H 8 | #define __CROS_EC_VEC_3_H 9 | 10 | typedef float vec3_t[3]; 11 | 12 | void vec3_scalar_mul(vec3_t v, float c); 13 | float vec3_dot(const vec3_t v, const vec3_t w); 14 | float vec3_norm_squared(const vec3_t v); 15 | float vec3_norm(const vec3_t v); 16 | 17 | #endif /* __CROS_EC_VEC_3_H */ 18 | -------------------------------------------------------------------------------- /include/vec4.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2015 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 | #ifndef __CROS_EC_VEC_4_H 7 | 8 | #define __CROS_EC_VEC_4_H 9 | 10 | typedef float vec4_t[4]; 11 | 12 | #endif /* __CROS_EC_VEC_4_H */ 13 | 14 | -------------------------------------------------------------------------------- /include/version.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2012 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 | /* Version number for Chrome EC */ 7 | 8 | #ifndef __CROS_EC_VERSION_H 9 | #define __CROS_EC_VERSION_H 10 | 11 | #include "common.h" 12 | 13 | #define CROS_EC_VERSION_COOKIE1 0xce112233 14 | #define CROS_EC_VERSION_COOKIE2 0xce445566 15 | 16 | struct version_struct { 17 | uint32_t cookie1; 18 | char version[32]; 19 | uint32_t cookie2; 20 | } __packed; 21 | 22 | extern const struct version_struct version_data; 23 | extern const char build_info[]; 24 | extern const char __version_struct_offset[]; 25 | 26 | /** 27 | * Get the number of commits field from version string. 28 | */ 29 | uint32_t ver_get_numcommits(void); 30 | #endif /* __CROS_EC_VERSION_H */ 31 | -------------------------------------------------------------------------------- /include/wireless.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2013 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 | /* Wireless API for Chrome EC */ 7 | 8 | #ifndef __CROS_EC_WIRELESS_H 9 | #define __CROS_EC_WIRELESS_H 10 | 11 | #include "common.h" 12 | 13 | /* Wireless power state for wireless_set_state() */ 14 | enum wireless_power_state { 15 | WIRELESS_OFF, 16 | WIRELESS_SUSPEND, 17 | WIRELESS_ON 18 | }; 19 | 20 | /** 21 | * Set wireless power state. 22 | */ 23 | #ifdef CONFIG_WIRELESS 24 | void wireless_set_state(enum wireless_power_state state); 25 | #else 26 | static inline void wireless_set_state(enum wireless_power_state state) { } 27 | #endif 28 | 29 | #endif /* __CROS_EC_WIRELESS_H */ 30 | -------------------------------------------------------------------------------- /power/build.mk: -------------------------------------------------------------------------------- 1 | # -*- makefile -*- 2 | # Copyright (c) 2013 The Chromium OS Authors. All rights reserved. 3 | # Use of this source code is governed by a BSD-style license that can be 4 | # found in the LICENSE file. 5 | # 6 | # Power management for application processor and peripherals 7 | # 8 | 9 | power-$(CONFIG_CHIPSET_APOLLOLAKE)+=apollolake.o intel_x86.o 10 | power-$(CONFIG_CHIPSET_BRASWELL)+=braswell.o 11 | power-$(CONFIG_CHIPSET_ECDRIVEN)+=ec_driven.o 12 | power-$(CONFIG_CHIPSET_GAIA)+=gaia.o 13 | power-$(CONFIG_CHIPSET_MEDIATEK)+=mediatek.o 14 | power-$(CONFIG_CHIPSET_RK3399)+=rk3399.o 15 | power-$(CONFIG_CHIPSET_ROCKCHIP)+=rockchip.o 16 | power-$(CONFIG_CHIPSET_SKYLAKE)+=skylake.o intel_x86.o 17 | power-$(CONFIG_CHIPSET_TEGRA)+=tegra.o 18 | power-$(CONFIG_POWER_COMMON)+=common.o 19 | -------------------------------------------------------------------------------- /setup.py: -------------------------------------------------------------------------------- 1 | # Copyright 2015 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 | from setuptools import setup 6 | 7 | setup( 8 | name="ec3po", 9 | version="1.0.0rc1", 10 | author="Aseda Aboagye", 11 | author_email="aaboagye@chromium.org", 12 | url="https://www.chromium.org/chromium-os/ec-development", 13 | package_dir={"" : "util"}, 14 | packages=["ec3po"], 15 | py_modules=["ec3po.console", "ec3po.interpreter"], 16 | description="EC console interpreter.", 17 | ) 18 | -------------------------------------------------------------------------------- /test/battery_get_params_smart.tasklist: -------------------------------------------------------------------------------- 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 | /** 7 | * List of enabled tasks in the priority order 8 | * 9 | * The first one has the lowest priority. 10 | * 11 | * For each task, use the macro TASK_TEST(n, r, d, s) where : 12 | * 'n' in the name of the task 13 | * 'r' in the main routine of the task 14 | * 'd' in an opaque parameter passed to the routine at startup 15 | * 's' is the stack size in bytes; must be a multiple of 8 16 | */ 17 | #define CONFIG_TEST_TASK_LIST /* No test task */ 18 | -------------------------------------------------------------------------------- /test/bklight_lid.tasklist: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2013 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 | /** 7 | * List of enabled tasks in the priority order 8 | * 9 | * The first one has the lowest priority. 10 | * 11 | * For each task, use the macro TASK_TEST(n, r, d, s) where : 12 | * 'n' in the name of the task 13 | * 'r' in the main routine of the task 14 | * 'd' in an opaque parameter passed to the routine at startup 15 | * 's' is the stack size in bytes; must be a multiple of 8 16 | */ 17 | #define CONFIG_TEST_TASK_LIST /* No test task */ 18 | -------------------------------------------------------------------------------- /test/bklight_passthru.tasklist: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2013 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 | /** 7 | * List of enabled tasks in the priority order 8 | * 9 | * The first one has the lowest priority. 10 | * 11 | * For each task, use the macro TASK_TEST(n, r, d, s) where : 12 | * 'n' in the name of the task 13 | * 'r' in the main routine of the task 14 | * 'd' in an opaque parameter passed to the routine at startup 15 | * 's' is the stack size in bytes; must be a multiple of 8 16 | */ 17 | #define CONFIG_TEST_TASK_LIST /* No test task */ 18 | -------------------------------------------------------------------------------- /test/button.tasklist: -------------------------------------------------------------------------------- 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 | /** 7 | * List of enabled tasks in the priority order 8 | * 9 | * The first one has the lowest priority. 10 | * 11 | * For each task, use the macro TASK_TEST(n, r, d, s) where : 12 | * 'n' in the name of the task 13 | * 'r' in the main routine of the task 14 | * 'd' in an opaque parameter passed to the routine at startup 15 | * 's' is the stack size in bytes; must be a multiple of 8 16 | */ 17 | #define CONFIG_TEST_TASK_LIST \ 18 | TASK_TEST(KEYPROTO, keyboard_protocol_task, NULL, TASK_STACK_SIZE) 19 | -------------------------------------------------------------------------------- /test/charge_manager.tasklist: -------------------------------------------------------------------------------- 1 | /* Copyright 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 | /** 7 | * List of enabled tasks in the priority order 8 | * 9 | * The first one has the lowest priority. 10 | * 11 | * For each task, use the macro TASK_TEST(n, r, d, s) where : 12 | * 'n' in the name of the task 13 | * 'r' in the main routine of the task 14 | * 'd' in an opaque parameter passed to the routine at startup 15 | * 's' is the stack size in bytes; must be a multiple of 8 16 | */ 17 | #define CONFIG_TEST_TASK_LIST /* No test task */ 18 | -------------------------------------------------------------------------------- /test/charge_manager_drp_charging.tasklist: -------------------------------------------------------------------------------- 1 | /* Copyright 2015 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 | /** 7 | * List of enabled tasks in the priority order 8 | * 9 | * The first one has the lowest priority. 10 | * 11 | * For each task, use the macro TASK_TEST(n, r, d, s) where : 12 | * 'n' in the name of the task 13 | * 'r' in the main routine of the task 14 | * 'd' in an opaque parameter passed to the routine at startup 15 | * 's' is the stack size in bytes; must be a multiple of 8 16 | */ 17 | #define CONFIG_TEST_TASK_LIST /* No test task */ 18 | -------------------------------------------------------------------------------- /test/charge_ramp.tasklist: -------------------------------------------------------------------------------- 1 | /* Copyright 2015 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 | /** 7 | * List of enabled tasks in the priority order 8 | * 9 | * The first one has the lowest priority. 10 | * 11 | * For each task, use the macro TASK_TEST(n, r, d, s) where : 12 | * 'n' in the name of the task 13 | * 'r' in the main routine of the task 14 | * 'd' in an opaque parameter passed to the routine at startup 15 | * 's' is the stack size in bytes; must be a multiple of 8 16 | */ 17 | #define CONFIG_TEST_TASK_LIST \ 18 | TASK_TEST(CHG_RAMP, chg_ramp_task, NULL, SMALLER_TASK_STACK_SIZE) 19 | -------------------------------------------------------------------------------- /test/console_edit.tasklist: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2013 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 | /** 7 | * List of enabled tasks in the priority order 8 | * 9 | * The first one has the lowest priority. 10 | * 11 | * For each task, use the macro TASK_TEST(n, r, d, s) where : 12 | * 'n' in the name of the task 13 | * 'r' in the main routine of the task 14 | * 'd' in an opaque parameter passed to the routine at startup 15 | * 's' is the stack size in bytes; must be a multiple of 8 16 | */ 17 | #define CONFIG_TEST_TASK_LIST /* No test task */ 18 | -------------------------------------------------------------------------------- /test/extpwr_gpio.tasklist: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2013 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 | /** 7 | * List of enabled tasks in the priority order 8 | * 9 | * The first one has the lowest priority. 10 | * 11 | * For each task, use the macro TASK_TEST(n, r, d, s) where : 12 | * 'n' in the name of the task 13 | * 'r' in the main routine of the task 14 | * 'd' in an opaque parameter passed to the routine at startup 15 | * 's' is the stack size in bytes; must be a multiple of 8 16 | */ 17 | #define CONFIG_TEST_TASK_LIST /* No test task */ 18 | -------------------------------------------------------------------------------- /test/fan.tasklist: -------------------------------------------------------------------------------- 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 | /** 7 | * List of enabled tasks in the priority order 8 | * 9 | * The first one has the lowest priority. 10 | * 11 | * For each task, use the macro TASK_TEST(n, r, d, s) where : 12 | * 'n' in the name of the task 13 | * 'r' in the main routine of the task 14 | * 'd' in an opaque parameter passed to the routine at startup 15 | * 's' is the stack size in bytes; must be a multiple of 8 16 | */ 17 | #define CONFIG_TEST_TASK_LIST /* No test task */ 18 | -------------------------------------------------------------------------------- /test/flash.tasklist: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2013 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 | /** 7 | * List of enabled tasks in the priority order 8 | * 9 | * The first one has the lowest priority. 10 | * 11 | * For each task, use the macro TASK_TEST(n, r, d, s) where : 12 | * 'n' in the name of the task 13 | * 'r' in the main routine of the task 14 | * 'd' in an opaque parameter passed to the routine at startup 15 | * 's' is the stack size in bytes; must be a multiple of 8 16 | */ 17 | #define CONFIG_TEST_TASK_LIST \ 18 | TASK_TEST(TEST, task_test, NULL, TASK_STACK_SIZE) 19 | -------------------------------------------------------------------------------- /test/hooks.tasklist: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2013 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 | /** 7 | * List of enabled tasks in the priority order 8 | * 9 | * The first one has the lowest priority. 10 | * 11 | * For each task, use the macro TASK_TEST(n, r, d, s) where : 12 | * 'n' in the name of the task 13 | * 'r' in the main routine of the task 14 | * 'd' in an opaque parameter passed to the routine at startup 15 | * 's' is the stack size in bytes; must be a multiple of 8 16 | */ 17 | #define CONFIG_TEST_TASK_LIST /* No test task */ 18 | -------------------------------------------------------------------------------- /test/host_command.tasklist: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2013 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 | /** 7 | * List of enabled tasks in the priority order 8 | * 9 | * The first one has the lowest priority. 10 | * 11 | * For each task, use the macro TASK_TEST(n, r, d, s) where : 12 | * 'n' in the name of the task 13 | * 'r' in the main routine of the task 14 | * 'd' in an opaque parameter passed to the routine at startup 15 | * 's' is the stack size in bytes; must be a multiple of 8 16 | */ 17 | #define CONFIG_TEST_TASK_LIST /* No test task */ 18 | -------------------------------------------------------------------------------- /test/inductive_charging.tasklist: -------------------------------------------------------------------------------- 1 | /* Copyright 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 | /** 7 | * List of enabled tasks in the priority order 8 | * 9 | * The first one has the lowest priority. 10 | * 11 | * For each task, use the macro TASK_TEST(n, r, d, s) where : 12 | * 'n' in the name of the task 13 | * 'r' in the main routine of the task 14 | * 'd' in an opaque parameter passed to the routine at startup 15 | * 's' is the stack size in bytes; must be a multiple of 8 16 | */ 17 | #define CONFIG_TEST_TASK_LIST /* No test task */ 18 | -------------------------------------------------------------------------------- /test/interrupt.tasklist: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2013 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 | /** 7 | * List of enabled tasks in the priority order 8 | * 9 | * The first one has the lowest priority. 10 | * 11 | * For each task, use the macro TASK_TEST(n, r, d, s) where : 12 | * 'n' in the name of the task 13 | * 'r' in the main routine of the task 14 | * 'd' in an opaque parameter passed to the routine at startup 15 | * 's' is the stack size in bytes; must be a multiple of 8 16 | */ 17 | #define CONFIG_TEST_TASK_LIST /* No test task */ 18 | -------------------------------------------------------------------------------- /test/kb_8042.tasklist: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2013 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 | /** 7 | * List of enabled tasks in the priority order 8 | * 9 | * The first one has the lowest priority. 10 | * 11 | * For each task, use the macro TASK_TEST(n, r, d, s) where : 12 | * 'n' in the name of the task 13 | * 'r' in the main routine of the task 14 | * 'd' in an opaque parameter passed to the routine at startup 15 | * 's' is the stack size in bytes; must be a multiple of 8 16 | */ 17 | #define CONFIG_TEST_TASK_LIST \ 18 | TASK_TEST(KEYPROTO, keyboard_protocol_task, NULL, TASK_STACK_SIZE) \ 19 | TASK_TEST(KEYSCAN, keyboard_scan_task, NULL, 256) \ 20 | TASK_TEST(CHIPSET, chipset_task, NULL, TASK_STACK_SIZE) 21 | -------------------------------------------------------------------------------- /test/kb_mkbp.tasklist: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2013 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 | /** 7 | * List of enabled tasks in the priority order 8 | * 9 | * The first one has the lowest priority. 10 | * 11 | * For each task, use the macro TASK_TEST(n, r, d, s) where : 12 | * 'n' in the name of the task 13 | * 'r' in the main routine of the task 14 | * 'd' in an opaque parameter passed to the routine at startup 15 | * 's' is the stack size in bytes; must be a multiple of 8 16 | */ 17 | #define CONFIG_TEST_TASK_LIST \ 18 | TASK_TEST(KEYSCAN, keyboard_scan_task, NULL, 256) \ 19 | TASK_TEST(CHIPSET, chipset_task, NULL, TASK_STACK_SIZE) 20 | -------------------------------------------------------------------------------- /test/kb_scan.tasklist: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2013 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 | /** 7 | * List of enabled tasks in the priority order 8 | * 9 | * The first one has the lowest priority. 10 | * 11 | * For each task, use the macro TASK_TEST(n, r, d, s) where : 12 | * 'n' in the name of the task 13 | * 'r' in the main routine of the task 14 | * 'd' in an opaque parameter passed to the routine at startup 15 | * 's' is the stack size in bytes; must be a multiple of 8 16 | */ 17 | #define CONFIG_TEST_TASK_LIST \ 18 | TASK_TEST(KEYSCAN, keyboard_scan_task, NULL, 256) \ 19 | TASK_TEST(CHIPSET, chipset_task, NULL, TASK_STACK_SIZE) \ 20 | TASK_TEST(TEST, test_task, NULL, TASK_STACK_SIZE) 21 | -------------------------------------------------------------------------------- /test/lid_sw.tasklist: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2013 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 | /** 7 | * List of enabled tasks in the priority order 8 | * 9 | * The first one has the lowest priority. 10 | * 11 | * For each task, use the macro TASK_TEST(n, r, d, s) where : 12 | * 'n' in the name of the task 13 | * 'r' in the main routine of the task 14 | * 'd' in an opaque parameter passed to the routine at startup 15 | * 's' is the stack size in bytes; must be a multiple of 8 16 | */ 17 | #define CONFIG_TEST_TASK_LIST /* No test task */ 18 | -------------------------------------------------------------------------------- /test/lightbar.tasklist: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2013 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 | /** 7 | * List of enabled tasks in the priority order 8 | * 9 | * The first one has the lowest priority. 10 | * 11 | * For each task, use the macro TASK_TEST(n, r, d, s) where : 12 | * 'n' in the name of the task 13 | * 'r' in the main routine of the task 14 | * 'd' in an opaque parameter passed to the routine at startup 15 | * 's' is the stack size in bytes; must be a multiple of 8 16 | */ 17 | #define CONFIG_TEST_TASK_LIST \ 18 | TASK_TEST(LIGHTBAR, lightbar_task, NULL, LARGER_TASK_STACK_SIZE) 19 | -------------------------------------------------------------------------------- /test/math_util.tasklist: -------------------------------------------------------------------------------- 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 | /** 7 | * List of enabled tasks in the priority order 8 | * 9 | * The first one has the lowest priority. 10 | * 11 | * For each task, use the macro TASK_TEST(n, r, d, s) where : 12 | * 'n' in the name of the task 13 | * 'r' in the main routine of the task 14 | * 'd' in an opaque parameter passed to the routine at startup 15 | * 's' is the stack size in bytes; must be a multiple of 8 16 | */ 17 | #define CONFIG_TEST_TASK_LIST /* No test task */ 18 | -------------------------------------------------------------------------------- /test/motion_lid.tasklist: -------------------------------------------------------------------------------- 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 | /** 7 | * List of enabled tasks in the priority order 8 | * 9 | * The first one has the lowest priority. 10 | * 11 | * For each task, use the macro TASK_TEST(n, r, d, s) where : 12 | * 'n' in the name of the task 13 | * 'r' in the main routine of the task 14 | * 'd' in an opaque parameter passed to the routine at startup 15 | * 's' is the stack size in bytes; must be a multiple of 8 16 | */ 17 | #define CONFIG_TEST_TASK_LIST \ 18 | TASK_TEST(MOTIONSENSE, motion_sense_task, NULL, TASK_STACK_SIZE) 19 | -------------------------------------------------------------------------------- /test/nvmem.tasklist: -------------------------------------------------------------------------------- 1 | /* Copyright 2016 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 | /** 7 | * List of enabled tasks in the priority order 8 | * 9 | * The first one has the lowest priority. 10 | * 11 | * For each task, use the macro TASK_TEST(n, r, d, s) where : 12 | * 'n' in the name of the task 13 | * 'r' in the main routine of the task 14 | * 'd' in an opaque parameter passed to the routine at startup 15 | * 's' is the stack size in bytes; must be a multiple of 8 16 | */ 17 | #define CONFIG_TEST_TASK_LIST \ 18 | TASK_TEST(NV_1, nvmem_first_task, NULL, 384) \ 19 | TASK_TEST(NV_2, nvmem_second_task, NULL, 384) 20 | -------------------------------------------------------------------------------- /test/nvmem_vars.tasklist: -------------------------------------------------------------------------------- 1 | /* Copyright 2016 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 | /** 7 | * List of enabled tasks in the priority order 8 | * 9 | * The first one has the lowest priority. 10 | * 11 | * For each task, use the macro TASK_TEST(n, r, d, s) where : 12 | * 'n' in the name of the task 13 | * 'r' in the main routine of the task 14 | * 'd' in an opaque parameter passed to the routine at startup 15 | * 's' is the stack size in bytes; must be a multiple of 8 16 | */ 17 | #define CONFIG_TEST_TASK_LIST /* No test task */ 18 | -------------------------------------------------------------------------------- /test/pingpong.tasklist: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2013 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 | /** 7 | * List of enabled tasks in the priority order 8 | * 9 | * The first one has the lowest priority. 10 | * 11 | * For each task, use the macro TASK_TEST(n, r, d, s) where : 12 | * 'n' in the name of the task 13 | * 'r' in the main routine of the task 14 | * 'd' in an opaque parameter passed to the routine at startup 15 | * 's' is the stack size in bytes; must be a multiple of 8 16 | */ 17 | #define CONFIG_TEST_TASK_LIST \ 18 | TASK_TEST(TESTA, task_abc, NULL, TASK_STACK_SIZE) \ 19 | TASK_TEST(TESTB, task_abc, NULL, TASK_STACK_SIZE) \ 20 | TASK_TEST(TESTC, task_abc, NULL, TASK_STACK_SIZE) \ 21 | TASK_TEST(TICK, task_tick, NULL, 256) 22 | -------------------------------------------------------------------------------- /test/power_button.tasklist: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2013 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 | /** 7 | * List of enabled tasks in the priority order 8 | * 9 | * The first one has the lowest priority. 10 | * 11 | * For each task, use the macro TASK_TEST(n, r, d, s) where : 12 | * 'n' in the name of the task 13 | * 'r' in the main routine of the task 14 | * 'd' in an opaque parameter passed to the routine at startup 15 | * 's' is the stack size in bytes; must be a multiple of 8 16 | */ 17 | #define CONFIG_TEST_TASK_LIST /* No test task */ 18 | -------------------------------------------------------------------------------- /test/powerdemo.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2011 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 | /* Power state machine demo module for Chrome EC */ 7 | 8 | #ifndef __TEST_POWERDEMO_H 9 | #define __TEST_POWERDEMO_H 10 | 11 | #include "common.h" 12 | 13 | /* Initializes the module. */ 14 | int power_demo_init(void); 15 | 16 | #endif /* __TEST_POWERDEMO_H */ 17 | -------------------------------------------------------------------------------- /test/powerdemo.tasklist: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2013 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 | /** 7 | * List of enabled tasks in the priority order 8 | * 9 | * The first one has the lowest priority. 10 | * 11 | * For each task, use the macro TASK_TEST(n, r, d, s) where : 12 | * 'n' in the name of the task 13 | * 'r' in the main routine of the task 14 | * 'd' in an opaque parameter passed to the routine at startup 15 | * 's' is the stack size in bytes; must be a multiple of 8 16 | */ 17 | #define CONFIG_TEST_TASK_LIST \ 18 | TASK_TEST(POWERDEMO, power_demo_task, NULL, TASK_STACK_SIZE) 19 | -------------------------------------------------------------------------------- /test/queue.tasklist: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2013 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 | /** 7 | * List of enabled tasks in the priority order 8 | * 9 | * The first one has the lowest priority. 10 | * 11 | * For each task, use the macro TASK_TEST(n, r, d, s) where : 12 | * 'n' in the name of the task 13 | * 'r' in the main routine of the task 14 | * 'd' in an opaque parameter passed to the routine at startup 15 | * 's' is the stack size in bytes; must be a multiple of 8 16 | */ 17 | #define CONFIG_TEST_TASK_LIST /* No test task */ 18 | -------------------------------------------------------------------------------- /test/rsa.tasklist: -------------------------------------------------------------------------------- 1 | /* Copyright 2016 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 | /** 7 | * List of enabled tasks in the priority order 8 | * 9 | * The first one has the lowest priority. 10 | * 11 | * For each task, use the macro TASK_TEST(n, r, d, s) where : 12 | * 'n' in the name of the task 13 | * 'r' in the main routine of the task 14 | * 'd' in an opaque parameter passed to the routine at startup 15 | * 's' is the stack size in bytes; must be a multiple of 8 16 | */ 17 | #define CONFIG_TEST_TASK_LIST 18 | -------------------------------------------------------------------------------- /test/rsa3.tasklist: -------------------------------------------------------------------------------- 1 | rsa.tasklist -------------------------------------------------------------------------------- /test/sbs_charging_v2.tasklist: -------------------------------------------------------------------------------- 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 | /** 7 | * List of enabled tasks in the priority order 8 | * 9 | * The first one has the lowest priority. 10 | * 11 | * For each task, use the macro TASK_TEST(n, r, d, s) where : 12 | * 'n' in the name of the task 13 | * 'r' in the main routine of the task 14 | * 'd' in an opaque parameter passed to the routine at startup 15 | * 's' is the stack size in bytes; must be a multiple of 8 16 | */ 17 | #define CONFIG_TEST_TASK_LIST \ 18 | TASK_TEST(CHARGER, charger_task, NULL, TASK_STACK_SIZE) \ 19 | TASK_TEST(CHIPSET, chipset_task, NULL, TASK_STACK_SIZE) 20 | -------------------------------------------------------------------------------- /test/shmalloc.tasklist: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016 The Chromium OS Authors. All rights reserved. 3 | * Use of this source code is governed by a BSD-style license that can be 4 | * found in the LICENSE file. 5 | */ 6 | 7 | /** 8 | * List of enabled tasks in the priority order 9 | * 10 | * The first one has the lowest priority. 11 | * 12 | * For each task, use the macro TASK_TEST(n, r, d, s) where : 13 | * 'n' in the name of the task 14 | * 'r' in the main routine of the task 15 | * 'd' in an opaque parameter passed to the routine at startup 16 | * 's' is the stack size in bytes; must be a multiple of 8 17 | */ 18 | #define CONFIG_TEST_TASK_LIST 19 | 20 | -------------------------------------------------------------------------------- /test/stress.tasklist: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2013 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 | /** 7 | * List of enabled tasks in the priority order 8 | * 9 | * The first one has the lowest priority. 10 | * 11 | * For each task, use the macro TASK_TEST(n, r, d, s) where : 12 | * 'n' in the name of the task 13 | * 'r' in the main routine of the task 14 | * 'd' in an opaque parameter passed to the routine at startup 15 | * 's' is the stack size in bytes; must be a multiple of 8 16 | */ 17 | #define CONFIG_TEST_TASK_LIST /* No test task */ 18 | -------------------------------------------------------------------------------- /test/system.tasklist: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2013 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 | /** 7 | * List of enabled tasks in the priority order 8 | * 9 | * The first one has the lowest priority. 10 | * 11 | * For each task, use the macro TASK_TEST(n, r, d, s) where : 12 | * 'n' in the name of the task 13 | * 'r' in the main routine of the task 14 | * 'd' in an opaque parameter passed to the routine at startup 15 | * 's' is the stack size in bytes; must be a multiple of 8 16 | */ 17 | #define CONFIG_TEST_TASK_LIST \ 18 | TASK_TEST(CHIPSET, chipset_task, NULL, TASK_STACK_SIZE) 19 | -------------------------------------------------------------------------------- /test/test-matrix.bin: -------------------------------------------------------------------------------- 1 | :;0D1 2 | d>"A#( C =@V B)<?  +a !%$' & ,./-32*5 4 9   3 |  4 | 8 l j6  g i -------------------------------------------------------------------------------- /test/thermal.tasklist: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2013 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 | /** 7 | * List of enabled tasks in the priority order 8 | * 9 | * The first one has the lowest priority. 10 | * 11 | * For each task, use the macro TASK_TEST(n, r, d, s) where : 12 | * 'n' in the name of the task 13 | * 'r' in the main routine of the task 14 | * 'd' in an opaque parameter passed to the routine at startup 15 | * 's' is the stack size in bytes; must be a multiple of 8 16 | */ 17 | #define CONFIG_TEST_TASK_LIST \ 18 | TASK_TEST(CHIPSET, chipset_task, NULL, TASK_STACK_SIZE) 19 | -------------------------------------------------------------------------------- /test/timer_calib.tasklist: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2013 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 | /** 7 | * List of enabled tasks in the priority order 8 | * 9 | * The first one has the lowest priority. 10 | * 11 | * For each task, use the macro TASK_TEST(n, r, d, s) where : 12 | * 'n' in the name of the task 13 | * 'r' in the main routine of the task 14 | * 'd' in an opaque parameter passed to the routine at startup 15 | * 's' is the stack size in bytes; must be a multiple of 8 16 | */ 17 | #define CONFIG_TEST_TASK_LIST \ 18 | TASK_TEST(TESTTMR, timer_calib_task, NULL, TASK_STACK_SIZE) 19 | -------------------------------------------------------------------------------- /test/timer_jump.tasklist: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2013 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 | /** 7 | * List of enabled tasks in the priority order 8 | * 9 | * The first one has the lowest priority. 10 | * 11 | * For each task, use the macro TASK_TEST(n, r, d, s) where : 12 | * 'n' in the name of the task 13 | * 'r' in the main routine of the task 14 | * 'd' in an opaque parameter passed to the routine at startup 15 | * 's' is the stack size in bytes; must be a multiple of 8 16 | */ 17 | #define CONFIG_TEST_TASK_LIST /* No test task */ 18 | -------------------------------------------------------------------------------- /test/tpm_test/ftdi_spi_tpm.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2015 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 | #ifndef __EC_TEST_TPM_TEST_FTDI_SPI_TPM_H 7 | #define __EC_TEST_TPM_TEST_FTDI_SPI_TPM_H 8 | 9 | #include "mpsse.h" 10 | 11 | /* 12 | * This structure allows to convert string representation between C and 13 | * Python. 14 | */ 15 | struct swig_string_data { 16 | int size; 17 | uint8_t *data; 18 | }; 19 | 20 | int FtdiSpiInit(uint32_t freq, int enable_debug); 21 | void FtdiStop(void); 22 | struct swig_string_data FtdiSendCommandAndWait(char *tpm_command, 23 | int command_size); 24 | 25 | #endif /* ! __EC_TEST_TPM_TEST_FTDI_SPI_TPM_H */ 26 | -------------------------------------------------------------------------------- /test/tpm_test/rsa768.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN RSA PRIVATE KEY----- 2 | MIIBywIBAAJhALDb7UbZMvB81CAj0jVahhfbJHI2MzvCZIukSW50/vrSggzEEjpI 3 | Z+EVzJTfRBtOwBi6RhtRLOIPwDJ37V+L5aMA5jwtpxCJU6grM3Q49zYA/d1bvXvB 4 | fOF1kCt4LTmFaQIDAQABAmEArq25UCWMG1yfQtM+dnXfRUarW6bOuXJJTmbIJDGn 5 | +WHbEvLBMhF7kCOwuUU/Bl2i1zUP3fwD342Ra4P5We5nHhognov49uKy9SlxTCJU 6 | z36XvHAk3W1S/hfZ1kF7dkABAjEA1glkyPNcAsfGR05/Q50xRnozhaCkFuoie81k 7 | m1Dspy9+z+tpKTSOt7Wzun+bAX1pAjEA04iSLdXGKfTwLmHwYK2pRhGpDGkUMQk2 8 | i3AbEZsmOTQ0/fGaiVFjCsZgC7oYjsgBAjA8oMSPt3+kufoMUMvz1x8SG6NkgrB4 9 | XTIPZ4rMBAxE/0sokkJjjaOvniSe+25o6aECMQCG3oedM7SSIbpVSFqTuYW4yB/J 10 | auHV1fLx+ns3wX0gcdnro3SNYtfMEelA8NkhiAECMGVIqAN9qpGW5qAyikDrmzod 11 | 7+wMrWHefpWKsih4+MIvAo7WOOoM+1UasRwVGhMxFQ== 12 | -----END RSA PRIVATE KEY----- 13 | -------------------------------------------------------------------------------- /test/tpm_test/subcmd.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | # Copyright 2015 The Chromium OS Authors. All rights reserved. 3 | # Use of this source code is governed by a BSD-style license that can be 4 | # found in the LICENSE file. 5 | 6 | """Subcommand codes that specify the crypto module.""" 7 | 8 | # Keep these codes in sync with include/extension.h. 9 | AES = 0 10 | HASH = 1 11 | RSA = 2 12 | ECC = 3 13 | FW_UPGRADE = 4 14 | HKDF = 5 15 | ECIES = 6 16 | 17 | # The same exception class used by all tpmtest modules. 18 | class TpmTestError(Exception): 19 | pass 20 | -------------------------------------------------------------------------------- /test/tpm_test/testlib/common.c: -------------------------------------------------------------------------------- 1 | /* Copyright 2016 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 | #include "common.h" 7 | 8 | #include 9 | #include 10 | #include 11 | 12 | #include 13 | 14 | void rand_bytes(void *buf, size_t num) 15 | { 16 | assert(RAND_bytes(buf, num) == 1); 17 | } 18 | -------------------------------------------------------------------------------- /test/tpm_test/testlib/common.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2016 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 | #ifndef __EC_TEST_TPM_TEST_TESTLIB_COMMON_H 7 | #define __EC_TEST_TPM_TEST_TESTLIB_COMMON_H 8 | 9 | #include "dcrypto.h" 10 | 11 | #include 12 | #include 13 | #include 14 | 15 | void rand_bytes(void *buf, size_t num); 16 | 17 | #endif /* ! __EC_TEST_TPM_TEST_TESTLIB_COMMON_H */ 18 | 19 | -------------------------------------------------------------------------------- /test/tpm_test/testlib/trng.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2016 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 | /* Dummy empty file, just to make test compilation work. */ 7 | -------------------------------------------------------------------------------- /test/tpm_test/testlib/util.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2016 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 | /* Dummy empty file, just to make test compilation work. */ 7 | -------------------------------------------------------------------------------- /test/usb_pd.tasklist: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2013 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 | /** 7 | * List of enabled tasks in the priority order 8 | * 9 | * The first one has the lowest priority. 10 | * 11 | * For each task, use the macro TASK_TEST(n, r, d, s) where : 12 | * 'n' in the name of the task 13 | * 'r' in the main routine of the task 14 | * 'd' in an opaque parameter passed to the routine at startup 15 | * 's' is the stack size in bytes; must be a multiple of 8 16 | */ 17 | #define CONFIG_TEST_TASK_LIST \ 18 | TASK_TEST(PD_C0, pd_task, NULL, LARGER_TASK_STACK_SIZE) \ 19 | TASK_TEST(PD_C1, pd_task, NULL, LARGER_TASK_STACK_SIZE) 20 | -------------------------------------------------------------------------------- /test/usb_pd_giveback.tasklist: -------------------------------------------------------------------------------- 1 | usb_pd.tasklist -------------------------------------------------------------------------------- /test/usb_test/README: -------------------------------------------------------------------------------- 1 | These tests need to be built and run by hand, unless/until we set up a lab 2 | with known devices attached to a test host. 3 | -------------------------------------------------------------------------------- /test/utils.tasklist: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2013 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 | /** 7 | * List of enabled tasks in the priority order 8 | * 9 | * The first one has the lowest priority. 10 | * 11 | * For each task, use the macro TASK_TEST(n, r, d, s) where : 12 | * 'n' in the name of the task 13 | * 'r' in the main routine of the task 14 | * 'd' in an opaque parameter passed to the routine at startup 15 | * 's' is the stack size in bytes; must be a multiple of 8 16 | */ 17 | #define CONFIG_TEST_TASK_LIST /* No test task */ 18 | -------------------------------------------------------------------------------- /util/build.mk: -------------------------------------------------------------------------------- 1 | # -*- makefile -*- 2 | # Copyright (c) 2014 The Chromium OS Authors. All rights reserved. 3 | # Use of this source code is governed by a BSD-style license that can be 4 | # found in the LICENSE file. 5 | # 6 | # Host tools build 7 | # 8 | 9 | host-util-bin=ectool lbplay stm32mon ec_sb_firmware_update lbcc \ 10 | ec_parse_panicinfo 11 | build-util-bin=ec_uartd iteflash 12 | ifeq ($(CHIP),npcx) 13 | build-util-bin+=ecst 14 | endif 15 | 16 | comm-objs=$(util-lock-objs:%=lock/%) comm-host.o comm-dev.o 17 | comm-objs+=comm-lpc.o comm-i2c.o misc_util.o 18 | 19 | ectool-objs=ectool.o ectool_keyscan.o ec_flash.o ec_panicinfo.o $(comm-objs) 20 | ec_sb_firmware_update-objs=ec_sb_firmware_update.o $(comm-objs) misc_util.o 21 | ec_sb_firmware_update-objs+=powerd_lock.o 22 | lbplay-objs=lbplay.o $(comm-objs) 23 | 24 | ec_parse_panicinfo-objs=ec_parse_panicinfo.o ec_panicinfo.o 25 | -------------------------------------------------------------------------------- /util/ec3po/run_tests.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Copyright 2015 The Chromium OS Authors. All rights reserved. 4 | # Use of this source code is governed by a BSD-style license that can be 5 | # found in the LICENSE file. 6 | 7 | # Discover all the unit tests in the ec3po directory and run them. 8 | python2 -m unittest discover -b -s util/ec3po/ -p *_unittest.py \ 9 | && touch util/ec3po/.tests-passed 10 | -------------------------------------------------------------------------------- /util/ec_panicinfo.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2016 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 | #ifndef EC_PANICINFO_H 7 | #define EC_PANICINFO_H 8 | 9 | #include "panic.h" 10 | 11 | /** 12 | * Prints panic information to stdout. 13 | * 14 | * @param pdata Panic information to print 15 | * @return 0 if success or non-zero error code if error. 16 | */ 17 | int parse_panic_info(const struct panic_data *pdata); 18 | 19 | #endif /* EC_PANICINFO_H */ 20 | -------------------------------------------------------------------------------- /util/ec_parse_panicinfo.c: -------------------------------------------------------------------------------- 1 | /* Copyright 2016 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 | * Standalone utility to parse EC panicinfo. 6 | */ 7 | 8 | #include 9 | #include 10 | #include "ec_panicinfo.h" 11 | 12 | int main(int argc, char *argv[]) 13 | { 14 | struct panic_data pdata; 15 | 16 | if (fread(&pdata, sizeof(pdata), 1, stdin) != 1) { 17 | fprintf(stderr, "Error reading panicinfo from stdin.\n"); 18 | return 1; 19 | } 20 | 21 | return parse_panic_info(&pdata) ? 1 : 0; 22 | } 23 | -------------------------------------------------------------------------------- /util/lock/build.mk: -------------------------------------------------------------------------------- 1 | # -*- makefile -*- 2 | # Copyright (c) 2012 The Chromium OS Authors. All rights reserved. 3 | # Use of this source code is governed by a BSD-style license that can be 4 | # found in the LICENSE file. 5 | # 6 | # Lock library 7 | # 8 | 9 | util-lock-objs=file_lock.o gec_lock.o 10 | util-lock-objs+=android.o 11 | -------------------------------------------------------------------------------- /util/openocd/lm4_chip.cfg: -------------------------------------------------------------------------------- 1 | 2 | ftdi_layout_init 0x0018 0x009b 3 | 4 | # open collector oe only 5 | ftdi_layout_signal nSRST -oe 0x0020 6 | 7 | reset_config trst_only 8 | 9 | source [find target/stellaris.cfg] 10 | source [find lm4x_cmds.tcl] 11 | 12 | -------------------------------------------------------------------------------- /util/openocd/npcx_chip.cfg: -------------------------------------------------------------------------------- 1 | 2 | source [find npcx.cfg] 3 | source [find npcx_cmds.tcl] 4 | 5 | ftdi_layout_init 0x0018 0x009b 6 | 7 | # open collector oe only 8 | ftdi_layout_signal nSRST -oe 0x0020 9 | 10 | reset_config trst_only 11 | 12 | -------------------------------------------------------------------------------- /util/openocd/nrf51_chip.cfg: -------------------------------------------------------------------------------- 1 | 2 | #nRF51 uses SWD 3 | transport select swd 4 | # Since nTRST is repurposed, we need a different layout_init setting 5 | ftdi_layout_init 0x0008 0x009b 6 | 7 | ftdi_layout_signal SWDIO_OE -nalias nTRST 8 | ftdi_layout_signal SWD_EN -alias TMS 9 | 10 | #Disable fast flashing, it only works with ST-Link and CMSIS-DAP 11 | set WORKAREASIZE 0 12 | source [find target/nrf51.cfg] 13 | source [find nrf51_cmds.tcl] 14 | 15 | -------------------------------------------------------------------------------- /util/openocd/nrf51_cmds.tcl: -------------------------------------------------------------------------------- 1 | # Copyright 2015 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 | # Command automation for Nordic nRF51 chip 6 | 7 | proc flash_nrf51 {path offset} { 8 | reset halt; 9 | program $path $offset; 10 | } 11 | 12 | proc unprotect_nrf51 { } { 13 | reset halt; 14 | nrf51 mass_erase; 15 | } 16 | 17 | # enable reset by writing 1 to the RESET register 18 | # This will disconnect the debugger with the following message: 19 | # Polling target nrf51.cpu failed, trying to reexamine 20 | proc exit_debug_mode_nrf51 { } { 21 | mww 0x40000544 1; 22 | } 23 | -------------------------------------------------------------------------------- /util/openocd/servo.cfg: -------------------------------------------------------------------------------- 1 | telnet_port 4444 2 | gdb_port 3333 3 | gdb_memory_map enable 4 | gdb_flash_program enable 5 | 6 | interface ftdi 7 | # VID/PID for servo v2, servo v3 8 | ftdi_vid_pid 0x18d1 0x5002 0x18d1 0x5004 0x18d1 0x500d 9 | # Only initialize Port A 10 | ftdi_channel 0 11 | 12 | # unbuffered connection data == oe 13 | ftdi_layout_signal nTRST -data 0x0010 -oe 0x0010 14 | 15 | -------------------------------------------------------------------------------- /util/signer/.gitignore: -------------------------------------------------------------------------------- 1 | signer 2 | -------------------------------------------------------------------------------- /util/signer/build.mk: -------------------------------------------------------------------------------- 1 | # -*- makefile -*- 2 | # Copyright 2015 The Chromium OS Authors. All rights reserved. 3 | # Use of this source code is governed by a BSD-style license that can be 4 | # found in the LICENSE file. 5 | 6 | signer_LIBS := -lcrypto -lelf -lusb-1.0 -lxml2 7 | signer_ROOT := util/signer 8 | signer_INC := $(addprefix common/, aes.h ecdh.h gnubby.h \ 9 | image.h publickey.h signed_header.h) 10 | signer_SRC := codesigner.cc publickey.cc image.cc gnubby.cc aes.cc ecdh.cc 11 | SIGNER_DEPS := $(addprefix $(signer_ROOT)/, $(signer_SRC) $(signer_INC)) 12 | 13 | HOST_CXXFLAGS += -I/usr/include/libxml2 14 | $(out)/util/signer: $(SIGNER_DEPS) 15 | $(call quiet,cxx_to_host,HOSTCXX) 16 | 17 | -------------------------------------------------------------------------------- /util/signer/common/aes.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2015 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 | #ifndef __EC_UTIL_SIGNER_COMMON_AES_H 6 | #define __EC_UTIL_SIGNER_COMMON_AES_H 7 | 8 | #include 9 | #include 10 | 11 | class AES { 12 | private: 13 | unsigned char key_[16]; 14 | public: 15 | AES(); 16 | ~AES(); 17 | 18 | void set_key(const void* key); 19 | void decrypt_block(const void* in, void* out); 20 | void encrypt_block(const void* in, void* out); 21 | void cmac(const void* in, size_t in_len, void* out); 22 | }; 23 | 24 | #endif // __EC_UTIL_SIGNER_COMMON_AES_H 25 | -------------------------------------------------------------------------------- /util/signer/common/ecdh.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2015 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 | #ifndef __EC_UTIL_SIGNER_COMMON_ECDH_H 6 | #define __EC_UTIL_SIGNER_COMMON_ECDH_H 7 | 8 | #include 9 | 10 | class ECDH { 11 | private: 12 | EC_KEY* key_; 13 | EC_GROUP* group_; 14 | public: 15 | ECDH(); 16 | ~ECDH(); 17 | 18 | void get_point(void* dst); 19 | 20 | // Computes SHA256 of x-coordinate. 21 | void compute_secret(const void* other, void* secret); 22 | }; 23 | 24 | #endif // __EC_UTIL_SIGNER_COMMON_ECDH_H 25 | -------------------------------------------------------------------------------- /util/signer/cr50_RW-prod.pem.pub: -------------------------------------------------------------------------------- 1 | -----BEGIN PUBLIC KEY----- 2 | MIIBIDANBgkqhkiG9w0BAQEFAAOCAQ0AMIIBCAKCAQEAthqml36PUHk5MgurodTG 3 | puEsqK9/28/gEiCZGgfKL2rZKzU7CSiD82nmMgMoaxNTcPZgln+WELXIZUv81Up3 4 | GT6dA2dSDSQgmdgI1/x3OkEf9BkmHajuvhZTDteI18X/9TsXwly9zoxEFRy/JW8X 5 | Cz9/eOE7xcgoIzji0WmnosMKyxiOv67hhH+JvJ01uQhcxOag2606uIBknovHZT7l 6 | kf3RsEquoZqGK2WFwin9gl4KXv8yQ2F0h9LnfezIURWuz4J6pNc8EI7jYeP5eBrJ 7 | AfE8HsnDD6I2OpoNNM0BnbPq7gbn5CJJn5bZ6dNM4YBH8saJgNVBYOV9XqHdtiLV 8 | uwIBAw== 9 | -----END PUBLIC KEY----- 10 | -------------------------------------------------------------------------------- /util/signer/cr50_rom0-dev-blsign.pem.pub: -------------------------------------------------------------------------------- 1 | -----BEGIN PUBLIC KEY----- 2 | MIIBIDANBgkqhkiG9w0BAQEFAAOCAQ0AMIIBCAKCAQEA4A43llHW4BJa/wOJ3gYF 3 | dZ2V8bLc+oh5+6vgzBcoCKQyA8Gn0ds1j91SDNcEodFkSi+1mPi1fyhd8oEBjKMT 4 | TUwbBQ8IkKCf7GEdDW8R2ruWeckVZQfrO0vU/po4Rs3F9ngbwV+HXFu9G9I6jdy5 5 | DjQCT8JWp2O9LiJPeo41IRdwp4d7jzDcauKoOc3tHKlKHqwc0JtHoYCIzE+2x7Jb 6 | jLR9GVFX/8GgdJwmxzMCrUhS8XglDxnGmxH5ovPuaYHctNXzwRT6PMY2YTypF+mj 7 | nhS5wJ5+D0Jg7zHnddLsEG/ZzOSbD8m7lI8Lg4mTHhWcdh9EjdQJUzfxLB/ExIQG 8 | 9wIBAw== 9 | -----END PUBLIC KEY----- 10 | --------------------------------------------------------------------------------