mirror of
https://github.com/linux-msm/cdba.git
synced 2026-10-06 21:32:09 -07:00
The client can now request the device to enter EDL mode and the server's device and driver model can power up the board to this state. Introduce four new messages to the cdba protocol: - EDL_PRESENT: used by the server to signal the presence of the EDL device - EDL_DOWNLOAD: used by the client to transfer a binary blob to the server, mimicing the fastboot protocol - EDL_WRITE: used by the client to indicate the target for the downloaded binary blob. The server may start flashing the image if supported. - EDL_RESET: used by the client to request that the flash operations are finalized and the board restarts. Introduce a new "EDL" module that will look for EDL USB devices and if found signal the client about its presence. Implement EDL_DOWNLOAD by streaming the incoming blob into a temporary file, let EDL_WRITE tag the image with information about where it should be written. Then as we're relying on QDL, invoke the external tool as part of the EDL_RESET, "flushing out" the pending operations. Support for matching EDL device by serial number is left as a todo item. Signed-off-by: Bjorn Andersson <bjorn.andersson@oss.qualcomm.com>
67 lines
988 B
C
67 lines
988 B
C
#ifndef __CDBA_H__
|
|
#define __CDBA_H__
|
|
|
|
#include <stdint.h>
|
|
|
|
#define __packed __attribute__((packed))
|
|
|
|
#define MIN(x, y) ((x) < (y) ? (x) : (y))
|
|
#define MAX(x, y) ((x) > (y) ? (x) : (y))
|
|
|
|
struct msg {
|
|
uint8_t type;
|
|
uint16_t len;
|
|
uint8_t data[];
|
|
} __packed;
|
|
|
|
enum {
|
|
MSG_SELECT_BOARD = 1,
|
|
MSG_CONSOLE,
|
|
MSG_HARDRESET,
|
|
MSG_POWER_ON,
|
|
MSG_POWER_OFF,
|
|
MSG_FASTBOOT_PRESENT,
|
|
MSG_FASTBOOT_DOWNLOAD,
|
|
MSG_FASTBOOT_BOOT,
|
|
MSG_STATUS_UPDATE,
|
|
MSG_VBUS_ON,
|
|
MSG_VBUS_OFF,
|
|
MSG_FASTBOOT_REBOOT,
|
|
MSG_SEND_BREAK,
|
|
MSG_LIST_DEVICES,
|
|
MSG_BOARD_INFO,
|
|
MSG_FASTBOOT_CONTINUE,
|
|
MSG_KEY_PRESS,
|
|
MSG_EDL_PRESENT,
|
|
MSG_EDL_DOWNLOAD,
|
|
MSG_EDL_WRITE,
|
|
MSG_EDL_RESET,
|
|
};
|
|
|
|
struct key_press {
|
|
uint8_t key;
|
|
uint8_t state;
|
|
} __packed;
|
|
|
|
enum {
|
|
DEVICE_KEY_FASTBOOT,
|
|
DEVICE_KEY_POWER,
|
|
DEVICE_KEY_EDL,
|
|
DEVICE_KEY_COUNT
|
|
};
|
|
|
|
enum {
|
|
KEY_PRESS_RELEASE,
|
|
KEY_PRESS_PRESS,
|
|
KEY_PRESS_PULSE,
|
|
};
|
|
|
|
enum power_on_mode {
|
|
MSG_POWER_ON_NORMAL,
|
|
MSG_POWER_ON_FASTBOOT,
|
|
MSG_POWER_ON_EDL,
|
|
MSG_POWER_ON_COUNT
|
|
};
|
|
|
|
#endif
|