Skip to contentSkip to conversation

usb: typec: ucsi: ccg: add firmware flashing support

PATCH New Greg Kroah-Hartman 1 participant 1 message Apr 17, 2019 USB

lore
Share & tools
lore

Greg Kroah-Hartman

author maintainer
#0 lore raw

PATCH v8 3/3 usb: typec: ucsi: ccg: add firmware flashing support

Quoted 27 lines · Ajay Gupta

From: Ajay Gupta <[email protected]>

CCGx has two copies of the firmware in addition to the bootloader. If the device is running FW1, FW2 can be updated with the new version. Dual firmware mode allows the CCG device to stay in a PD contract and support USB PD and Type-C functionality while a firmware update is in progress.

First we read the currently flashed firmware version of both primary and secondary firmware and then compare it with version of firmware file to determine if flashing is required.

Command framework is added to support sending commands to CCGx controller. We wait for response after sending the command and then read the response from RAB_RESPONSE register.

Below commands are supported,
- ENTER_FLASHING
- RESET
- PDPORT_ENABLE
- JUMP_TO_BOOT
- FLASH_ROW_RW
- VALIDATE_FW

Command specific mutex lock is also added to sync between driver and user threads.

Quoted 8 lines

PD port number information is added which is required while sending PD_PORT_ENABLE command

---
Changes from v7->v8
- Fixed comments from Greg by dropping do_flash_show()

You still have a new sysfs file without a new Documentation/ABI/ update for it, so I will have to reject this patch again :(

I thought I said that in the last review...

thanks,

greg k-h