From fc41c2da44c510a919f68e2486aeb456f90a50a4 Mon Sep 17 00:00:00 2001 From: Eli Sennesh Date: Fri, 8 Jan 2016 14:11:29 -0500 Subject: [PATCH] greybus: firmware/bootrom: debug output from bootrom protocol The bootrom protocol issues no dynamic debugging messages when it functions successfully. Use dev_dbg() to fix that by issuing kernel logs when firmware download works. Signed-off-by: Eli Sennesh Signed-off-by: Greg Kroah-Hartman --- drivers/staging/greybus/firmware.c | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/drivers/staging/greybus/firmware.c b/drivers/staging/greybus/firmware.c index c65f2948be02..b65787c4116e 100644 --- a/drivers/staging/greybus/firmware.c +++ b/drivers/staging/greybus/firmware.c @@ -61,6 +61,9 @@ static void firmware_es2_fixup_vid_pid(struct gb_firmware *firmware) firmware->vendor_id = le32_to_cpu(response.vendor_id); firmware->product_id = le32_to_cpu(response.product_id); + + dev_dbg(&connection->bundle->dev, "Firmware got vid (0x%x)/pid (0x%x)\n", + firmware->vendor_id, firmware->product_id); } /* This returns path of the firmware blob on the disk */ @@ -69,6 +72,7 @@ static int download_firmware(struct gb_firmware *firmware, u8 stage) struct gb_connection *connection = firmware->connection; struct gb_interface *intf = connection->bundle->intf; char firmware_name[48]; + int rc; /* Already have a firmware, free it */ if (firmware->fw) @@ -84,8 +88,11 @@ static int download_firmware(struct gb_firmware *firmware, u8 stage) intf->ddbl1_manufacturer_id, intf->ddbl1_product_id, firmware->vendor_id, firmware->product_id, stage); - return request_firmware(&firmware->fw, firmware_name, - &connection->bundle->dev); + rc = request_firmware(&firmware->fw, firmware_name, + &connection->bundle->dev); + dev_dbg(&connection->bundle->dev, "Searched for TFTF %s: %d\n", + firmware_name, rc); + return rc; } static int gb_firmware_size_request(struct gb_operation *op) @@ -121,6 +128,8 @@ static int gb_firmware_size_request(struct gb_operation *op) size_response = op->response->payload; size_response->size = cpu_to_le32(firmware->fw->size); + dev_dbg(dev, "%s: firmware size %d bytes\n", __func__, size_response->size); + return 0; } @@ -165,6 +174,9 @@ static int gb_firmware_get_firmware(struct gb_operation *op) firmware_response = op->response->payload; memcpy(firmware_response->data, fw->data + offset, size); + dev_dbg(dev, "responding with firmware (offs = %u, size = %u)\n", offset, + size); + return 0; } @@ -192,6 +204,7 @@ static int gb_firmware_ready_to_boot(struct gb_operation *op) /* * XXX Should we return error for insecure firmware? */ + dev_dbg(dev, "ready to boot: 0x%x, 0\n", status); return 0; } @@ -245,6 +258,8 @@ static int gb_firmware_connection_init(struct gb_connection *connection) "failed to send AP READY: %d\n", ret); } + dev_dbg(&connection->bundle->dev, "%s: AP_READY sent\n", __func__); + return 0; } @@ -258,6 +273,8 @@ static void gb_firmware_connection_exit(struct gb_connection *connection) connection->private = NULL; kfree(firmware); + + dev_dbg(&connection->bundle->dev, "%s\n", __func__); } static struct gb_protocol firmware_protocol = { -- 2.20.1