qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] sdhci: add i.MX SD Stable Clock bit
@ 2018-08-16 12:29 Hans-Erik Floryd
  2018-08-17 10:05 ` no-reply
  0 siblings, 1 reply; 2+ messages in thread
From: Hans-Erik Floryd @ 2018-08-16 12:29 UTC (permalink / raw)
  To: qemu-trivial
  Cc: Hans-Erik Floryd, Philippe Mathieu-Daudé,
	open list:All patches CC here

Add the ESDHC PRSSTAT_SDSTB bit, using the value of SDHC_CLOCK_INT_STABLE.
Freescale recommends checking this bit when changing clock frequency.

Signed-off-by: Hans-Erik Floryd <hans-erik.floryd@rt-labs.com>
---
 hw/sd/sdhci-internal.h | 2 ++
 hw/sd/sdhci.c          | 7 +++++++
 2 files changed, 9 insertions(+)

diff --git a/hw/sd/sdhci-internal.h b/hw/sd/sdhci-internal.h
index 756ef3f..19665fd 100644
--- a/hw/sd/sdhci-internal.h
+++ b/hw/sd/sdhci-internal.h
@@ -302,4 +302,6 @@ extern const VMStateDescription sdhci_vmstate;
 #define ESDHC_CTRL_4BITBUS              (0x1 << 1)
 #define ESDHC_CTRL_8BITBUS              (0x2 << 1)
 
+#define ESDHC_PRNSTS_SDSTB              (1 << 3)
+
 #endif
diff --git a/hw/sd/sdhci.c b/hw/sd/sdhci.c
index 8f58c31..cb82782 100644
--- a/hw/sd/sdhci.c
+++ b/hw/sd/sdhci.c
@@ -1651,6 +1651,13 @@ static uint64_t usdhc_read(void *opaque, hwaddr offset, unsigned size)
 
         break;
 
+    case SDHC_PRNSTS:
+       /* Add SDSTB (SD Clock Stable) bit to PRNSTS */
+       ret = sdhci_read(opaque, offset, size) & ~ESDHC_PRNSTS_SDSTB;
+       if (s->clkcon & SDHC_CLOCK_INT_STABLE)
+          ret |= ESDHC_PRNSTS_SDSTB;
+       break;
+
     case ESDHC_DLL_CTRL:
     case ESDHC_TUNE_CTRL_STATUS:
     case ESDHC_UNDOCUMENTED_REG27:
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [Qemu-devel] [PATCH] sdhci: add i.MX SD Stable Clock bit
  2018-08-16 12:29 [Qemu-devel] [PATCH] sdhci: add i.MX SD Stable Clock bit Hans-Erik Floryd
@ 2018-08-17 10:05 ` no-reply
  0 siblings, 0 replies; 2+ messages in thread
From: no-reply @ 2018-08-17 10:05 UTC (permalink / raw)
  To: hans-erik.floryd; +Cc: famz, qemu-trivial, f4bug, qemu-devel

Hi,

This series seems to have some coding style problems. See output below for
more information:

Type: series
Message-id: 1534422540-18815-1-git-send-email-hans-erik.floryd@rt-labs.com
Subject: [Qemu-devel] [PATCH] sdhci: add i.MX SD Stable Clock bit

=== TEST SCRIPT BEGIN ===
#!/bin/bash

BASE=base
n=1
total=$(git log --oneline $BASE.. | wc -l)
failed=0

git config --local diff.renamelimit 0
git config --local diff.renames True
git config --local diff.algorithm histogram

commits="$(git log --format=%H --reverse $BASE..)"
for c in $commits; do
    echo "Checking PATCH $n/$total: $(git log -n 1 --format=%s $c)..."
    if ! git show $c --format=email | ./scripts/checkpatch.pl --mailback -; then
        failed=1
        echo
    fi
    n=$((n+1))
done

exit $failed
=== TEST SCRIPT END ===

Updating 3c8cf5a9c21ff8782164d1def7f44bd888713384
Switched to a new branch 'test'
eeea783b72 sdhci: add i.MX SD Stable Clock bit

=== OUTPUT BEGIN ===
Checking PATCH 1/1: sdhci: add i.MX SD Stable Clock bit...
ERROR: suspect code indent for conditional statements (7, 10)
#34: FILE: hw/sd/sdhci.c:1657:
+       if (s->clkcon & SDHC_CLOCK_INT_STABLE)
+          ret |= ESDHC_PRNSTS_SDSTB;

ERROR: braces {} are necessary for all arms of this statement
#34: FILE: hw/sd/sdhci.c:1657:
+       if (s->clkcon & SDHC_CLOCK_INT_STABLE)
[...]

total: 2 errors, 0 warnings, 19 lines checked

Your patch has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.

=== OUTPUT END ===

Test command exited with code: 1


---
Email generated automatically by Patchew [http://patchew.org/].
Please send your feedback to patchew-devel@redhat.com

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-08-17 10:09 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-08-16 12:29 [Qemu-devel] [PATCH] sdhci: add i.MX SD Stable Clock bit Hans-Erik Floryd
2018-08-17 10:05 ` no-reply

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).