static int gb_firmware_connection_init(struct gb_connection *connection)
{
struct gb_firmware *firmware;
+ int ret;
firmware = kzalloc(sizeof(*firmware), GFP_KERNEL);
if (!firmware)
firmware->connection = connection;
connection->private = firmware;
+ /*
+ * Module's Bootrom needs a way to know (currently), when to start
+ * sending requests to the AP. The version request is sent before this
+ * routine is called, and if the module sends the request right after
+ * receiving version request, the connection->private field will be
+ * NULL.
+ *
+ * Fix this TEMPORARILY by sending an AP_READY request.
+ */
+ ret = gb_operation_sync(connection, GB_FIRMWARE_TYPE_AP_READY, NULL, 0,
+ NULL, 0);
+ if (ret)
+ dev_err(&connection->dev, "Failed to send AP READY (%d)\n", ret);
+
return 0;
}
#define GB_FIRMWARE_TYPE_FIRMWARE_SIZE 0x02
#define GB_FIRMWARE_TYPE_GET_FIRMWARE 0x03
#define GB_FIRMWARE_TYPE_READY_TO_BOOT 0x04
+#define GB_FIRMWARE_TYPE_AP_READY 0x05 /* Request with no-payload */
/* Greybus firmware boot stages */
#define GB_FIRMWARE_BOOT_STAGE_ONE 0x01 /* Reserved for the boot ROM */