[coreboot-gerrit] Change in coreboot[master]: drivers/spi/spiconsole: Fix broken spiconsole driver
Martin Roth (Code Review)
gerrit at coreboot.org
Mon Apr 24 19:28:45 CEST 2017
Martin Roth has submitted this change and it was merged. ( https://review.coreboot.org/19385 )
Change subject: drivers/spi/spiconsole: Fix broken spiconsole driver
......................................................................
drivers/spi/spiconsole: Fix broken spiconsole driver
Use spi_setup_slave to fill up the spi_slave structure with
pointer to spi_ctrlr structure which can then be used to perform all
spi operations.
Change-Id: I2804ed1e85402426a654352e1ceaf0993546cd8b
Signed-off-by: Furquan Shaikh <furquan at chromium.org>
Reviewed-on: https://review.coreboot.org/19385
Reviewed-by: Aaron Durbin <adurbin at chromium.org>
Tested-by: build bot (Jenkins)
Reviewed-by: Philippe Mathieu-Daudé <philippe.mathieu.daude at gmail.com>
---
M src/drivers/spi/spiconsole.c
1 file changed, 4 insertions(+), 3 deletions(-)
Approvals:
Aaron Durbin: Looks good to me, approved
Philippe Mathieu-Daudé: Looks good to me, but someone else must approve
build bot (Jenkins): Verified
diff --git a/src/drivers/spi/spiconsole.c b/src/drivers/spi/spiconsole.c
index 0831f2c..41846b7 100644
--- a/src/drivers/spi/spiconsole.c
+++ b/src/drivers/spi/spiconsole.c
@@ -17,8 +17,11 @@
#include <spi_flash.h>
#include <console/spi.h>
+static struct spi_slave slave;
+
void spiconsole_init(void) {
spi_init();
+ spi_setup_slave(0, 0, &slave);
return;
}
@@ -54,9 +57,7 @@
if (c == '\n' || (sizeof(struct em100_msg_header) +
msg.header.msg_length == spi_crop_chunk(0,
MAX_MSG_LENGTH))) {
- struct spi_slave spi = { };
-
- spi_xfer(&spi, &msg, sizeof(struct em100_msg_header) +
+ spi_xfer(&slave, &msg, sizeof(struct em100_msg_header) +
msg.header.msg_length, NULL, 0);
msg.header.msg_length = 0;
--
To view, visit https://review.coreboot.org/19385
To unsubscribe, visit https://review.coreboot.org/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I2804ed1e85402426a654352e1ceaf0993546cd8b
Gerrit-PatchSet: 2
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Owner: Furquan Shaikh <furquan at google.com>
Gerrit-Reviewer: Aaron Durbin <adurbin at chromium.org>
Gerrit-Reviewer: Martin Roth <martinroth at google.com>
Gerrit-Reviewer: Paul Menzel <paulepanter at users.sourceforge.net>
Gerrit-Reviewer: Philippe Mathieu-Daudé <philippe.mathieu.daude at gmail.com>
Gerrit-Reviewer: build bot (Jenkins)
More information about the coreboot-gerrit
mailing list