[SeaBIOS] [PATCH 2/3] sdcard: fix typo causing 32bit write to 16bit block_size field
Kevin O'Connor
kevin at koconnor.net
Tue Nov 17 20:58:30 CET 2015
The block_size field is 16bits and only 16bit writes should be used
with it.
Signed-off-by: Kevin O'Connor <kevin at koconnor.net>
---
src/hw/sdcard.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/hw/sdcard.c b/src/hw/sdcard.c
index 0617d24..e01e1bb 100644
--- a/src/hw/sdcard.c
+++ b/src/hw/sdcard.c
@@ -224,7 +224,7 @@ sdcard_pio_transfer(struct sddrive_s *drive, int cmd, u32 addr
, void *data, int count)
{
// Send command
- writel(&drive->regs->block_size, DISK_SECTOR_SIZE);
+ writew(&drive->regs->block_size, DISK_SECTOR_SIZE);
writew(&drive->regs->block_count, count);
int isread = cmd != SC_WRITE_SINGLE && cmd != SC_WRITE_MULTIPLE;
u16 tmode = ((count > 1 ? ST_MULTIPLE|ST_AUTO_CMD12|ST_BLOCKCOUNT : 0)
--
2.4.3
More information about the SeaBIOS
mailing list