diff options
author | Viresh Kumar <viresh.kumar@linaro.org> | 2015-09-09 21:08:33 +0530 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@google.com> | 2015-09-14 21:52:16 -0700 |
commit | 4c9e228407a25a99876b979479ff76208ab7de47 (patch) | |
tree | c837cc28c4f49a851ef1b0cdbf40863228a6bcfb /drivers | |
parent | 1a8862863a7171e8b97fe8833bb3a78770a8aaee (diff) |
greybus: firmware: Send AP-ready operation
Module's Bootrom needs a way to know (currently), when to start sending
requests to the AP. The version request is sent before connection_init()
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.
Reviewed-by: Johan Hovold <johan@hovoldconsulting.com>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/staging/greybus/firmware.c | 15 | ||||
-rw-r--r-- | drivers/staging/greybus/greybus_protocols.h | 1 |
2 files changed, 16 insertions, 0 deletions
diff --git a/drivers/staging/greybus/firmware.c b/drivers/staging/greybus/firmware.c index fdd5e0cc9ebc..5642bc33c1ce 100644 --- a/drivers/staging/greybus/firmware.c +++ b/drivers/staging/greybus/firmware.c @@ -165,6 +165,7 @@ static int gb_firmware_request_recv(u8 type, struct gb_operation *op) static int gb_firmware_connection_init(struct gb_connection *connection) { struct gb_firmware *firmware; + int ret; firmware = kzalloc(sizeof(*firmware), GFP_KERNEL); if (!firmware) @@ -173,6 +174,20 @@ static int gb_firmware_connection_init(struct gb_connection *connection) 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; } diff --git a/drivers/staging/greybus/greybus_protocols.h b/drivers/staging/greybus/greybus_protocols.h index 6fd20bdc94af..d77e03915428 100644 --- a/drivers/staging/greybus/greybus_protocols.h +++ b/drivers/staging/greybus/greybus_protocols.h @@ -155,6 +155,7 @@ struct gb_control_disconnected_request { #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 */ |