@@ -168,6 +168,22 @@ void sd_prepare_request(SDRequest *req, uint8_t cmd, uint32_t arg,
void sd_prepare_request_with_crc(SDRequest *req, uint8_t cmd, uint32_t arg,
uint8_t crc);
+/**
+ * sd_prepare_response48: Initialize a SD response buffer
+ *
+ * If @gen_crc the frame checksum will be calculated
+ * and filled in the request buffer.
+ *
+ * @req: the #SDRequest to be filled
+ * @cmd: the SD command
+ * @arg: the SD command argument
+ * @is_response: whether the frame is a command request or response
+ * @gen_crc: generates the frame CRC7 if true, else fill with zeroes
+ */
+
+void sd_prepare_frame48(SDFrame48 *frame, uint8_t cmd, uint32_t arg,
+ bool is_response, bool gen_crc);
+
/**
* sd_update_frame48_checksum:
* @frame: the #SDFrame48 to verify
@@ -129,8 +129,8 @@ void sd_update_frame48_checksum(SDFrame48 *frame, bool is_response)
frame->crc = sd_calc_frame48_crc7(frame->cmd, frame->arg, is_response);
}
-static void sd_prepare_frame48(SDFrame48 *frame, uint8_t cmd, uint32_t arg,
- bool is_response, bool gen_crc)
+void sd_prepare_frame48(SDFrame48 *frame, uint8_t cmd, uint32_t arg,
+ bool is_response, bool gen_crc)
{
frame->cmd = cmd;
frame->arg = arg;
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org> --- include/hw/sd/sd.h | 16 ++++++++++++++++ hw/sd/sdmmc-internal.c | 4 ++-- 2 files changed, 18 insertions(+), 2 deletions(-)