From: "Cédric Le Goater" <clg@kaod.org>
To: qemu-devel@nongnu.org
Cc: qemu-arm@nongnu.org, "Peter Maydell" <peter.maydell@linaro.org>,
"Joel Stanley" <joel@jms.id.au>,
"Andrew Jeffery" <andrew@aj.id.au>,
"Alistair Francis" <alistair@alistair23.me>,
"Peter Crosthwaite" <crosthwaite.peter@gmail.com>,
"Cédric Le Goater" <clg@kaod.org>
Subject: [Qemu-devel] [PATCH 11/11] aspeed/smc: Add dummy data register
Date: Fri, 31 Aug 2018 13:15:55 +0200 [thread overview]
Message-ID: <20180831111555.15008-2-clg@kaod.org> (raw)
In-Reply-To: <20180831111555.15008-1-clg@kaod.org>
The SMC controllers have a register containing the byte that will be
used as dummy output. It can be modified by software.
Signed-off-by: Cédric Le Goater <clg@kaod.org>
---
hw/ssi/aspeed_smc.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/hw/ssi/aspeed_smc.c b/hw/ssi/aspeed_smc.c
index da2fedfcd3cd..f31bbc895caa 100644
--- a/hw/ssi/aspeed_smc.c
+++ b/hw/ssi/aspeed_smc.c
@@ -102,8 +102,8 @@
/* Misc Control Register #1 */
#define R_MISC_CTRL1 (0x50 / 4)
-/* Misc Control Register #2 */
-#define R_MISC_CTRL2 (0x54 / 4)
+/* SPI dummy cycle data */
+#define R_DUMMY_DATA (0x54 / 4)
/* DMA Control/Status Register */
#define R_DMA_CTRL (0x80 / 4)
@@ -548,7 +548,7 @@ static void aspeed_smc_flash_setup(AspeedSMCFlash *fl, uint32_t addr)
*/
if (aspeed_smc_flash_mode(fl) == CTRL_FREADMODE) {
for (i = 0; i < aspeed_smc_flash_dummies(fl); i++) {
- ssi_transfer(fl->controller->spi, 0xFF);
+ ssi_transfer(fl->controller->spi, s->regs[R_DUMMY_DATA] & 0xff);
}
}
}
@@ -680,6 +680,7 @@ static uint64_t aspeed_smc_read(void *opaque, hwaddr addr, unsigned int size)
addr == s->r_timings ||
addr == s->r_ce_ctrl ||
addr == R_INTR_CTRL ||
+ addr == R_DUMMY_DATA ||
(s->ctrl->has_dma && addr == R_DMA_CTRL) ||
(s->ctrl->has_dma && addr == R_DMA_FLASH_ADDR) ||
(s->ctrl->has_dma && addr == R_DMA_DRAM_ADDR) ||
@@ -912,6 +913,8 @@ static void aspeed_smc_write(void *opaque, hwaddr addr, uint64_t data,
}
} else if (addr == R_INTR_CTRL) {
s->regs[addr] = value;
+ } else if (addr == R_DUMMY_DATA) {
+ s->regs[addr] = value & 0xff ;
} else if (s->ctrl->has_dma && addr == R_DMA_CTRL) {
aspeed_smc_dma_ctrl(s, value);
} else if (s->ctrl->has_dma && addr == R_DMA_DRAM_ADDR) {
--
2.17.1
next prev parent reply other threads:[~2018-08-31 11:22 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-08-31 10:38 [Qemu-devel] [PATCH 00/11] aspeed: misc fixes and enhancements (SMC) Cédric Le Goater
2018-08-31 10:38 ` [Qemu-devel] [PATCH 01/11] aspeed/timer: fix compile breakage with clang 3.4.2 Cédric Le Goater
2018-08-31 10:38 ` [Qemu-devel] [PATCH 02/11] hw/arm/aspeed: change the FMC flash model of the AST2500 evb Cédric Le Goater
2018-08-31 10:38 ` [Qemu-devel] [PATCH 03/11] hw/arm/aspeed: Add an Aspeed machine class Cédric Le Goater
2018-09-07 23:13 ` [Qemu-devel] [Qemu-arm] " Philippe Mathieu-Daudé
2018-08-31 10:38 ` [Qemu-devel] [PATCH 04/11] hw/arm/aspeed: add a 'mmio-exec' property to boot from the FMC flash module Cédric Le Goater
2018-08-31 10:38 ` [Qemu-devel] [PATCH 05/11] aspeed/smc: fix some alignment issues Cédric Le Goater
2018-09-07 18:28 ` [Qemu-devel] [Qemu-arm] " Philippe Mathieu-Daudé
2018-08-31 10:38 ` [Qemu-devel] [PATCH 06/11] aspeed/smc: fix default read value Cédric Le Goater
2018-09-07 23:06 ` Philippe Mathieu-Daudé
2018-09-10 6:20 ` Cédric Le Goater
2018-08-31 10:38 ` [Qemu-devel] [PATCH 07/11] aspeed/smc: add a 'sdram_base' and 'max-ram-size' properties Cédric Le Goater
2018-08-31 10:38 ` [Qemu-devel] [PATCH 08/11] aspeed/smc: add support for DMAs Cédric Le Goater
2018-08-31 10:38 ` [Qemu-devel] [PATCH 09/11] aspeed/smc: add DMA calibration settings Cédric Le Goater
2018-08-31 11:15 ` [Qemu-devel] [PATCH 10/11] aspeed/smc: inject errors in DMA checksum Cédric Le Goater
2018-08-31 11:15 ` Cédric Le Goater [this message]
2018-09-07 23:02 ` [Qemu-devel] [Qemu-arm] [PATCH 11/11] aspeed/smc: Add dummy data register Philippe Mathieu-Daudé
2018-08-31 22:16 ` [Qemu-devel] [PATCH 00/11] aspeed: misc fixes and enhancements (SMC) Joel Stanley
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180831111555.15008-2-clg@kaod.org \
--to=clg@kaod.org \
--cc=alistair@alistair23.me \
--cc=andrew@aj.id.au \
--cc=crosthwaite.peter@gmail.com \
--cc=joel@jms.id.au \
--cc=peter.maydell@linaro.org \
--cc=qemu-arm@nongnu.org \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).