[PATCH 07/18] hw/pci-host/bonito: Make BONPONCFG register read-only

Philippe Mathieu-Daudé posted 18 patches 5 years, 1 month ago
Maintainers: "Philippe Mathieu-Daudé" <f4bug@amsat.org>, Jiaxun Yang <jiaxun.yang@flygoat.com>, Aleksandar Rikalo <aleksandar.rikalo@syrmia.com>, Aurelien Jarno <aurelien@aurel32.net>
[PATCH 07/18] hw/pci-host/bonito: Make BONPONCFG register read-only
Posted by Philippe Mathieu-Daudé 5 years, 1 month ago
Per the datasheet (Chapter 5.2. "Power-on settable configuration
register - bonponcfg"), the bonponcfg can only be modified using
"pull-up on the corresponding IOD0-15 signal". Do not allow
update of this register by the CPU.

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
 hw/pci-host/bonito.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/pci-host/bonito.c b/hw/pci-host/bonito.c
index 93820f69e49..29c0294d289 100644
--- a/hw/pci-host/bonito.c
+++ b/hw/pci-host/bonito.c
@@ -251,7 +251,6 @@ static void bonito_writel(void *opaque, hwaddr addr,
     DPRINTF("bonito_writel "TARGET_FMT_plx" val %lx saddr %x\n",
             addr, val, saddr);
     switch (saddr) {
-    case BONITO_BONPONCFG:
     case BONITO_IODEVCFG:
     case BONITO_SDCFG:
     case BONITO_PCIMAP:
@@ -292,6 +291,7 @@ static void bonito_writel(void *opaque, hwaddr addr,
         s->regs[BONITO_INTENCLR] = val;
         s->regs[BONITO_INTEN] &= ~val;
         break;
+    case BONITO_BONPONCFG:
     case BONITO_INTEN:
     case BONITO_INTISR:
         DPRINTF("write to readonly bonito register %x\n", saddr);
-- 
2.26.2