diff mbox

[v2,i.MX] Remove MSGDATA register support.

Message ID 20170102211110.4801-1-jcd@tribudubois.net
State New
Headers show

Commit Message

Jean-Christophe Dubois Jan. 2, 2017, 9:11 p.m. UTC
From the documentation it is not clear what this SPI register is about.

Moreover, neither linux driver nor xvisor driver are using this SPI register.

For now we just remove it and issue a log on register write access.

Signed-off-by: Jean-Christophe Dubois <jcd@tribudubois.net>
---

Changes since v1:
* Fix coding style issue.

 hw/ssi/imx_spi.c | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

Comments

Peter Maydell Jan. 6, 2017, 3:11 p.m. UTC | #1
On 2 January 2017 at 21:11, Jean-Christophe Dubois <jcd@tribudubois.net> wrote:
> From the documentation it is not clear what this SPI register is about.
>
> Moreover, neither linux driver nor xvisor driver are using this SPI register.
>
> For now we just remove it and issue a log on register write access.
>
> Signed-off-by: Jean-Christophe Dubois <jcd@tribudubois.net>
> ---
>
> Changes since v1:
> * Fix coding style issue.
>
>  hw/ssi/imx_spi.c | 11 ++++++++---
>  1 file changed, 8 insertions(+), 3 deletions(-)
>
> diff --git a/hw/ssi/imx_spi.c b/hw/ssi/imx_spi.c
> index c2d293c..3a0400e 100644
> --- a/hw/ssi/imx_spi.c
> +++ b/hw/ssi/imx_spi.c
> @@ -338,9 +338,6 @@ static void imx_spi_write(void *opaque, hwaddr offset, uint64_t value,
>                        TYPE_IMX_SPI, __func__);
>          break;
>      case ECSPI_TXDATA:
> -    case ECSPI_MSGDATA:
> -        /* Is there any difference between TXDATA and MSGDATA ? */
> -        /* I'll have to look in the linux driver */
>          if (!imx_spi_is_enabled(s)) {
>              /* Ignore writes if device is disabled */
>              break;
> @@ -391,6 +388,14 @@ static void imx_spi_write(void *opaque, hwaddr offset, uint64_t value,
>          }
>
>          break;
> +    case ECSPI_MSGDATA:
> +        /* it is not clear from the spec what MSGDATA is for */
> +        /* Anyway it is not used by Linux driver */
> +        /* So for now we just ignore it */
> +        qemu_log_mask(LOG_GUEST_ERROR,
> +                      "[%s]%s: Trying to write to MSGDATA, ignoring\n",
> +                      TYPE_IMX_SPI, __func__);
> +        break;

This should be LOG_UNIMP, not LOG_GUEST_ERROR.

thanks
-- PMM
Jean-Christophe Dubois Jan. 6, 2017, 6:21 p.m. UTC | #2
Le 06/01/2017 à 16:11, Peter Maydell a écrit :
>> +    case ECSPI_MSGDATA:
>> +        /* it is not clear from the spec what MSGDATA is for */
>> +        /* Anyway it is not used by Linux driver */
>> +        /* So for now we just ignore it */
>> +        qemu_log_mask(LOG_GUEST_ERROR,
>> +                      "[%s]%s: Trying to write to MSGDATA, ignoring\n",
>> +                      TYPE_IMX_SPI, __func__);
>> +        break;
> This should be LOG_UNIMP, not LOG_GUEST_ERROR.

OK

>
> thanks
> -- PMM
>
diff mbox

Patch

diff --git a/hw/ssi/imx_spi.c b/hw/ssi/imx_spi.c
index c2d293c..3a0400e 100644
--- a/hw/ssi/imx_spi.c
+++ b/hw/ssi/imx_spi.c
@@ -338,9 +338,6 @@  static void imx_spi_write(void *opaque, hwaddr offset, uint64_t value,
                       TYPE_IMX_SPI, __func__);
         break;
     case ECSPI_TXDATA:
-    case ECSPI_MSGDATA:
-        /* Is there any difference between TXDATA and MSGDATA ? */
-        /* I'll have to look in the linux driver */
         if (!imx_spi_is_enabled(s)) {
             /* Ignore writes if device is disabled */
             break;
@@ -391,6 +388,14 @@  static void imx_spi_write(void *opaque, hwaddr offset, uint64_t value,
         }
 
         break;
+    case ECSPI_MSGDATA:
+        /* it is not clear from the spec what MSGDATA is for */
+        /* Anyway it is not used by Linux driver */
+        /* So for now we just ignore it */
+        qemu_log_mask(LOG_GUEST_ERROR,
+                      "[%s]%s: Trying to write to MSGDATA, ignoring\n",
+                      TYPE_IMX_SPI, __func__);
+        break;
     default:
         s->regs[index] = value;