You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by je...@apache.org on 2021/05/20 05:23:57 UTC

[incubator-nuttx] branch master updated (85f0bc5 -> 6b5a4cb)

This is an automated email from the ASF dual-hosted git repository.

jerpelea pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git.


    from 85f0bc5  mm:initialize ensure alignment.
     new 9b3a80c  arch: cxd56xx: Fix uart getting stuck during a clock change
     new db340a8  arch: cxd56xx: Support for suppresion of clock change
     new 67a5641  arch: cxd56xx: Prohibit clock change during SPI transfer
     new 89fd987  arch: cxd56xx: Fix RTC alarm cancellation process
     new a276de7  arch: cxd56xx: Fix SPI setmode function
     new 09cc6b7  arch: cxd56xx: update loader and gnssfw version
     new a10a4c4  arch: cxd56xx: Add SCU register definitions
     new ade26c1  arch: cxd56xx: Update i2c register initialization
     new ba62014  arch: cxd56xx: Remove unnecessary i2c settings
     new f548ffa  arch: cxd56xx: Support execution error by SCU sequencer
     new e26da5f  arch: cxd56xx: Update isop firmware
     new 98871e5  arch: cxd56xx: Fix gnss open error by clock change
     new f0cae6c  arch: cxd56xx: Fix multiple open and close ADC driver
     new 6d3fb9e  arch: cxd56xx: wdt: Fix compile error in debug log
     new bb348cc  arch: cxd56xx: gnss: Fix compile error in debug log
     new 50cb030  arch: cxd56xx: charger: Use the dedicated debug macro
     new efd4789  arch: cxd56xx: gauge: Use the dedicated debug macro
     new 151fec4  arch: cxd56xx: Do not re-initialize the console for subcore
     new 5a7a118  arch: cxd56xx: Fix uninitialized variable for gnss driver
     new db9c949  arch: cxd56xx: Add host interface driver
     new 6b5a4cb  arch: cxd56xx: Fix parameter check of hostif buffer

The 21 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../sam34/sam_hsmci.h => include/cxd56xx/hostif.h} | 103 +--
 arch/arm/include/cxd56xx/pm.h                      |   5 +-
 arch/arm/src/cxd56xx/Kconfig                       |  40 +
 arch/arm/src/cxd56xx/Make.defs                     |   4 +
 arch/arm/src/cxd56xx/cxd56_adc.c                   |  50 +-
 arch/arm/src/cxd56xx/cxd56_charger.c               |   2 +-
 arch/arm/src/cxd56xx/cxd56_clock.c                 | 176 +++++
 arch/arm/src/cxd56xx/cxd56_clock.h                 |  40 +
 arch/arm/src/cxd56xx/cxd56_farapistub.h            |   2 +-
 arch/arm/src/cxd56xx/cxd56_gauge.c                 |  10 +-
 arch/arm/src/cxd56xx/cxd56_gnss.c                  |  24 +-
 arch/arm/src/cxd56xx/cxd56_gnss.h                  |   6 +-
 arch/arm/src/cxd56xx/cxd56_hostif.c                | 594 ++++++++++++++
 arch/arm/src/cxd56xx/cxd56_i2c.c                   |   7 +-
 arch/arm/src/cxd56xx/cxd56_icc.h                   |   1 +
 arch/arm/src/cxd56xx/cxd56_powermgr.c              |  15 +
 arch/arm/src/cxd56xx/cxd56_rtc.c                   |  36 +-
 arch/arm/src/cxd56xx/cxd56_scu.c                   |  36 +-
 arch/arm/src/cxd56xx/cxd56_serial.c                |  11 +
 arch/arm/src/cxd56xx/cxd56_spi.c                   |  50 ++
 arch/arm/src/cxd56xx/cxd56_start.c                 |   4 +-
 arch/arm/src/cxd56xx/cxd56_uart.c                  |   8 +
 arch/arm/src/cxd56xx/cxd56_wdt.c                   |   8 +-
 arch/arm/src/cxd56xx/hardware/cxd5602_isop.h       | 856 +++++++++++----------
 arch/arm/src/cxd56xx/hardware/cxd56_scu.h          |  15 +-
 arch/arm/src/cxd56xx/hardware/cxd56_scuseq.h       |   4 +
 26 files changed, 1601 insertions(+), 506 deletions(-)
 copy arch/arm/{src/sam34/sam_hsmci.h => include/cxd56xx/hostif.h} (57%)
 create mode 100644 arch/arm/src/cxd56xx/cxd56_hostif.c

[incubator-nuttx] 20/21: arch: cxd56xx: Add host interface driver

Posted by je...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

jerpelea pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git

commit db9c94962b9e24c0f173bfa805d75568f4069920
Author: SPRESENSE <41...@users.noreply.github.com>
AuthorDate: Wed May 19 18:00:25 2021 +0900

    arch: cxd56xx: Add host interface driver
    
    Add host interface driver which supports I2C or SPI slave feature.
---
 arch/arm/include/cxd56xx/hostif.h   | 136 +++++++++
 arch/arm/src/cxd56xx/Kconfig        |  39 +++
 arch/arm/src/cxd56xx/Make.defs      |   4 +
 arch/arm/src/cxd56xx/cxd56_clock.c  | 176 +++++++++++
 arch/arm/src/cxd56xx/cxd56_clock.h  |  40 +++
 arch/arm/src/cxd56xx/cxd56_hostif.c | 594 ++++++++++++++++++++++++++++++++++++
 arch/arm/src/cxd56xx/cxd56_icc.h    |   1 +
 7 files changed, 990 insertions(+)

diff --git a/arch/arm/include/cxd56xx/hostif.h b/arch/arm/include/cxd56xx/hostif.h
new file mode 100644
index 0000000..3c58bd7
--- /dev/null
+++ b/arch/arm/include/cxd56xx/hostif.h
@@ -0,0 +1,136 @@
+/****************************************************************************
+ * arch/arm/include/cxd56xx/hostif.h
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.  The
+ * ASF licenses this file to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the
+ * License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ *
+ ****************************************************************************/
+
+#ifndef __ARCH_ARM_INCLUDE_CXD56XX_HOSTIF_H
+#define __ARCH_ARM_INCLUDE_CXD56XX_HOSTIF_H
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#include <nuttx/config.h>
+#include <stdint.h>
+
+/****************************************************************************
+ * Pre-processor Definitions
+ ****************************************************************************/
+
+/* Host interface maximum number of buffers */
+
+#define MAX_BUFFER_NUM 32
+
+/* Host interface buffer attributes */
+
+#define HOSTIF_BUFF_ATTR_ADDR_OFFSET(n) (((n) & 0x3) << 4)
+                                           /* 2 to the power of n */
+#define HOSTIF_BUFF_ATTR_FIXLEN   (0 << 2) /* fixed length */
+#define HOSTIF_BUFF_ATTR_VARLEN   (1 << 2) /* variable length */
+#define HOSTIF_BUFF_ATTR_WRITE    (0 << 1) /* from target to host */
+#define HOSTIF_BUFF_ATTR_READ     (1 << 1) /* from host to target */
+
+/****************************************************************************
+ * Public Types
+ ****************************************************************************/
+
+/* Common buffer configuration */
+
+struct hostif_buff_s
+{
+  uint16_t size;
+  uint16_t flag;
+};
+
+/* I2C buffer configuration */
+
+struct hostif_i2cconf_s
+{
+  int                  address; /* slave address */
+  struct hostif_buff_s buff[MAX_BUFFER_NUM];
+};
+
+/* SPI buffer configuration */
+
+struct hostif_spiconf_s
+{
+  struct hostif_buff_s buff[MAX_BUFFER_NUM];
+};
+
+#ifndef __ASSEMBLY__
+
+#undef EXTERN
+#if defined(__cplusplus)
+#define EXTERN extern "C"
+extern "C"
+{
+#else
+#define EXTERN extern
+#endif
+
+/****************************************************************************
+ * Public Function Prototypes
+ ****************************************************************************/
+
+/****************************************************************************
+ * Name: hostif_i2cinitialize
+ *
+ * Description:
+ *   Initialize the host interface for I2C slave
+ *
+ * Input Parameter:
+ *   config - pointer to I2C buffer configuration
+ *
+ * Returned Value:
+ *   Return 0 on success. Otherwise, return a negated errno.
+ *
+ ****************************************************************************/
+
+int hostif_i2cinitialize(FAR struct hostif_i2cconf_s *config);
+
+/****************************************************************************
+ * Name: hostif_spiinitialize
+ *
+ * Description:
+ *   Initialize the host interface for SPI slave
+ *
+ * Input Parameter:
+ *   config - pointer to SPI buffer configuration
+ *
+ * Returned Value:
+ *   Return 0 on success. Otherwise, return a negated errno.
+ *
+ ****************************************************************************/
+
+int hostif_spiinitialize(FAR struct hostif_spiconf_s *config);
+
+/****************************************************************************
+ * Name: hostif_uninitialize
+ *
+ * Description:
+ *   Uninitialize the host interface
+ *
+ * Returned Value:
+ *   Return 0 on success. Otherwise, return a negated errno.
+ *
+ ****************************************************************************/
+
+int hostif_uninitialize(void);
+
+#endif /* __ASSEMBLY__ */
+#endif /* __ARCH_ARM_INCLUDE_CXD56XX_HOSTIF_H */
diff --git a/arch/arm/src/cxd56xx/Kconfig b/arch/arm/src/cxd56xx/Kconfig
index b3f525c..0a1b8ae 100644
--- a/arch/arm/src/cxd56xx/Kconfig
+++ b/arch/arm/src/cxd56xx/Kconfig
@@ -1093,6 +1093,45 @@ config CXD56_CISIF
 	default n
 	---help---
 		CMOS image sensor interface for cx5602 chip
+
+config CXD56_HOSTIF
+	bool "Host interface"
+	default n
+	---help---
+		Host interface supports I2C or SPI slave feature.
+
+config CXD56_HOSTIF_DEBUG
+	bool "Host interface Debug Features"
+	default n
+	depends on CXD56_HOSTIF
+	---help---
+		Enable host interface device debug features.
+
+if CXD56_HOSTIF_DEBUG
+
+config CXD56_HOSTIF_DEBUG_ERROR
+	bool "Host interface Error Output"
+	default n
+	depends on DEBUG_ERROR
+	---help---
+		Enable host interface error output to SYSLOG.
+
+config CXD56_HOSTIF_DEBUG_WARN
+	bool "Host interface Warnings Output"
+	default n
+	depends on DEBUG_WARN
+	---help---
+		Enable host interface warning output to SYSLOG.
+
+config CXD56_HOSTIF_DEBUG_INFO
+	bool "Host interface Informational Output"
+	default n
+	depends on DEBUG_INFO
+	---help---
+		Enable host interface informational output to SYSLOG.
+
+endif # CXD56_HOSTIF_DEBUG
+
 endmenu
 
 comment "Storage Options"
diff --git a/arch/arm/src/cxd56xx/Make.defs b/arch/arm/src/cxd56xx/Make.defs
index 1c386a0..c61a72f 100644
--- a/arch/arm/src/cxd56xx/Make.defs
+++ b/arch/arm/src/cxd56xx/Make.defs
@@ -201,3 +201,7 @@ endif
 ifeq ($(CONFIG_CXD56_BACKUPLOG),y)
 CHIP_CSRCS += cxd56_backuplog.c
 endif
+
+ifeq ($(CONFIG_CXD56_HOSTIF),y)
+CHIP_CSRCS += cxd56_hostif.c
+endif
diff --git a/arch/arm/src/cxd56xx/cxd56_clock.c b/arch/arm/src/cxd56xx/cxd56_clock.c
index a46acc3..cc8cd54 100644
--- a/arch/arm/src/cxd56xx/cxd56_clock.c
+++ b/arch/arm/src/cxd56xx/cxd56_clock.c
@@ -2291,6 +2291,182 @@ uint32_t cxd56_get_img_vsync_baseclock(void)
     }
 }
 
+static int cxd56_hostif_clock_ctrl(uint32_t block, uint32_t intr, int on)
+{
+  uint32_t val;
+  uint32_t stat;
+  int      retry = 10000;
+
+  putreg32(0xffffffff, CXD56_TOPREG_CRG_INT_CLR0);
+
+  val = getreg32(CXD56_TOPREG_SYSIOP_CKEN);
+  if (on)
+    {
+      if ((val & block) == block)
+        {
+          /* Already clock on */
+
+          return OK;
+        }
+
+      putreg32(val | block, CXD56_TOPREG_SYSIOP_CKEN);
+    }
+  else
+    {
+      if ((val & block) == 0)
+        {
+          /* Already clock off */
+
+          return OK;
+        }
+
+      putreg32(val & ~block, CXD56_TOPREG_SYSIOP_CKEN);
+    }
+
+  do
+    {
+      stat = getreg32(CXD56_TOPREG_CRG_INT_STAT_RAW0);
+      busy_wait(1000);
+    }
+  while (retry-- && !(stat & intr));
+
+  putreg32(0xffffffff, CXD56_TOPREG_CRG_INT_CLR0);
+
+  return (retry) ? OK : -ETIMEDOUT;
+}
+
+int cxd56_hostif_clock_enable(void)
+{
+  int      ret = OK;
+  uint32_t mask;
+  uint32_t intr;
+
+  /* Enable HOSTIF IRAM/DRAM & general RAM memory power. */
+
+  putreg32((0x3 << 24) | 0xf, CXD56_TOPREG_HOSTIFC_RAMMODE_SEL);
+
+  do_power_control();
+
+  mask = CKEN_HOSSPI | CKEN_HOSI2C | CKEN_HOSTIFC_SEQ | CKEN_BRG_HOST |
+    CKEN_I2CS | CKEN_PCLK_HOSTIFC | CKEN_PCLK_UART0 | CKEN_UART0;
+
+  if (getreg32(CXD56_TOPREG_SYSIOP_CKEN) & mask)
+    {
+      /* Already enabled */
+
+      return ret;
+    }
+
+  putreg32(0, CXD56_TOPREG_CKDIV_HOSTIFC);
+  putreg32(0, CXD56_TOPREG_CKSEL_SYSIOP);
+
+  mask = CKEN_HOSSPI | CKEN_HOSI2C | CKEN_BRG_HOST |
+    CKEN_I2CS | CKEN_PCLK_HOSTIFC;
+
+  intr = CRG_CK_BRG_HOST | CRG_CK_I2CS | CRG_CK_PCLK_HOSTIFC;
+
+  ret = cxd56_hostif_clock_ctrl(mask, intr, 1);
+  if (ret < 0)
+    {
+      return ret;
+    }
+
+  ret = cxd56_hostif_clock_ctrl(mask, intr, 0);
+  if (ret < 0)
+    {
+      return ret;
+    }
+
+  modifyreg32(CXD56_TOPREG_SWRESET_BUS, 0, XRST_HOSTIFC);
+  ret = cxd56_hostif_clock_ctrl(mask, intr, 1);
+
+  return ret;
+}
+
+int cxd56_hostif_clock_disable(void)
+{
+  int      ret = OK;
+  uint32_t mask;
+  uint32_t intr;
+
+  mask = CKEN_HOSSPI | CKEN_HOSI2C | CKEN_HOSTIFC_SEQ | CKEN_BRG_HOST |
+    CKEN_I2CS |  CKEN_PCLK_HOSTIFC |  CKEN_PCLK_UART0 |  CKEN_UART0;
+
+  if (0 == (getreg32(CXD56_TOPREG_SYSIOP_CKEN) & mask))
+    {
+      /* Already disabled */
+
+      return ret;
+    }
+
+  mask = CKEN_HOSSPI | CKEN_HOSI2C | CKEN_BRG_HOST |
+    CKEN_I2CS |  CKEN_PCLK_HOSTIFC;
+
+  intr = CRG_CK_BRG_HOST | CRG_CK_I2CS | CRG_CK_PCLK_HOSTIFC;
+
+  ret = cxd56_hostif_clock_ctrl(mask, intr, 0);
+  if (ret < 0)
+    {
+      return ret;
+    }
+
+  modifyreg32(CXD56_TOPREG_SWRESET_BUS, XRST_HOSTIFC, 0);
+
+  /* Disable HOSTIF IRAM/DRAM & general RAM memory power. */
+
+  putreg32(0x3, CXD56_TOPREG_HOSTIFC_RAMMODE_SEL);
+
+  do_power_control();
+
+  return ret;
+}
+
+int cxd56_hostseq_clock_enable(void)
+{
+  int ret = OK;
+
+  if (getreg32(CXD56_TOPREG_SYSIOP_CKEN) & CKEN_HOSTIFC_SEQ)
+    {
+      /* Already enabled */
+
+      return ret;
+    }
+
+  ret = cxd56_hostif_clock_ctrl(CKEN_HOSTIFC_SEQ, CRG_CK_HOSTIFC_SEQ, 1);
+  if (ret < 0)
+    {
+      return ret;
+    }
+
+  ret = cxd56_hostif_clock_ctrl(CKEN_HOSTIFC_SEQ, CRG_CK_HOSTIFC_SEQ, 0);
+  if (ret < 0)
+    {
+      return ret;
+    }
+
+  modifyreg32(CXD56_TOPREG_SWRESET_BUS, 0, XRST_HOSTIFC_ISOP);
+  ret = cxd56_hostif_clock_ctrl(CKEN_HOSTIFC_SEQ, CRG_CK_HOSTIFC_SEQ, 1);
+
+  return ret;
+}
+
+int cxd56_hostseq_clock_disable(void)
+{
+  int ret = OK;
+
+  if (0 == (getreg32(CXD56_TOPREG_SYSIOP_CKEN) & CKEN_HOSTIFC_SEQ))
+    {
+      /* Already disabled */
+
+      return ret;
+    }
+
+  modifyreg32(CXD56_TOPREG_SWRESET_BUS, XRST_HOSTIFC_ISOP, 0);
+  ret = cxd56_hostif_clock_ctrl(CKEN_HOSTIFC_SEQ, CRG_CK_HOSTIFC_SEQ, 0);
+
+  return ret;
+}
+
 int up_pmramctrl(int cmd, uintptr_t addr, size_t size)
 {
   int startidx;
diff --git a/arch/arm/src/cxd56xx/cxd56_clock.h b/arch/arm/src/cxd56xx/cxd56_clock.h
index 1f488ed..81014ca 100644
--- a/arch/arm/src/cxd56xx/cxd56_clock.h
+++ b/arch/arm/src/cxd56xx/cxd56_clock.h
@@ -684,6 +684,46 @@ uint32_t cxd56_get_img_vsync_baseclock(void);
 
 uint32_t cxd56_get_appsmp_baseclock(void);
 
+/****************************************************************************
+ * Name: cxd56_hostif_clock_enable
+ *
+ * Description:
+ *   Enable clock of the hostif block
+ *
+ ****************************************************************************/
+
+int cxd56_hostif_clock_enable(void);
+
+/****************************************************************************
+ * Name: cxd56_hostif_clock_disable
+ *
+ * Description:
+ *   Disable clock of the hostif block
+ *
+ ****************************************************************************/
+
+int cxd56_hostif_clock_disable(void);
+
+/****************************************************************************
+ * Name: cxd56_hostseq_clock_enable
+ *
+ * Description:
+ *   Enable clock of the hostif sequencer block
+ *
+ ****************************************************************************/
+
+int cxd56_hostseq_clock_enable(void);
+
+/****************************************************************************
+ * Name: cxd56_hostseq_clock_disable
+ *
+ * Description:
+ *   Disable clock of the hostif sequencer block
+ *
+ ****************************************************************************/
+
+int cxd56_hostseq_clock_disable(void);
+
 #undef EXTERN
 #if defined(__cplusplus)
 }
diff --git a/arch/arm/src/cxd56xx/cxd56_hostif.c b/arch/arm/src/cxd56xx/cxd56_hostif.c
new file mode 100644
index 0000000..c0d3934
--- /dev/null
+++ b/arch/arm/src/cxd56xx/cxd56_hostif.c
@@ -0,0 +1,594 @@
+/****************************************************************************
+ * arch/arm/src/cxd56xx/cxd56_hostif.c
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.  The
+ * ASF licenses this file to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the
+ * License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ *
+ ****************************************************************************/
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#include <nuttx/config.h>
+#include <nuttx/kmalloc.h>
+#include <nuttx/irq.h>
+
+#include <stdio.h>
+#include <stdint.h>
+#include <stdbool.h>
+#include <string.h>
+#include <semaphore.h>
+#include <fcntl.h>
+#include <debug.h>
+#include <errno.h>
+
+#include <arch/chip/hostif.h>
+
+#include "chip.h"
+#include "up_arch.h"
+
+#include "cxd56_clock.h"
+#include "cxd56_pinconfig.h"
+#include "cxd56_icc.h"
+
+/****************************************************************************
+ * Pre-processor Definitions
+ ****************************************************************************/
+
+/* Debug */
+
+#ifdef CONFIG_CXD56_HOSTIF_DEBUG_ERROR
+#define hiferr(format, ...)   _err(format, ##__VA_ARGS__)
+#else
+#define hiferr(x, ...)
+#endif
+#ifdef CONFIG_CXD56_HOSTIF_DEBUG_WARN
+#define hifwarn(format, ...)  _warn(format, ##__VA_ARGS__)
+#else
+#define hifwarn(x, ...)
+#endif
+#ifdef CONFIG_CXD56_HOSTIF_DEBUG_INFO
+#define hifinfo(format, ...)  _info(format, ##__VA_ARGS__)
+#else
+#define hifinfo(x, ...)
+#endif
+
+/* Message id definitions */
+
+#define HIF_I2C_INIT      1
+#define HIF_SPI_INIT      2
+#define HIF_READ_DEVICE   3
+#define HIF_WRITE_DEVICE  4
+
+/* Message timeout definition in units of msec */
+
+#define HIF_TIMEOUT 5000
+
+/****************************************************************************
+ * Private Types
+ ****************************************************************************/
+
+/* Host interface device structure for each buffer */
+
+struct cxd56_hifdev_s
+{
+  int           id;
+  uint32_t      flags;
+  const void    *buffer;
+  size_t        len;
+  sem_t         exclsem;
+  int           crefs;
+};
+
+/* Host interface driver structure */
+
+struct cxd56_hifdrv_s
+{
+  struct cxd56_hifdev_s *dev;
+  int           ndev;
+  sem_t         sync;
+  int           errcode;
+};
+
+/****************************************************************************
+ * Private Function Prototypes
+ ****************************************************************************/
+
+/* Character driver methods */
+
+static int     hif_open(FAR struct file *filep);
+static int     hif_close(FAR struct file *filep);
+static off_t   hif_seek(FAR struct file *filep, off_t offset,
+                        int whence);
+static ssize_t hif_read(FAR struct file *filep, FAR char *buffer,
+                        size_t len);
+static ssize_t hif_write(FAR struct file *filep,
+                         FAR const char *buffer, size_t len);
+static int     hif_ioctl(FAR struct file *filep, int cmd,
+                         unsigned long arg);
+static int     hif_poll(FAR struct file *filep, FAR struct pollfd *fds,
+                        bool setup);
+static int     hif_unlink(FAR struct inode *inode);
+
+/****************************************************************************
+ * Private Data
+ ****************************************************************************/
+
+/* Host interface driver */
+
+static struct cxd56_hifdrv_s g_hifdrv;
+
+/* Host interface operations */
+
+static const struct file_operations g_hif_fops =
+{
+  hif_open,    /* open */
+  hif_close,   /* close */
+  hif_read,    /* read */
+  hif_write,   /* write */
+  hif_seek,    /* seek */
+  hif_ioctl,   /* ioctl */
+  hif_poll,    /* poll */
+  hif_unlink   /* unlink */
+};
+
+/****************************************************************************
+ * Private Functions
+ ****************************************************************************/
+
+static int hif_sendmsg(uint8_t id, void *arg)
+{
+  struct cxd56_hifdrv_s *drv = &g_hifdrv;
+  iccmsg_t msg;
+  int ret;
+
+  /* Check parameters */
+
+  DEBUGASSERT((HIF_I2C_INIT <= id) && (id <= HIF_WRITE_DEVICE));
+  DEBUGASSERT(arg);
+
+  /* Send any message to system CPU */
+
+  msg.cpuid = 0;
+  msg.msgid = id;
+  msg.protodata = id;
+  msg.data  = (uint32_t)arg;
+
+  ret = cxd56_iccsend(CXD56_PROTO_HOSTIF, &msg, HIF_TIMEOUT);
+  if (ret < 0)
+    {
+      hiferr("ERROR: Send message (%d)\n", ret);
+      return ret;
+    }
+
+  /* Wait for reply message from system CPU */
+
+  nxsem_wait_uninterruptible(&drv->sync);
+
+  /* Get the error code returned from system cpu */
+
+  ret = drv->errcode;
+
+  return ret;
+}
+
+static int hif_open(FAR struct file *filep)
+{
+  FAR struct inode *inode;
+  FAR struct cxd56_hifdev_s *priv;
+
+  DEBUGASSERT(filep && filep->f_inode);
+  inode = filep->f_inode;
+
+  priv = (FAR struct cxd56_hifdev_s *)inode->i_private;
+  DEBUGASSERT(priv);
+
+  /* Check parameters */
+
+  if ((filep->f_oflags & O_WRONLY) != 0 &&
+      (filep->f_oflags & O_RDONLY) != 0)
+    {
+      return -EACCES;
+    }
+
+  if ((filep->f_oflags & O_RDONLY) &&
+      ((priv->flags & HOSTIF_BUFF_ATTR_READ) == 0))
+    {
+      return -EINVAL;
+    }
+
+  if ((filep->f_oflags & O_WRONLY) &&
+      ((priv->flags & HOSTIF_BUFF_ATTR_WRITE) != 0))
+    {
+      return -EINVAL;
+    }
+
+  /* Increment reference counter */
+
+  nxsem_wait_uninterruptible(&priv->exclsem);
+
+  priv->crefs++;
+  DEBUGASSERT(priv->crefs > 0);
+
+  if (priv->crefs > 1)
+    {
+      nxsem_post(&priv->exclsem);
+      return OK;
+    }
+
+  /* Check if non-blocking mode */
+
+  if (filep->f_oflags & O_NONBLOCK)
+    {
+      priv->flags |= O_NONBLOCK;
+    }
+
+  nxsem_post(&priv->exclsem);
+
+  return OK;
+}
+
+static int hif_close(FAR struct file *filep)
+{
+  FAR struct inode *inode;
+  FAR struct cxd56_hifdev_s *priv;
+
+  DEBUGASSERT(filep && filep->f_inode);
+  inode = filep->f_inode;
+
+  priv = (FAR struct cxd56_hifdev_s *)inode->i_private;
+  DEBUGASSERT(priv);
+
+  /* Decrement reference counter */
+
+  nxsem_wait_uninterruptible(&priv->exclsem);
+
+  DEBUGASSERT(priv->crefs > 0);
+  priv->crefs--;
+
+  nxsem_post(&priv->exclsem);
+
+  return OK;
+}
+
+static off_t hif_seek(FAR struct file *filep, off_t offset, int whence)
+{
+  return OK;
+}
+
+static ssize_t hif_read(FAR struct file *filep, FAR char *buffer, size_t len)
+{
+  FAR struct inode *inode;
+  FAR struct cxd56_hifdev_s *priv;
+  int ret;
+
+  DEBUGASSERT(filep && filep->f_inode);
+  inode = filep->f_inode;
+
+  priv = (FAR struct cxd56_hifdev_s *)inode->i_private;
+  DEBUGASSERT(priv);
+
+  /* Check parameters */
+
+  DEBUGASSERT(buffer);
+
+  if ((filep->f_oflags & O_RDONLY) == 0)
+    {
+      return -EACCES;
+    }
+
+  /* Receive data from host */
+
+  priv->buffer = buffer;
+  priv->len = len;
+
+  ret = hif_sendmsg(HIF_READ_DEVICE, priv);
+
+  return ret;
+}
+
+static ssize_t hif_write(FAR struct file *filep,
+                         FAR const char *buffer, size_t len)
+{
+  FAR struct inode *inode;
+  FAR struct cxd56_hifdev_s *priv;
+  int ret;
+
+  DEBUGASSERT(filep && filep->f_inode);
+  inode = filep->f_inode;
+
+  priv = (FAR struct cxd56_hifdev_s *)inode->i_private;
+  DEBUGASSERT(priv);
+
+  /* Check parameters */
+
+  DEBUGASSERT(buffer);
+
+  if ((filep->f_oflags & O_WRONLY) == 0)
+    {
+      return -EACCES;
+    }
+
+  /* Send data to host */
+
+  priv->buffer = buffer;
+  priv->len = len;
+
+  ret = hif_sendmsg(HIF_WRITE_DEVICE, priv);
+
+  return ret;
+}
+
+static int hif_ioctl(FAR struct file *filep, int cmd, unsigned long arg)
+{
+  return OK;
+}
+
+static int hif_poll(FAR struct file *filep,
+                    FAR struct pollfd *fds, bool setup)
+{
+  return OK;
+}
+
+static int hif_unlink(FAR struct inode *inode)
+{
+  return OK;
+}
+
+static int hif_rxhandler(int cpuid, int protoid,
+                         uint32_t pdata, uint32_t data,
+                         FAR void *userdata)
+{
+  struct cxd56_hifdrv_s *drv = &g_hifdrv;
+
+  DEBUGASSERT(cpuid == 0);
+  DEBUGASSERT(protoid == CXD56_PROTO_HOSTIF);
+
+  drv->errcode = (int)data;
+
+  nxsem_post(&drv->sync);
+
+  return OK;
+}
+
+static int hif_initialize(struct hostif_buff_s *buffer)
+{
+  struct cxd56_hifdrv_s *drv = &g_hifdrv;
+  struct cxd56_hifdev_s *priv;
+  char devpath[16];
+  int num;
+  int ret;
+
+  /* Check parameters */
+
+  DEBUGASSERT(buffer);
+
+  memset(drv, 0, sizeof(struct cxd56_hifdrv_s));
+
+  /* Get the number of devices */
+
+  for (num = 0; num < MAX_BUFFER_NUM; num++)
+    {
+      if (buffer[num].size == 0)
+        {
+          break;
+        }
+    }
+
+  /* Setup driver structure */
+
+  drv->dev =
+    (struct cxd56_hifdev_s *)kmm_malloc(sizeof(struct cxd56_hifdev_s) * num);
+  if (drv->dev == NULL)
+    {
+      hiferr("ERROR: hostif allocation failed\n");
+
+      return -ENOMEM;
+    }
+
+  drv->ndev = num;
+
+  /* Setup each device structure */
+
+  for (num = 0; num < drv->ndev; num++)
+    {
+      priv = &drv->dev[num];
+
+      priv->id = num;
+      priv->flags = buffer[num].flag;
+      snprintf(devpath, sizeof(devpath), "/dev/hostif%c%d",
+               (priv->flags & HOSTIF_BUFF_ATTR_READ) ? 'r' : 'w', num);
+
+      ret = register_driver(devpath, &g_hif_fops, 0666, priv);
+      if (ret < 0)
+        {
+          hiferr("ERROR: Failed to register %s (%d)\n", devpath, ret);
+          kmm_free(drv->dev);
+          return ret;
+        }
+
+      nxsem_init(&priv->exclsem, 0, 1);
+      priv->crefs = 0;
+    }
+
+  /* Enable hostif clock */
+
+  ret = cxd56_hostif_clock_enable();
+  if (ret < 0)
+    {
+      hiferr("ERROR: Enable clock (%d)\n", ret);
+      kmm_free(drv->dev);
+      return ret;
+    }
+
+  /* Initialize communication with system CPU */
+
+  cxd56_iccinit(CXD56_PROTO_HOSTIF);
+
+  nxsem_init(&drv->sync, 0, 0);
+  nxsem_setprotocol(&drv->sync, SEM_PRIO_NONE);
+
+  ret = cxd56_iccregisterhandler(CXD56_PROTO_HOSTIF, hif_rxhandler, NULL);
+
+  return ret;
+}
+
+/****************************************************************************
+ * Public Functions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Name: hostif_i2cinitialize
+ *
+ * Description:
+ *   Initialize the host interface for I2C slave
+ *
+ * Input Parameter:
+ *   config - pointer to I2C buffer configuration
+ *
+ * Returned Value:
+ *   Return 0 on success. Otherwise, return a negated errno.
+ *
+ ****************************************************************************/
+
+int hostif_i2cinitialize(struct hostif_i2cconf_s *config)
+{
+  int ret;
+
+  DEBUGASSERT(config);
+
+  /* Initialize common driver */
+
+  ret = hif_initialize(config->buff);
+  if (ret < 0)
+    {
+      hiferr("ERROR: Failed to initialize (%d)\n", ret);
+      return ret;
+    }
+
+  /* Initialize I2C driver */
+
+  ret = hif_sendmsg(HIF_I2C_INIT, config);
+  if (ret < 0)
+    {
+      hiferr("ERROR: Initialize I2C (%d)\n", ret);
+      return ret;
+    }
+
+  /* Enable hostif sequencer clock */
+
+  ret = cxd56_hostseq_clock_enable();
+  if (ret < 0)
+    {
+      hiferr("ERROR: Enable sequencer clock (%d)\n", ret);
+      return ret;
+    }
+
+  /* Pin setting */
+
+  CXD56_PIN_CONFIGS(PINCONFS_SPI2A_I2C3);
+
+  return OK;
+}
+
+/****************************************************************************
+ * Name: hostif_spiinitialize
+ *
+ * Description:
+ *   Initialize the host interface for SPI slave
+ *
+ * Input Parameter:
+ *   config - pointer to SPI buffer configuration
+ *
+ * Returned Value:
+ *   Return 0 on success. Otherwise, return a negated errno.
+ *
+ ****************************************************************************/
+
+int hostif_spiinitialize(struct hostif_spiconf_s *config)
+{
+  int ret;
+
+  DEBUGASSERT(config);
+
+  /* Initialize common driver */
+
+  ret = hif_initialize(config->buff);
+  if (ret < 0)
+    {
+      hiferr("ERROR: Failed to initialize (%d)\n", ret);
+      return ret;
+    }
+
+  /* Initialize SPI driver */
+
+  ret = hif_sendmsg(HIF_SPI_INIT, config);
+  if (ret < 0)
+    {
+      hiferr("ERROR: Initialize SPI (%d)\n", ret);
+      return ret;
+    }
+
+  /* Enable hostif sequencer clock */
+
+  ret = cxd56_hostseq_clock_enable();
+  if (ret < 0)
+    {
+      hiferr("ERROR: Enable sequencer clock (%d)\n", ret);
+      return ret;
+    }
+
+  /* Pin setting */
+
+  CXD56_PIN_CONFIGS(PINCONFS_SPI2);
+
+  return OK;
+}
+
+/****************************************************************************
+ * Name: hostif_uninitialize
+ *
+ * Description:
+ *   Uninitialize the host interface
+ *
+ * Returned Value:
+ *   Return 0 on success. Otherwise, return a negated errno.
+ *
+ ****************************************************************************/
+
+int hostif_uninitialize(void)
+{
+  struct cxd56_hifdrv_s *drv = &g_hifdrv;
+  struct cxd56_hifdev_s *priv;
+  char devpath[16];
+  int num;
+
+  for (num = 0; num < drv->ndev; num++)
+    {
+      priv = &drv->dev[num];
+
+      snprintf(devpath, sizeof(devpath), "/dev/hostif%c%d",
+               (priv->flags & HOSTIF_BUFF_ATTR_READ) ? 'r' : 'w', num);
+      unregister_driver(devpath);
+    }
+
+  if (drv->dev)
+    {
+      kmm_free(drv->dev);
+    }
+
+  return OK;
+}
diff --git a/arch/arm/src/cxd56xx/cxd56_icc.h b/arch/arm/src/cxd56xx/cxd56_icc.h
index a277749..59d9ed0 100644
--- a/arch/arm/src/cxd56xx/cxd56_icc.h
+++ b/arch/arm/src/cxd56xx/cxd56_icc.h
@@ -32,6 +32,7 @@
 #define CXD56_PROTO_HOTSLEEP  8
 #define CXD56_PROTO_IMAGE     9
 #define CXD56_PROTO_PM       10 /* Power manager */
+#define CXD56_PROTO_HOSTIF   11
 #define CXD56_PROTO_SYSCTL   12
 #define CXD56_PROTO_GNSS     13
 #define CXD56_PROTO_SIG      15 /* Inter-CPU Comm signal */

[incubator-nuttx] 05/21: arch: cxd56xx: Fix SPI setmode function

Posted by je...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

jerpelea pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git

commit a276de741f448dd4b9cbebd792fc38b1d4bdddd1
Author: SPRESENSE <41...@users.noreply.github.com>
AuthorDate: Wed May 19 17:04:05 2021 +0900

    arch: cxd56xx: Fix SPI setmode function
    
    When SSP mode is changed, SSE bit of SSPCR1 register must be disabled.
---
 arch/arm/src/cxd56xx/cxd56_spi.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/arch/arm/src/cxd56xx/cxd56_spi.c b/arch/arm/src/cxd56xx/cxd56_spi.c
index f537e60..ac3c60c 100644
--- a/arch/arm/src/cxd56xx/cxd56_spi.c
+++ b/arch/arm/src/cxd56xx/cxd56_spi.c
@@ -509,6 +509,7 @@ static void spi_setmode(FAR struct spi_dev_s *dev, enum spi_mode_e mode)
 {
   FAR struct cxd56_spidev_s *priv = (FAR struct cxd56_spidev_s *)dev;
   uint32_t regval;
+  uint32_t cr1val;
 
   /* Has the mode changed? */
 
@@ -551,8 +552,19 @@ static void spi_setmode(FAR struct spi_dev_s *dev, enum spi_mode_e mode)
             return;
         }
 
+      /* Disable SSE */
+
+      cr1val = spi_getreg(priv, CXD56_SPI_CR1_OFFSET);
+      spi_putreg(priv, CXD56_SPI_CR1_OFFSET, cr1val & ~SPI_CR1_SSE);
+
       spi_putreg(priv, CXD56_SPI_CR0_OFFSET, regval);
 
+      /* Enable SSE after a few microseconds delay */
+
+      up_udelay(3);
+
+      spi_putreg(priv, CXD56_SPI_CR1_OFFSET, cr1val);
+
       /* Enable clock gating (clock disable) */
 
       cxd56_spi_clock_gate_enable(priv->port);

[incubator-nuttx] 02/21: arch: cxd56xx: Support for suppresion of clock change

Posted by je...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

jerpelea pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git

commit db340a8941769712bc5e2b93d0aae1ca48628243
Author: SPRESENSE <41...@users.noreply.github.com>
AuthorDate: Wed May 19 17:03:49 2021 +0900

    arch: cxd56xx: Support for suppresion of clock change
    
    Introduce PM_CPUFREQLOCK_FLAG_HOLD into the frequency lock mechanism in
    power manager, which is used to keep the current frequency without clock
    change, for example, during the transfer of a periphral.
---
 arch/arm/include/cxd56xx/pm.h         |  5 +++--
 arch/arm/src/cxd56xx/cxd56_powermgr.c | 15 +++++++++++++++
 2 files changed, 18 insertions(+), 2 deletions(-)

diff --git a/arch/arm/include/cxd56xx/pm.h b/arch/arm/include/cxd56xx/pm.h
index 824a0a3..fe3ab71 100644
--- a/arch/arm/include/cxd56xx/pm.h
+++ b/arch/arm/include/cxd56xx/pm.h
@@ -62,8 +62,9 @@
 
 /* FrequencyLock request flag definitions */
 
-#define PM_CPUFREQLOCK_FLAG_HV (0x0001) /* request HV */
-#define PM_CPUFREQLOCK_FLAG_LV (0x4000) /* request LV */
+#define PM_CPUFREQLOCK_FLAG_HV (0x0001)   /* request HV */
+#define PM_CPUFREQLOCK_FLAG_LV (0x4000)   /* request LV */
+#define PM_CPUFREQLOCK_FLAG_HOLD (0x8000) /* hold the current frequency */
 
 /* FrequencyLock identifier tag helper macro function */
 
diff --git a/arch/arm/src/cxd56xx/cxd56_powermgr.c b/arch/arm/src/cxd56xx/cxd56_powermgr.c
index 489216a..00acf5f 100644
--- a/arch/arm/src/cxd56xx/cxd56_powermgr.c
+++ b/arch/arm/src/cxd56xx/cxd56_powermgr.c
@@ -577,6 +577,13 @@ void up_pm_acquire_freqlock(struct pm_cpu_freqlock_s *lock)
 
   cxd56_pm_semtake(&g_freqlock);
 
+  if (lock->flag == PM_CPUFREQLOCK_FLAG_HOLD)
+    {
+      /* Return with holding the current frequency */
+
+      return;
+    }
+
   for (entry = sq_peek(&g_freqlockqueue); entry; entry = sq_next(entry))
     {
       if (entry == (struct sq_entry_s *)lock)
@@ -616,6 +623,13 @@ void up_pm_release_freqlock(struct pm_cpu_freqlock_s *lock)
 
   DEBUGASSERT(lock);
 
+  if (lock->flag == PM_CPUFREQLOCK_FLAG_HOLD)
+    {
+      /* Release holding the current frequency */
+
+      goto exit;
+    }
+
   up_pm_acquire_wakelock(&g_wlock);
 
   cxd56_pm_semtake(&g_freqlock);
@@ -634,6 +648,7 @@ void up_pm_release_freqlock(struct pm_cpu_freqlock_s *lock)
         }
     }
 
+exit:
   nxsem_post(&g_freqlock);
 
   up_pm_release_wakelock(&g_wlock);

[incubator-nuttx] 16/21: arch: cxd56xx: charger: Use the dedicated debug macro

Posted by je...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

jerpelea pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git

commit 50cb0306b6f10df4b049d8d38f3387b9d5667a2b
Author: SPRESENSE <41...@users.noreply.github.com>
AuthorDate: Wed May 19 17:04:34 2021 +0900

    arch: cxd56xx: charger: Use the dedicated debug macro
    
    Replace to the battery dedicated debug macro instead of standard one.
---
 arch/arm/src/cxd56xx/cxd56_charger.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/src/cxd56xx/cxd56_charger.c b/arch/arm/src/cxd56xx/cxd56_charger.c
index 48d9bf9..c880e32 100644
--- a/arch/arm/src/cxd56xx/cxd56_charger.c
+++ b/arch/arm/src/cxd56xx/cxd56_charger.c
@@ -672,7 +672,7 @@ int cxd56_charger_initialize(FAR const char *devpath)
   ret = register_driver(devpath, &g_chargerops, 0666, priv);
   if (ret < 0)
     {
-      _err("ERROR: register_driver failed: %d\n", ret);
+      baterr("ERROR: register_driver failed: %d\n", ret);
       return -EFAULT;
     }
 

[incubator-nuttx] 03/21: arch: cxd56xx: Prohibit clock change during SPI transfer

Posted by je...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

jerpelea pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git

commit 67a56410ee729c3a36d830ac89cea8782cd211c7
Author: SPRESENSE <41...@users.noreply.github.com>
AuthorDate: Wed May 19 17:03:58 2021 +0900

    arch: cxd56xx: Prohibit clock change during SPI transfer
    
    If the system clock is changed during the SPI transfer, the SPI data can
    be corrupted. So this commit prohibits the clock change during SPI transfer,
    and keep the clock until the transfer is completed.
---
 arch/arm/src/cxd56xx/cxd56_spi.c | 38 ++++++++++++++++++++++++++++++++++++++
 1 file changed, 38 insertions(+)

diff --git a/arch/arm/src/cxd56xx/cxd56_spi.c b/arch/arm/src/cxd56xx/cxd56_spi.c
index 5a648ed..f537e60 100644
--- a/arch/arm/src/cxd56xx/cxd56_spi.c
+++ b/arch/arm/src/cxd56xx/cxd56_spi.c
@@ -33,6 +33,7 @@
 #include <string.h>
 
 #include <arch/board/board.h>
+#include <arch/chip/pm.h>
 #include <nuttx/irq.h>
 #include <nuttx/arch.h>
 #include <nuttx/semaphore.h>
@@ -327,6 +328,11 @@ static struct cxd56_spidev_s g_spi3dev =
 };
 #endif
 
+/* Inhibit clock change */
+
+static struct pm_cpu_freqlock_s g_hold_lock =
+  PM_CPUFREQLOCK_INIT(0, PM_CPUFREQLOCK_FLAG_HOLD);
+
 /****************************************************************************
  * Public Data
  ****************************************************************************/
@@ -643,6 +649,10 @@ static uint32_t spi_send(FAR struct spi_dev_s *dev, uint32_t wd)
   register uint32_t regval;
   register uint32_t cr1val = 0;
 
+  /* Prohibit the clock change during SPI transfer */
+
+  up_pm_acquire_freqlock(&g_hold_lock);
+
   /* Disable clock gating (clock enable) */
 
   cxd56_spi_clock_gate_disable(priv->port);
@@ -683,6 +693,10 @@ static uint32_t spi_send(FAR struct spi_dev_s *dev, uint32_t wd)
 
   cxd56_spi_clock_gate_enable(priv->port);
 
+  /* Allow the clock change after SPI transfer */
+
+  up_pm_release_freqlock(&g_hold_lock);
+
   return regval;
 }
 
@@ -737,6 +751,10 @@ static void spi_do_exchange(FAR struct spi_dev_s *dev,
   tx.pv = txbuffer;
   rx.pv = rxbuffer;
 
+  /* Prohibit the clock change during SPI transfer */
+
+  up_pm_acquire_freqlock(&g_hold_lock);
+
   /* Disable clock gating (clock enable) */
 
   cxd56_spi_clock_gate_disable(priv->port);
@@ -811,6 +829,10 @@ static void spi_do_exchange(FAR struct spi_dev_s *dev,
   /* Enable clock gating (clock disable) */
 
   cxd56_spi_clock_gate_enable(priv->port);
+
+  /* Allow the clock change after SPI transfer */
+
+  up_pm_release_freqlock(&g_hold_lock);
 }
 
 /****************************************************************************
@@ -1350,6 +1372,10 @@ void spi_flush(FAR struct spi_dev_s *dev)
   FAR struct cxd56_spidev_s *priv = (FAR struct cxd56_spidev_s *)dev;
   uint32_t regval                 = 0;
 
+  /* Prohibit the clock change during SPI transfer */
+
+  up_pm_acquire_freqlock(&g_hold_lock);
+
   /* Disable clock gating (clock enable) */
 
   cxd56_spi_clock_gate_disable(priv->port);
@@ -1393,6 +1419,10 @@ void spi_flush(FAR struct spi_dev_s *dev)
   /* Enable clock gating (clock disable) */
 
   cxd56_spi_clock_gate_enable(priv->port);
+
+  /* Allow the clock change after SPI transfer */
+
+  up_pm_release_freqlock(&g_hold_lock);
 }
 
 #ifdef CONFIG_CXD56_DMAC
@@ -1414,6 +1444,10 @@ static void spi_dmaexchange(FAR struct spi_dev_s *dev,
 
   DEBUGASSERT(priv && priv->spibase);
 
+  /* Prohibit the clock change during SPI transfer */
+
+  up_pm_acquire_freqlock(&g_hold_lock);
+
   /* Disable clock gating (clock enable) */
 
   cxd56_spi_clock_gate_disable(priv->port);
@@ -1450,6 +1484,10 @@ static void spi_dmaexchange(FAR struct spi_dev_s *dev,
   /* Enable clock gating (clock disable) */
 
   cxd56_spi_clock_gate_enable(priv->port);
+
+  /* Allow the clock change after SPI transfer */
+
+  up_pm_release_freqlock(&g_hold_lock);
 }
 
 #ifndef CONFIG_SPI_EXCHANGE

[incubator-nuttx] 17/21: arch: cxd56xx: gauge: Use the dedicated debug macro

Posted by je...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

jerpelea pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git

commit efd4789b72c985235f964df06a90886ac51f13f5
Author: SPRESENSE <41...@users.noreply.github.com>
AuthorDate: Wed May 19 17:04:37 2021 +0900

    arch: cxd56xx: gauge: Use the dedicated debug macro
    
    Replace to the battery dedicated debug macro instead of standard one.
---
 arch/arm/src/cxd56xx/cxd56_gauge.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/arch/arm/src/cxd56xx/cxd56_gauge.c b/arch/arm/src/cxd56xx/cxd56_gauge.c
index 1decda4..769838a 100644
--- a/arch/arm/src/cxd56xx/cxd56_gauge.c
+++ b/arch/arm/src/cxd56xx/cxd56_gauge.c
@@ -52,11 +52,11 @@
 /* Debug ********************************************************************/
 
 #ifdef CONFIG_CXD56_GAUGE_DEBUG
-#define baterr(fmt, ...) logerr(fmt, ## __VA_ARGS__)
-#define batdbg(fmt, ...) logdebug(fmt, ## __VA_ARGS__)
+#define baterr(fmt, ...)  _err(fmt, ## __VA_ARGS__)
+#define batinfo(fmt, ...) _info(fmt, ## __VA_ARGS__)
 #else
 #define baterr(fmt, ...)
-#define batdbg(fmt, ...)
+#define batinfo(fmt, ...)
 #endif
 
 /****************************************************************************
@@ -152,7 +152,7 @@ static int gauge_get_status(FAR enum battery_gauge_status_e *status)
         break;
 
       default:
-        _info("Charge state %d\n", state);
+        batinfo("Charge state %d\n", state);
         *status = BATTERY_IDLE;
         break;
     }
@@ -394,7 +394,7 @@ int cxd56_gauge_initialize(FAR const char *devpath)
   ret = register_driver(devpath, &g_gaugeops, 0666, priv);
   if (ret < 0)
     {
-      _err("ERROR: register_driver failed: %d\n", ret);
+      baterr("ERROR: register_driver failed: %d\n", ret);
       return -EFAULT;
     }
 

[incubator-nuttx] 08/21: arch: cxd56xx: Update i2c register initialization

Posted by je...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

jerpelea pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git

commit ade26c17d23c8d0b57e7e2e4c44ef06b569bff11
Author: SPRESENSE <41...@users.noreply.github.com>
AuthorDate: Wed May 19 17:04:13 2021 +0900

    arch: cxd56xx: Update i2c register initialization
    
    Enable RX_FIFO_FULL_HLD_CTRL and RESTART of i2c control register in
    i2c initial settings for transfer by SCU sequencer.
---
 arch/arm/src/cxd56xx/cxd56_i2c.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/arch/arm/src/cxd56xx/cxd56_i2c.c b/arch/arm/src/cxd56xx/cxd56_i2c.c
index 5b0d29a..eb7ea61 100644
--- a/arch/arm/src/cxd56xx/cxd56_i2c.c
+++ b/arch/arm/src/cxd56xx/cxd56_i2c.c
@@ -1028,7 +1028,9 @@ struct i2c_master_s *cxd56_i2cbus_initialize(int port)
   i2c_reg_write(priv, CXD56_IC_SDA_HOLD, 1);
 
   i2c_reg_write(priv, CXD56_IC_CON,
-                (IC_SLAVE_DISABLE | IC_MASTER_MODE | IC_TX_EMPTY_CTRL));
+                (IC_RX_FIFO_FULL_HLD_CTRL | IC_RESTART_EN |
+                 IC_SLAVE_DISABLE | IC_MASTER_MODE | IC_TX_EMPTY_CTRL));
+
   cxd56_i2c_setfrequency(priv, I2C_DEFAULT_FREQUENCY);
 
   leave_critical_section(flags);

[incubator-nuttx] 15/21: arch: cxd56xx: gnss: Fix compile error in debug log

Posted by je...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

jerpelea pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git

commit bb348cc464406694eb3b3242a6ca178df9241bba
Author: SPRESENSE <41...@users.noreply.github.com>
AuthorDate: Wed May 19 17:04:29 2021 +0900

    arch: cxd56xx: gnss: Fix compile error in debug log
    
    Fix compile error when debug log is enabled.
    Replace debug message from obsolete logerr() to _err().
---
 arch/arm/src/cxd56xx/cxd56_gnss.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/arm/src/cxd56xx/cxd56_gnss.h b/arch/arm/src/cxd56xx/cxd56_gnss.h
index e0e61a8..e66e7f3 100644
--- a/arch/arm/src/cxd56xx/cxd56_gnss.h
+++ b/arch/arm/src/cxd56xx/cxd56_gnss.h
@@ -47,19 +47,19 @@ extern "C"
 /* GNSS specific debug */
 
 #ifdef CONFIG_CXD56_GNSS_DEBUG_ERROR
-#  define gnsserr(fmt, ...)  logerr(fmt, ## __VA_ARGS__)
+#  define gnsserr(fmt, ...)   _err(fmt, ## __VA_ARGS__)
 #else
 #  define gnsserr(fmt, ...)
 #endif
 
 #ifdef CONFIG_CXD56_GNSS_DEBUG_WARN
-#  define gnsswarn(fmt, ...)  logwarn(fmt, ## __VA_ARGS__)
+#  define gnsswarn(fmt, ...)  _warn(fmt, ## __VA_ARGS__)
 #else
 #  define gnsswarn(fmt, ...)
 #endif
 
 #ifdef CONFIG_CXD56_GNSS_DEBUG_INFO
-#  define gnssinfo(fmt, ...)  loginfo(fmt, ## __VA_ARGS__)
+#  define gnssinfo(fmt, ...)  _info(fmt, ## __VA_ARGS__)
 #else
 #  define gnssinfo(fmt, ...)
 #endif

[incubator-nuttx] 18/21: arch: cxd56xx: Do not re-initialize the console for subcore

Posted by je...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

jerpelea pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git

commit 151fec4e98ef6ebfb7674c7409cf563dd26a8310
Author: SPRESENSE <41...@users.noreply.github.com>
AuthorDate: Wed May 19 17:04:41 2021 +0900

    arch: cxd56xx: Do not re-initialize the console for subcore
    
    If the subcore configuration, which is mainly used in the Spresense
    Arduino environment, is enabled, the serial console has been already
    initialized by maincore. Then, don't need to re-initialize the UART1
    serial driver.
---
 arch/arm/src/cxd56xx/cxd56_serial.c | 11 +++++++++++
 arch/arm/src/cxd56xx/cxd56_start.c  |  4 +++-
 2 files changed, 14 insertions(+), 1 deletion(-)

diff --git a/arch/arm/src/cxd56xx/cxd56_serial.c b/arch/arm/src/cxd56xx/cxd56_serial.c
index 6ef147a..4f62145f 100644
--- a/arch/arm/src/cxd56xx/cxd56_serial.c
+++ b/arch/arm/src/cxd56xx/cxd56_serial.c
@@ -460,6 +460,17 @@ static int up_setup(FAR struct uart_dev_s *dev)
   uint32_t lcr;
   uint32_t cr;
 
+#ifdef CONFIG_CXD56_SUBCORE
+  if (priv->id == 1)
+    {
+      /* In case of SUBCORE, UART1 has been already initialized,
+       * then we don't need to do anything.
+       */
+
+      return OK;
+    }
+#endif
+
   cxd56_uart_setup(priv->id);
 
   /* Init HW */
diff --git a/arch/arm/src/cxd56xx/cxd56_start.c b/arch/arm/src/cxd56xx/cxd56_start.c
index 0518be6..d85f484 100644
--- a/arch/arm/src/cxd56xx/cxd56_start.c
+++ b/arch/arm/src/cxd56xx/cxd56_start.c
@@ -303,7 +303,9 @@ void __start(void)
 
   putreg32(0, CXD56_EXCCONF_BASE + 0);
 
+#ifndef CONFIG_CXD56_SUBCORE
   cxd56_lowsetup();
+#endif
   showprogress('A');
 
   /* Clear .bss.  We'll do this inline (vs. calling memset) just to be
@@ -327,7 +329,7 @@ void __start(void)
 
   /* Perform early serial initialization */
 
-#ifdef USE_EARLYSERIALINIT
+#if defined(USE_EARLYSERIALINIT) && !defined(CONFIG_CXD56_SUBCORE)
   arm_earlyserialinit();
 #endif
   showprogress('E');

[incubator-nuttx] 07/21: arch: cxd56xx: Add SCU register definitions

Posted by je...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

jerpelea pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git

commit a10a4c483f922413e7b5e0f75d40c7adbc8b4628
Author: SPRESENSE <41...@users.noreply.github.com>
AuthorDate: Wed May 19 17:04:10 2021 +0900

    arch: cxd56xx: Add SCU register definitions
    
    Add SCU register definitions.
---
 arch/arm/src/cxd56xx/hardware/cxd56_scu.h    | 15 +++++++++------
 arch/arm/src/cxd56xx/hardware/cxd56_scuseq.h |  4 ++++
 2 files changed, 13 insertions(+), 6 deletions(-)

diff --git a/arch/arm/src/cxd56xx/hardware/cxd56_scu.h b/arch/arm/src/cxd56xx/hardware/cxd56_scu.h
index 224d293..307f4fe 100644
--- a/arch/arm/src/cxd56xx/hardware/cxd56_scu.h
+++ b/arch/arm/src/cxd56xx/hardware/cxd56_scu.h
@@ -21,12 +21,8 @@
 #ifndef __ARCH_ARM_SRC_CXD56XX_HARDWARE_CXD56_SCU_H
 #define __ARCH_ARM_SRC_CXD56XX_HARDWARE_CXD56_SCU_H
 
-#define SCU_PWM0_PARAM			(CXD56_SCU_BASE + 0x0000)
-#define SCU_PWM0_EN			(CXD56_SCU_BASE + 0x0004)
-#define SCU_PWM0_UPDATE			(CXD56_SCU_BASE + 0x0008)
-#define SCU_PWM1_PARAM			(CXD56_SCU_BASE + 0x000c)
-#define SCU_PWM1_EN			(CXD56_SCU_BASE + 0x0010)
-#define SCU_PWM1_UPDATE			(CXD56_SCU_BASE + 0x0014)
+#define SCU_DEBUG_I2C0			(CXD56_SCU_BASE + 0x0018)
+#define SCU_DEBUG_I2C1			(CXD56_SCU_BASE + 0x001c)
 #define SCU_SEQ_ENABLE_ALL		(CXD56_SCU_BASE + 0x0020)
 #define SCU_SEQ_ACCESS_INHIBIT		(CXD56_SCU_BASE + 0x0024)
 #define SCU_START_CTRL_COMMON		(CXD56_SCU_BASE + 0x0028)
@@ -178,5 +174,12 @@
 #define SCU_INT_RAW_STT_ERR_2		(CXD56_SCU_BASE + 0x046c)
 #define SCU_INT_MASKED_STT_ERR_2	(CXD56_SCU_BASE + 0x0470)
 #define SCU_RAM_TEST			(CXD56_SCU_BASE + 0x0500)
+#define SCU_POWER			(CXD56_SCU_BASE + 0x0510)
+#define SCU_INT_ENABLE_MAIN_AD		(CXD56_SCU_BASE + 0x0520)
+#define SCU_INT_DISABLE_MAIN_AD		(CXD56_SCU_BASE + 0x0524)
+#define SCU_INT_CLEAR_MAIN_AD		(CXD56_SCU_BASE + 0x0528)
+#define SCU_INT_LEVEL_SEL_MAIN_AD	(CXD56_SCU_BASE + 0x052c)
+#define SCU_INT_RAW_STT_MAIN_AD		(CXD56_SCU_BASE + 0x0530)
+#define SCU_INT_MASKED_STT_MAIN_AD	(CXD56_SCU_BASE + 0x0534)
 
 #endif /* __ARCH_ARM_SRC_CXD56XX_HARDWARE_CXD56_SCU_H */
diff --git a/arch/arm/src/cxd56xx/hardware/cxd56_scuseq.h b/arch/arm/src/cxd56xx/hardware/cxd56_scuseq.h
index 41fc417..6a1d399 100644
--- a/arch/arm/src/cxd56xx/hardware/cxd56_scuseq.h
+++ b/arch/arm/src/cxd56xx/hardware/cxd56_scuseq.h
@@ -21,7 +21,11 @@
 #ifndef __ARCH_ARM_SRC_CXD56XX_HARDWARE_CXD56_SCUSEQ_H
 #define __ARCH_ARM_SRC_CXD56XX_HARDWARE_CXD56_SCUSEQ_H
 
+#define SCUSEQ_SW_REVISION_DATE             (CXD56_SCU_SEQ_DRAM_BASE + 0x000)
+#define SCUSEQ_SW_REVISION_TIME             (CXD56_SCU_SEQ_DRAM_BASE + 0x004)
+#define SCUSEQ_SW_REVISION_GIT_HASH         (CXD56_SCU_SEQ_DRAM_BASE + 0x008)
 #define SCUSEQ_SRC_SEL                      (CXD56_SCU_SEQ_DRAM_BASE + 0x00c)
+#define SCUSEQ_REPEAT_TXABORT               (CXD56_SCU_SEQ_DRAM_BASE + 0x010)
 #define SCUSEQ_PROPERTY(s)                  (CXD56_SCU_SEQ_DRAM_BASE + 0x020 + ((s) * 0x20))
 #define SCUSEQ_OUT_FORMAT(s)                (CXD56_SCU_SEQ_DRAM_BASE + 0x024 + ((s) * 0x20))
 #define SCUSEQ_MATH_PROC_OFST_GAIN_X(s)     (CXD56_SCU_SEQ_DRAM_BASE + 0x028 + ((s) * 0x20))

[incubator-nuttx] 10/21: arch: cxd56xx: Support execution error by SCU sequencer

Posted by je...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

jerpelea pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git

commit f548ffa7a7dd4ac8cb018f47d1a1410e5e1f30ee
Author: SPRESENSE <41...@users.noreply.github.com>
AuthorDate: Wed May 19 17:04:18 2021 +0900

    arch: cxd56xx: Support execution error by SCU sequencer
    
    Enable interrupt by SCU sequencer execution error. If the interrupt
    occurs, then it stops the sequencer and returns the error code.
---
 arch/arm/src/cxd56xx/cxd56_scu.c | 36 +++++++++++++++++++++++++++++++-----
 1 file changed, 31 insertions(+), 5 deletions(-)

diff --git a/arch/arm/src/cxd56xx/cxd56_scu.c b/arch/arm/src/cxd56xx/cxd56_scu.c
index 0e9cc31..dde3001 100644
--- a/arch/arm/src/cxd56xx/cxd56_scu.c
+++ b/arch/arm/src/cxd56xx/cxd56_scu.c
@@ -196,6 +196,7 @@ struct cxd56_scudev_s
   uint8_t oneshot;    /* Bitmap for Oneshots */
 
   sem_t oneshotwait[3]; /* Semaphore for wait oneshot sequence is done */
+  int oneshoterr[3];    /* error code for oneshot sequencer */
 
   struct ev_notify_s event[3]; /* MATHFUNC event notify */
   struct wm_notify_s wm[14];   /* Watermark notify */
@@ -1066,6 +1067,7 @@ static int seq_oneshot(int bustype, int slave, FAR uint16_t *inst,
   putreg32(1 << (tid + 24), SCU_INT_ENABLE_MAIN);
 
   scuinfo("Sequencer start.\n");
+  priv->oneshoterr[tid] = 0;
 
   /* Start sequencer as one shot mode */
 
@@ -1082,7 +1084,11 @@ static int seq_oneshot(int bustype, int slave, FAR uint16_t *inst,
 
   scuinfo("Sequencer done.\n");
 
-  if (buffer)
+  if (priv->oneshoterr[tid] < 0)
+    {
+      ret = ERROR;
+    }
+  else
     {
       /* Copy sequencer output results to user buffer.
        * XXX: Sequencer output RAM offset is differ from document.
@@ -1661,6 +1667,8 @@ static int seq_scuirqhandler(int irq, FAR void *context, FAR void *arg)
   uint32_t ierr0;
   uint32_t ierr1;
   uint32_t ierr2;
+  uint32_t out;
+  int tid;
   int i;
 
   intr = getreg32(SCU_INT_MASKED_STT_MAIN);
@@ -1721,16 +1729,30 @@ static int seq_scuirqhandler(int irq, FAR void *context, FAR void *arg)
   if (ierr2 != 0)
     {
       scuerr("err2: %08x\n", ierr2);
-      ierr2 &= 0x03ff;
+
       for (i = 0; i < 10; i++)
         {
-          if (ierr2 & (1 << i))
+          if (ierr2 & (0x00010001 << i))
             {
               seq_stopseq(i);
+
+              /* Get sequencer output selector */
+
+              out = (getreg32(SCUSEQ_PROPERTY(i)) >> 12) & 0x3;
+
+              if (0 < out)
+                {
+                  /* Set error code to oneshot sequencer id */
+
+                  tid = out - 1;
+
+                  priv->oneshoterr[tid] = -EIO;
+                  seq_semgive(&priv->oneshotwait[tid]);
+                }
             }
         }
 
-      putreg32(0x03ff, SCU_INT_CLEAR_ERR_2);
+      putreg32(ierr2, SCU_INT_CLEAR_ERR_2);
     }
 
   return 0;
@@ -3461,7 +3483,11 @@ void scu_initialize(void)
   /* Enable error interrupt  */
 
   putreg32(0x007ffe00, SCU_INT_ENABLE_ERR_0);
-  putreg32(0x03ff, SCU_INT_ENABLE_ERR_2);
+  putreg32(0x03ff03ff, SCU_INT_ENABLE_ERR_2);
+
+  /* Set the number of TxAbort repeat times */
+
+  putreg32(5, SCUSEQ_REPEAT_TXABORT);
 
   /* Enable SCU IRQ */
 

[incubator-nuttx] 09/21: arch: cxd56xx: Remove unnecessary i2c settings

Posted by je...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

jerpelea pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git

commit ba6201401f3e9b2c53da3be0a8e4450185317126
Author: SPRESENSE <41...@users.noreply.github.com>
AuthorDate: Wed May 19 17:04:15 2021 +0900

    arch: cxd56xx: Remove unnecessary i2c settings
    
    Remove slave address register setting that is unnecessary for the
    transfer by SCU sequencer.
---
 arch/arm/src/cxd56xx/cxd56_i2c.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/arch/arm/src/cxd56xx/cxd56_i2c.c b/arch/arm/src/cxd56xx/cxd56_i2c.c
index eb7ea61..c206a38 100644
--- a/arch/arm/src/cxd56xx/cxd56_i2c.c
+++ b/arch/arm/src/cxd56xx/cxd56_i2c.c
@@ -846,9 +846,6 @@ static int cxd56_i2c_transfer_scu(FAR struct i2c_master_s *dev,
       cxd56_i2c_clock_gate_disable(priv->port);
       cxd56_i2c_disable(priv);
       cxd56_i2c_setfrequency(priv, msgs->frequency);
-      i2c_reg_rmw(priv, CXD56_IC_CON, IC_RESTART_EN, IC_RESTART_EN);
-      i2c_reg_write(priv, CXD56_IC_TAR, msgs->addr & 0x7f);
-      cxd56_i2c_enable(priv);
       cxd56_i2c_clock_gate_enable(priv->port);
 
       priv->frequency = msgs->frequency;

[incubator-nuttx] 12/21: arch: cxd56xx: Fix gnss open error by clock change

Posted by je...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

jerpelea pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git

commit 98871e58af27dee3b5d02232246775e6843599b5
Author: SPRESENSE <41...@users.noreply.github.com>
AuthorDate: Wed May 19 17:04:22 2021 +0900

    arch: cxd56xx: Fix gnss open error by clock change
    
    If the system clock is changed during loading gnssfw, gnss open may be
    failed. So this commit prohibits clock change until loading gnssfw is
    completed.
---
 arch/arm/src/cxd56xx/cxd56_gnss.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/arch/arm/src/cxd56xx/cxd56_gnss.c b/arch/arm/src/cxd56xx/cxd56_gnss.c
index 8325b89..13c739a 100644
--- a/arch/arm/src/cxd56xx/cxd56_gnss.c
+++ b/arch/arm/src/cxd56xx/cxd56_gnss.c
@@ -389,6 +389,11 @@ static struct pm_cpu_freqlock_s g_lv_lock =
   PM_CPUFREQLOCK_INIT(PM_CPUFREQLOCK_TAG('G', 'T', 0),
                       PM_CPUFREQLOCK_FLAG_LV);
 
+/* Lock to prohibit clock change in gnss open */
+
+static struct pm_cpu_freqlock_s g_hold_lock =
+  PM_CPUFREQLOCK_INIT(0, PM_CPUFREQLOCK_FLAG_HOLD);
+
 /****************************************************************************
  * Private Functions
  ****************************************************************************/
@@ -2632,7 +2637,16 @@ static int cxd56_gnss_open(FAR struct file *filep)
 
       nxsem_set_protocol(&priv->syncsem, SEM_PRIO_NONE);
 
+      /* Prohibit the clock change during loading image */
+
+      up_pm_acquire_freqlock(&g_hold_lock);
+
       ret = fw_pm_loadimage(CXD56_GNSS_GPS_CPUID, CXD56_GNSS_FWNAME);
+
+      /* Allow the clock change after loading image */
+
+      up_pm_release_freqlock(&g_hold_lock);
+
       if (ret < 0)
         {
           goto _err1;

[incubator-nuttx] 06/21: arch: cxd56xx: update loader and gnssfw version

Posted by je...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

jerpelea pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git

commit 09cc6b780b9530ceafe104df54ff03bf84fbf3fa
Author: SPRESENSE <41...@users.noreply.github.com>
AuthorDate: Wed May 19 17:04:08 2021 +0900

    arch: cxd56xx: update loader and gnssfw version
    
    Update loader and gnssfw to version 2.2.20175
---
 arch/arm/src/cxd56xx/cxd56_farapistub.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/src/cxd56xx/cxd56_farapistub.h b/arch/arm/src/cxd56xx/cxd56_farapistub.h
index 5fa5c27..3e12f75 100644
--- a/arch/arm/src/cxd56xx/cxd56_farapistub.h
+++ b/arch/arm/src/cxd56xx/cxd56_farapistub.h
@@ -21,6 +21,6 @@
 #ifndef __ARCH_ARM_SRC_CXD56XX_CXD56_FARAPISTUB_H
 #define __ARCH_ARM_SRC_CXD56XX_CXD56_FARAPISTUB_H
 
-#define FARAPISTUB_VERSION 20129
+#define FARAPISTUB_VERSION 20175
 
 #endif /* __ARCH_ARM_SRC_CXD56XX_CXD56_FARAPISTUB_H */

[incubator-nuttx] 14/21: arch: cxd56xx: wdt: Fix compile error in debug log

Posted by je...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

jerpelea pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git

commit 6d3fb9ee817975f2de31dfebb7b0e8b047cfcdcd
Author: SPRESENSE <41...@users.noreply.github.com>
AuthorDate: Wed May 19 17:04:27 2021 +0900

    arch: cxd56xx: wdt: Fix compile error in debug log
    
    Fix compile error when CXD56_WDT_REGDEBUG is enabled.
---
 arch/arm/src/cxd56xx/Kconfig     | 1 +
 arch/arm/src/cxd56xx/cxd56_wdt.c | 8 ++++----
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/arch/arm/src/cxd56xx/Kconfig b/arch/arm/src/cxd56xx/Kconfig
index 2f1f404..b3f525c 100644
--- a/arch/arm/src/cxd56xx/Kconfig
+++ b/arch/arm/src/cxd56xx/Kconfig
@@ -190,6 +190,7 @@ config CXD56_WDT_INTERRUPT
 config CXD56_WDT_REGDEBUG
 	bool "Register level debug"
 	default n
+	depends on DEBUG_WATCHDOG_INFO
 	---help---
 		Enable low-level register debug output
 
diff --git a/arch/arm/src/cxd56xx/cxd56_wdt.c b/arch/arm/src/cxd56xx/cxd56_wdt.c
index 301f323..7cf97dd 100644
--- a/arch/arm/src/cxd56xx/cxd56_wdt.c
+++ b/arch/arm/src/cxd56xx/cxd56_wdt.c
@@ -172,7 +172,7 @@ static uint32_t cxd56_getreg(uintptr_t regaddr)
         {
           if (count == 4)
             {
-              logdebug("...\n");
+              wdinfo("...\n");
             }
 
           return regval;
@@ -189,7 +189,7 @@ static uint32_t cxd56_getreg(uintptr_t regaddr)
         {
           /* Yes.. then show how many times the value repeated */
 
-          logdebug("[repeats %d more times]\n", count - 3);
+          wdinfo("[repeats %d more times]\n", count - 3);
         }
 
       /* Save the new address, value, and count */
@@ -201,7 +201,7 @@ static uint32_t cxd56_getreg(uintptr_t regaddr)
 
   /* Show the register value read */
 
-  logdebug("%08x->%08\n", regaddr, regval);
+  wdinfo("%08x->%08\n", regaddr, regval);
   return regval;
 }
 #endif
@@ -219,7 +219,7 @@ static void cxd56_putreg(uint32_t regval, uintptr_t regaddr)
 {
   /* Show the register value being written */
 
-  logdebug("%08x<-%08x\n", regaddr, regval);
+  wdinfo("%08x<-%08x\n", regaddr, regval);
 
   /* Write the value */
 

[incubator-nuttx] 04/21: arch: cxd56xx: Fix RTC alarm cancellation process

Posted by je...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

jerpelea pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git

commit 89fd987a1ae97f189795c56f2b38ad321352603d
Author: SPRESENSE <41...@users.noreply.github.com>
AuthorDate: Wed May 19 17:04:01 2021 +0900

    arch: cxd56xx: Fix RTC alarm cancellation process
    
    There is an issue that the next alarm is expired immediately after
    canceling a RTC alarm. Fixed alarm settings to be completely cleared
    when canceling an RTC alarm.
---
 arch/arm/src/cxd56xx/cxd56_rtc.c | 36 +++++++++++++++++++++++++++++++++++-
 1 file changed, 35 insertions(+), 1 deletion(-)

diff --git a/arch/arm/src/cxd56xx/cxd56_rtc.c b/arch/arm/src/cxd56xx/cxd56_rtc.c
index 58cec8a..410f09f 100644
--- a/arch/arm/src/cxd56xx/cxd56_rtc.c
+++ b/arch/arm/src/cxd56xx/cxd56_rtc.c
@@ -542,6 +542,7 @@ int cxd56_rtc_setalarm(FAR struct alm_setalarm_s *alminfo)
   int ret = -EBUSY;
   int id;
   uint64_t count;
+  uint32_t mask;
 
   ASSERT(alminfo != NULL);
   DEBUGASSERT(RTC_ALARM_LAST > alminfo->as_id);
@@ -565,6 +566,13 @@ int cxd56_rtc_setalarm(FAR struct alm_setalarm_s *alminfo)
 
       count -= g_rtc_save->offset;
 
+      /* clear previsous setting */
+
+      mask = RTCREG_ALM0_ERR_FLAG_MASK | RTCREG_ALM0_FLAG_MASK;
+      mask <<= id;
+
+      putreg32(mask, CXD56_RTC0_ALMCLR);
+
       /* wait until previous alarm request is completed */
 
       while (RTCREG_ASET_BUSY_MASK & getreg32(CXD56_RTC0_SETALMPRECNT(id)));
@@ -609,10 +617,11 @@ int cxd56_rtc_cancelalarm(enum alm_id_e alarmid)
   FAR struct alm_cbinfo_s *cbinfo;
   irqstate_t flags;
   int ret = -ENODATA;
+  uint32_t mask;
 
   DEBUGASSERT(RTC_ALARM_LAST > alarmid);
 
-  /* Set the alarm in hardware and enable interrupts */
+  /* Cancel the alarm in hardware and clear interrupts */
 
   cbinfo = &g_alarmcb[alarmid];
 
@@ -628,6 +637,31 @@ int cxd56_rtc_cancelalarm(enum alm_id_e alarmid)
 
       putreg32(0, CXD56_RTC0_ALMOUTEN(alarmid));
 
+      while (RTCREG_ALM_BUSY_MASK & getreg32(CXD56_RTC0_ALMOUTEN(alarmid)));
+
+      /* wait until previous alarm request is completed */
+
+      while (RTCREG_ASET_BUSY_MASK &
+             getreg32(CXD56_RTC0_SETALMPRECNT(alarmid)));
+
+      /* clear the alarm counter */
+
+      putreg32(0, CXD56_RTC0_SETALMPOSTCNT(alarmid));
+      putreg32(0, CXD56_RTC0_SETALMPRECNT(alarmid));
+
+      while (RTCREG_ASET_BUSY_MASK &
+             getreg32(CXD56_RTC0_SETALMPRECNT(alarmid)));
+
+      /* wait until the interrupt flag is clear */
+
+      mask = RTCREG_ALM0_ERR_FLAG_MASK | RTCREG_ALM0_FLAG_MASK;
+      mask <<= alarmid;
+
+      while (mask & getreg32(CXD56_RTC0_ALMFLG))
+        {
+          putreg32(mask, CXD56_RTC0_ALMCLR);
+        }
+
       spin_unlock_irqrestore(NULL, flags);
 
       ret = OK;

[incubator-nuttx] 11/21: arch: cxd56xx: Update isop firmware

Posted by je...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

jerpelea pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git

commit e26da5f56494e69d3757b69d0185bbf4f02c3a6d
Author: SPRESENSE <41...@users.noreply.github.com>
AuthorDate: Wed May 19 17:04:20 2021 +0900

    arch: cxd56xx: Update isop firmware
    
    Update isop firmware which supports for the error handling and i2c
    multi-master environment.
---
 arch/arm/src/cxd56xx/hardware/cxd5602_isop.h | 856 ++++++++++++++-------------
 1 file changed, 437 insertions(+), 419 deletions(-)

diff --git a/arch/arm/src/cxd56xx/hardware/cxd5602_isop.h b/arch/arm/src/cxd56xx/hardware/cxd5602_isop.h
index de15809..2834720 100644
--- a/arch/arm/src/cxd56xx/hardware/cxd5602_isop.h
+++ b/arch/arm/src/cxd56xx/hardware/cxd5602_isop.h
@@ -1,4 +1,4 @@
-/* This file is generated at May 18 2016  16:19:52 */
+/* This file is generated at Dec 14 2020 13:28:30 */
 
 /****************************************************************************
  * Public Data
@@ -9,442 +9,460 @@ const unsigned long scu_isopprog_array[] =
   0xf7f8d600, 0xa2024f86, 0x0001a200, 0x18004081,
   0x00008014, 0x00000000, 0x0000a207, 0x00000000,
   0x0000a070, 0xac2d4ec6, 0xd000ac27, 0x50a2e444,
-  0x70111801, 0x50011c01, 0xf34cd000, 0x0004800a,
+  0x70111801, 0x50011c01, 0xf356d000, 0x0004800a,
   0x40110114, 0x50031f43, 0x9ff42801, 0x90062911,
   0x8fec5043, 0x00140003, 0x40640113, 0x1f344011,
-  0x9fe42121, 0xd2005001, 0x5203f356, 0x50155004,
+  0x9fe42121, 0xd2005001, 0x5203f360, 0x50155004,
   0x04150845, 0x90082905, 0x2d444014, 0x00259ff2,
   0x40110115, 0x21311f54, 0xd1009fe4, 0x5ff2e824,
   0xe808d400, 0x01f8fc43, 0x07fffc33, 0xe804d000,
   0xf000d700, 0x1c431c12, 0xe800d100, 0x1c025013,
-  0x0103fc40, 0x0300fc30, 0xf3d8d200, 0x1c135be4,
+  0x0103fc40, 0x0300fc30, 0xf3e0d200, 0x1c135be4,
   0xe418d100, 0x1c105003, 0xf47250a1, 0x1c230300,
   0x0004f721, 0xf7235e61, 0xf7230005, 0xf7230016,
   0x00250017, 0x4fc10215, 0xf7531d53, 0xf753fffe,
   0x2141ffff, 0xd1009fee, 0xd209f33c, 0xd000ec00,
-  0x5004f4b8, 0x1c125005, 0x0304f470, 0x44020002,
+  0x5004f4c0, 0x1c125005, 0x0304f470, 0x44020002,
   0x0308f472, 0x41a10001, 0x00020053, 0x106350a7,
   0x1c240132, 0x0004f727, 0x0005f724, 0x0016f724,
   0x0017f724, 0x1d340013, 0xfffef734, 0xfffff734,
   0x40434ff7, 0x9ff02907, 0x44014015, 0x9fca2925,
-  0xd3005001, 0x5004f340, 0xf398d200, 0x01150035,
-  0x1f544011, 0x9ff62941, 0xd4005fe3, 0x5005f344,
-  0x00415f67, 0x4fc30231, 0xfffef512, 0x1f154202,
-  0x9ff02173, 0xf334d200, 0xf000d100, 0xd4005003,
-  0x5005f538, 0x030cf412, 0xac115001, 0xa819ac19,
-  0x00470052, 0x00710112, 0x01211032, 0x00201c13,
-  0x70407052, 0x1f450104, 0x00740070, 0xf34cd700,
-  0x01200157, 0x1e724015, 0xf7131f02, 0xa8110016,
-  0x210550a0, 0x9fc44021, 0xf376d000, 0x1000fc11,
-  0x00345f02, 0x4ff30005, 0x21231014, 0x1d510245,
-  0x50029ff2, 0xf334d000, 0xf000d700, 0xf458d300,
-  0x1d025004, 0xf332d000, 0x0310f470, 0x00350041,
-  0x01151041, 0x0004f452, 0x0008f454, 0xf7524014,
-  0xf752000c, 0x1c52000d, 0x9fe22964, 0xd2005001,
-  0x1f21f330, 0x0001f721, 0xf5711d01, 0xf77102fe,
-  0xfc4102fc, 0xfc312016, 0xd2160518, 0x1c711951,
-  0x0427fc41, 0x9e21fc31, 0x0004f472, 0xe412d200,
-  0x0008f471, 0x1f215011, 0x0d86fa00, 0xa82da827,
-  0x41465000, 0x0000a070, 0xac3d4e46, 0xf601ac37,
-  0x28010005, 0xf6029178, 0xac200004, 0x10110021,
-  0xd100ac29, 0xa828f538, 0x10300120, 0x7050ac18,
-  0x1e150101, 0xfa000050, 0x00501890, 0x29006fb0,
-  0x0050901a, 0xfa004010, 0x00501880, 0xfa004020,
-  0x00501878, 0xfa004030, 0xd1001870, 0x5010e000,
-  0x08501811, 0x28010401, 0xac15906c, 0x0128fa00,
-  0x5003a822, 0xf6205005, 0xa8110004, 0xfa004062,
-  0xa8230290, 0xf538d400, 0x91022900, 0x5021a818,
-  0xf334d700, 0x1c410104, 0xf6305011, 0x1a720004,
-  0x05120801, 0xf6301d72, 0xf7400005, 0x28000016,
-  0x500090dc, 0x00320041, 0x01524010, 0xf6220151,
-  0xf7120006, 0x00050006, 0x0005f632, 0x24256ff5,
-  0x80ba9fe4, 0xd100a822, 0xf620e404, 0x18110004,
-  0x28016201, 0xd3009028, 0x6ff0f330, 0x0001f631,
-  0x90222101, 0x6ff01e30, 0x901a2910, 0x15f0fa00,
-  0x5030a822, 0xf330d100, 0x800a1f10, 0xf330d000,
-  0x1f015001, 0x0004f620, 0xf000d100, 0x01011050,
-  0x0005f620, 0x0024f213, 0xac1b2800, 0x0024f211,
-  0x905a0050, 0xac100015, 0x0562fa00, 0x0053a814,
-  0x904a2910, 0x60f31243, 0x61f34013, 0x903e2803,
-  0x5002a818, 0x60f05001, 0x0030ac18, 0x00470043,
-  0xf418d400, 0x10234011, 0xf2430134, 0x1a440002,
-  0x0152a81d, 0x0125a825, 0x0006f652, 0x00741f42,
-  0x00031f32, 0x6ff20012, 0x9fd02432, 0xa83da837,
-  0xa07041c6, 0xac454e06, 0xd000ac3f, 0xfc41e400,
-  0x18000400, 0x28000410, 0x5000915e, 0xfc41ac10,
-  0xd0000400, 0xac19e804, 0xd1001c01, 0x1810e080,
-  0xe084d100, 0x00021811, 0xf76260f2, 0x00620014,
-  0x0014fc02, 0x00040023, 0x13007022, 0x70131284,
-  0x1f346034, 0xf5611d20, 0x13010018, 0xe088d000,
-  0xf5615012, 0x1c02001a, 0x0014f265, 0x6ff5ac25,
-  0xfa000050, 0xa8220498, 0xf418d100, 0x90902910,
-  0xd0001025, 0x0017f000, 0xfc411282, 0x01500100,
-  0xf0004012, 0x6ff20280, 0x50010410, 0x903a2900,
-  0x50000075, 0x28020027, 0xf6629066, 0x00530014,
+  0xf34cd200, 0xd3005001, 0x5004f340, 0x0002f721,
+  0xf3a0d200, 0x01450035, 0x1f514014, 0x9ff62944,
+  0xd4005fe3, 0x5005f344, 0x00415f67, 0x4fc30231,
+  0xfffef512, 0x1f154202, 0x9ff02173, 0xf334d200,
+  0xf000d100, 0xd4005003, 0x5005f540, 0x030cf412,
+  0xac115001, 0xa819ac19, 0x00470052, 0x00710112,
+  0x01211032, 0x00201c13, 0x70407052, 0x1f450104,
+  0x00740070, 0xf356d700, 0x01200157, 0x1e724015,
+  0xf7131f02, 0xa8110016, 0x210550a0, 0x9fc44021,
+  0xf380d000, 0x1000fc11, 0x00345f02, 0x4ff30005,
+  0x21231014, 0x1d510245, 0x50029ff2, 0xf334d000,
+  0xf000d700, 0xf460d300, 0x1d025004, 0xf332d000,
+  0x0310f470, 0x00350041, 0x01151041, 0x0004f452,
+  0x0008f454, 0xf7524014, 0xf752000c, 0x1c52000d,
+  0x9fe22964, 0xd2005001, 0x1f21f330, 0x0001f721,
+  0xf5711d01, 0xf77102fe, 0xfc4102fc, 0xfc312020,
+  0xd2131214, 0x1c712825, 0x01cdfc41, 0x4cf8fc31,
+  0x0004f472, 0xe412d200, 0x0008f471, 0x1f215011,
+  0x0e98fa00, 0xa82da827, 0x41465000, 0x0000a070,
+  0xac3d4e46, 0xf601ac37, 0x28010005, 0xf6029178,
+  0xac200004, 0x10110021, 0xd100ac29, 0xa828f540,
+  0x10300120, 0x7050ac18, 0x1e150101, 0xfa000050,
+  0x005019a2, 0x29006fb0, 0x0050901a, 0xfa004010,
+  0x00501992, 0xfa004020, 0x0050198a, 0xfa004030,
+  0xd1001982, 0x5010e000, 0x08501811, 0x28010401,
+  0xac15906c, 0x0128fa00, 0x5003a822, 0xf6205005,
+  0xa8110004, 0xfa004062, 0xa8230290, 0xf540d400,
+  0x91022900, 0x5021a818, 0xf334d700, 0x1c410104,
+  0xf6305011, 0x1a720004, 0x05120801, 0xf6301d72,
+  0xf7400005, 0x28000016, 0x500090dc, 0x00320041,
+  0x01524010, 0xf6220151, 0xf7120006, 0x00050006,
+  0x0005f632, 0x24256ff5, 0x80ba9fe4, 0xd100a822,
+  0xf620e404, 0x18110004, 0x28016201, 0xd3009028,
+  0x6ff0f330, 0x0001f631, 0x90222101, 0x6ff01e30,
+  0x901a2910, 0x1702fa00, 0x5030a822, 0xf330d100,
+  0x800a1f10, 0xf330d000, 0x1f015001, 0x0004f620,
+  0xf000d100, 0x01011050, 0x0005f620, 0x0024f213,
+  0xac1b2800, 0x0024f211, 0x905a0050, 0xac100015,
+  0x0562fa00, 0x0053a814, 0x904a2910, 0x60f31243,
+  0x61f34013, 0x903e2803, 0x5002a818, 0x60f05001,
+  0x0030ac18, 0x00470043, 0xf420d400, 0x10234011,
+  0xf2430134, 0x1a440002, 0x0152a81d, 0x0125a825,
+  0x0006f652, 0x00741f42, 0x00031f32, 0x6ff20012,
+  0x9fd02432, 0xa83da837, 0xa07041c6, 0xac454e06,
+  0xd000ac3f, 0xfc41e400, 0x18000400, 0x28000410,
+  0x5000915e, 0xfc41ac10, 0xd0000400, 0xac19e804,
+  0xd1001c01, 0x1810e080, 0xe084d100, 0x00021811,
+  0xf76260f2, 0x00620014, 0x0014fc02, 0x00040023,
+  0x13007022, 0x70131284, 0x1f346034, 0xf5611d20,
+  0x13010018, 0xe088d000, 0xf5615012, 0x1c02001a,
+  0x0014f265, 0x6ff5ac25, 0xfa000050, 0xa8220498,
+  0xf420d100, 0x90902910, 0xd0001025, 0x0017f000,
+  0xfc411282, 0x01500100, 0xf0004012, 0x6ff20280,
+  0x50010410, 0x903a2900, 0x50000075, 0x28020027,
+  0xf6629066, 0x00530014, 0x40101011, 0x01231022,
+  0x0002f232, 0x00641a33, 0x0014fc04, 0xf2410114,
+  0x1d310002, 0x00011d21, 0x24716ff1, 0x80389fd6,
+  0x50000075, 0x28020027, 0xf662902e, 0x00530014,
   0x40101011, 0x01231022, 0x0002f232, 0x00641a33,
-  0x0014fc04, 0xf2410114, 0x1d310002, 0x00011d21,
-  0x24716ff1, 0x80389fd6, 0x50000075, 0x28020027,
-  0xf662902e, 0x00530014, 0x40101011, 0x01231022,
-  0x0002f232, 0x00641a33, 0x0014fc04, 0xf6410114,
-  0x1f310003, 0x00011f21, 0x24716ff1, 0xd0009fd6,
-  0x1800e400, 0x0410a819, 0x900c2800, 0x4010a810,
-  0x2c40ac10, 0xf6619efa, 0x50000014, 0x90142c41,
-  0x4fc00010, 0x90062e30, 0x80085010, 0x00fafc01,
-  0xd1000010, 0x1811e404, 0x28016201, 0xd5009022,
-  0x6ff0f330, 0x0001f651, 0x901c2101, 0x6ff01e50,
-  0x90142910, 0x13f8fa00, 0x1f505030, 0xd000800a,
-  0x5001f330, 0xa83f1f01, 0x4206a845, 0x4e06a070,
-  0xac3fac45, 0xe400d300, 0xfc431834, 0x04340200,
-  0x90322804, 0xd400ac21, 0x1841e404, 0x28016201,
-  0xd1009032, 0xf614f330, 0x21040001, 0x1e11902e,
-  0x29316ff1, 0xd0009026, 0xf001f000, 0x701102c8,
-  0x02c8f401, 0xe808d000, 0x05311801, 0x50001c01,
-  0xd1008108, 0x5003f330, 0x10501f13, 0xf000d100,
-  0xe808d300, 0xfdfffc45, 0xfffffc35, 0x01015007,
-  0xf210ac19, 0x18340026, 0xfc450454, 0x12c00200,
-  0xd3001c34, 0x1c35e804, 0x0026f213, 0xf214ac10,
-  0xf2100026, 0xf2150026, 0x12830026, 0x124512c4,
-  0x601060f3, 0x01326034, 0x28006075, 0x902a4014,
-  0x00615003, 0x40131017, 0x0014fc01, 0x01711e20,
-  0x0001f627, 0x10804022, 0x08500570, 0x00371d10,
-  0x24476ff7, 0x80289fde, 0x00605003, 0x40131017,
-  0x0014fc00, 0x01701e21, 0x0001f627, 0x10874022,
-  0x08570517, 0x00371d07, 0x24476ff7, 0xa8119fde,
-  0xf262a820, 0xd3000014, 0x1081e004, 0xfc211102,
-  0x05010300, 0xd2000521, 0x1c31e008, 0xfc000060,
-  0xf2610014, 0x70200018, 0x11011a00, 0x1c210501,
-  0xe00cd100, 0xf020a81a, 0x1c100028, 0xe010d100,
-  0x002cf020, 0xd1001c10, 0xf020e014, 0x1c100030,
-  0xd1005010, 0x1c10e018, 0xa845a83f, 0xa0704206,
-  0xac454e06, 0xd500ac3f, 0x5014e000, 0xa84d1857,
-  0x04470804, 0x901e2807, 0xac21ac32, 0xac1bac28,
-  0xfd04faff, 0xa828ac0d, 0xa832a821, 0xfa00a81b,
-  0x80240032, 0x2805ac32, 0x901cac28, 0x1811ac21,
-  0xa832a828, 0x0286fa00, 0xa828a830, 0x4ff5a821,
-  0x40412905, 0xa83f9fe8, 0x5010a845, 0xa0704206,
-  0xac654d06, 0xac22ac5f, 0xd100ac19, 0xfc44e808,
-  0xfc34fdff, 0x2623ffff, 0x04421812, 0x0200fc44,
-  0xd2001c12, 0x5001e804, 0xa86c1c24, 0x9014ac2c,
-  0x90322803, 0x90382913, 0xf000d100, 0x0268f011,
-  0x28338052, 0x29439038, 0xd200903e, 0xf021f000,
-  0xa8230274, 0x903c2913, 0x0278f022, 0xe010d300,
-  0x80301c32, 0xf000d100, 0x0264f011, 0x29238026,
-  0xd1009022, 0xf011f000, 0x8018026c, 0xf000d100,
-  0x0270f011, 0x2953800e, 0xd100900a, 0xf011f000,
-  0xd200027c, 0x1c21e00c, 0x2801a829, 0xa821911a,
-  0xd4005003, 0x1081e400, 0xac110501, 0xa8190030,
-  0xe004d500, 0x01011020, 0x00011810, 0x1101a812,
-  0x1c520512, 0x2911a821, 0x1300900a, 0xe008d100,
-  0xd0001c10, 0x5011e018, 0x1c01ac33, 0xfc401841,
-  0x04010400, 0x9ff62801, 0x04011841, 0x28015010,
-  0xfc4190bc, 0xd2000400, 0xac50e804, 0xe084d000,
-  0x1c21ac49, 0xe080d100, 0x18155012, 0xe088d100,
-  0x60f5ac45, 0xac381800, 0x00501c12, 0x00aefa00,
-  0x90742910, 0x1025a844, 0xf000d100, 0x0100fc42,
-  0x00400151, 0x0280f011, 0x0300fc20, 0x28010421,
-  0xd2009016, 0x1384f418, 0xf2230152, 0x1a220002,
-  0x1f341f24, 0xd2008014, 0x1304f418, 0xf2230152,
-  0x1a220002, 0x1d341d24, 0x902c2800, 0xf418d000,
-  0x01502801, 0xf2019016, 0x1a000002, 0xfc22a83a,
-  0x1282ff00, 0x1f121f02, 0xf201800e, 0x1a000002,
-  0x1d02a83a, 0xd4001d12, 0x1840e400, 0x0410a849,
-  0xa8502800, 0x2c409008, 0x9f484010, 0xa828a833,
-  0x21034013, 0xfc409ef8, 0xd1000200, 0x1c10e804,
-  0xa85f5010, 0x4306a865, 0xd200a070, 0x0001f000,
-  0x00231020, 0x50100103, 0x0280f033, 0x28036033,
-  0x29239078, 0x0014904c, 0xd3001021, 0x0112f376,
-  0xf0211014, 0x01430280, 0x12415094, 0x40a16031,
-  0x081460f1, 0xe404d100, 0x04141811, 0x904c2804,
-  0x50001a31, 0x90422801, 0x1000fc10, 0x90442101,
-  0x0280f020, 0xfc201280, 0x1d300fff, 0xa0705010,
-  0x90242913, 0x01121021, 0xf0205091, 0xd2000280,
-  0x1240e404, 0x40a06030, 0x080160f0, 0x04011820,
-  0xa3002901, 0x5000a070, 0xfc11a070, 0x1d311000,
-  0x4ff1a070, 0x1d315010, 0x4ec6a070, 0xac27ac2d,
-  0xac19ac12, 0xfaff0005, 0x2910ff54, 0x10259024,
-  0xf418d100, 0xf2100151, 0x1a110002, 0x2802a812,
-  0xa81a900a, 0x1c021c12, 0xa81a8008, 0x1d021d12,
-  0xa82da827, 0xa0704146, 0xac3d4e46, 0x0004ac37,
-  0x29051845, 0xd000901e, 0x2801e404, 0x00171803,
-  0xe410d000, 0x180290a0, 0x28036043, 0x704290b4,
-  0x2915809e, 0x00179332, 0x0004f641, 0x00126ff1,
-  0x10220040, 0xf6020120, 0xf6030019, 0x21230018,
-  0x10519026, 0xf000d200, 0xf0210112, 0xf0220020,
-  0x13010020, 0x67f11382, 0xf70161f2, 0x01210018,
-  0xf7014011, 0xac170019, 0xe444d200, 0x28075041,
-  0x08711823, 0xf000d700, 0xd1000513, 0x1c23d800,
-  0xd400d300, 0xa512a432, 0xf6410023, 0x00450004,
-  0x76c30074, 0x01141051, 0x0020f041, 0x1c345004,
-  0xfc240014, 0x28040400, 0xfc21902e, 0xfc3103ff,
-  0x80261000, 0x60231802, 0x91102803, 0x1c027022,
-  0xe804d000, 0x0400fc11, 0x50001c01, 0x0524f800,
-  0xac245fb1, 0x67f180fa, 0x1c217042, 0x50015012,
-  0xd2001c32, 0xf604d410, 0xac250018, 0x0017f754,
-  0x0005f751, 0xd1000003, 0xac1bd810, 0x2800a810,
-  0xa5120030, 0x0019f601, 0xac296ff1, 0xa82b0041,
-  0x25136ff1, 0x4014915a, 0xf7041011, 0x00740018,
-  0xf2470114, 0xf2450160, 0x12c50160, 0x00516075,
-  0x0160f243, 0xfc234011, 0x28030100, 0xa8209010,
-  0x0005f603, 0xf7030113, 0xa8180005, 0x0160fc04,
-  0x29030e53, 0xfc279008, 0x802607ff, 0x28210073,
-  0x05fffc23, 0x90161c23, 0x90122815, 0x4ff50071,
-  0x01fffc21, 0x1c214ff5, 0x9ffa2905, 0x03fffc27,
-  0xd7001c27, 0x1a41f000, 0x0018f604, 0x0800fc21,
-  0x9f7a2801, 0x0019f601, 0x90d42541, 0xd2001014,
-  0x0147c000, 0x0160f271, 0xe000fc21, 0x90ba2121,
-  0x0160fc07, 0x6ff11a71, 0xf5014011, 0xf601001a,
-  0x40110018, 0x0018f701, 0xac2480a6, 0x04125fd1,
-  0xe400d100, 0x50001c02, 0xfc211811, 0x280103ff,
-  0x0410f900, 0x280750a2, 0xd5005143, 0xa424f000,
-  0xf053a534, 0x0943000c, 0xf356d400, 0x00310413,
-  0x61f10045, 0x1e510115, 0x900a2951, 0x01341253,
-  0x40511e41, 0x903c2021, 0xd4005013, 0x5012e804,
-  0x1c430813, 0xa8230014, 0x01431024, 0x001af234,
-  0x90202804, 0xe408d100, 0xa8251814, 0x0004f655,
-  0x05420852, 0xf2311c12, 0x4ff1001a, 0x001af531,
-  0x001283a0, 0x6ff250a3, 0x93962032, 0x5010a824,
-  0x0004f741, 0x8dc61c40, 0xf5015001, 0xa824001a,
-  0x0005f640, 0x90162800, 0xd200a813, 0xd100d438,
-  0x4ff0d838, 0xa5122803, 0x80141c20, 0xd100a812,
-  0xd000d438, 0x2802d838, 0xa50151f2, 0xd0001c12,
-  0x1800e404, 0x0200fc20, 0x908e2800, 0xe41bd000,
-  0xd5005011, 0x1f01e408, 0xf6431852, 0x41030004,
-  0xd3000831, 0x0521e808, 0xfff8fc42, 0xfffffc32,
-  0xfc411c51, 0xfc31ffff, 0xfc151fff, 0xa8104000,
-  0xa5212800, 0x28001832, 0x1c320412, 0x2000fc13,
-  0x0001fc42, 0xd300a431, 0xa521e804, 0x8000d200,
-  0x1c312800, 0x0004fc41, 0x2800a512, 0x0002fc41,
-  0xa4521c32, 0xa5125005, 0xf6421c32, 0x00410004,
-  0x01211022, 0x001af515, 0x0017f642, 0x0018f712,
-  0x0de0fa00, 0x801ca824, 0xd100a812, 0xfc40e000,
-  0xd3000007, 0x5025e808, 0xa5012802, 0x05121832,
-  0x1c451c32, 0x2925a811, 0xd0009294, 0x0047e400,
-  0x18042801, 0x90220013, 0x0004fc42, 0x28040424,
-  0x1801902a, 0x0001fc42, 0x29010421, 0x1800901e,
-  0x0002fc41, 0x81c60410, 0x8000fc24, 0x900c2804,
-  0xfc211801, 0x28012000, 0x003291ae, 0xfffffc41,
-  0x1ffffc31, 0xfff8fc40, 0xfffffc30, 0xe808d300,
-  0x0004fc45, 0xac122802, 0x2802a501, 0x1830ac29,
-  0xfc110410, 0x1c302000, 0x0001fc40, 0xd300a414,
-  0xa5048000, 0xe804d000, 0x1c042802, 0x1c03a553,
-  0xf6150071, 0x28050005, 0xa810902e, 0xd410d500,
-  0xd810d700, 0xa5752800, 0x00725007, 0x40170010,
-  0x01206ff2, 0xf7021e52, 0x00700006, 0x0005f612,
+  0x0014fc04, 0xf6410114, 0x1f310003, 0x00011f21,
+  0x24716ff1, 0xd0009fd6, 0x1800e400, 0x0410a819,
+  0x900c2800, 0x4010a810, 0x2c40ac10, 0xf6619efa,
+  0x50000014, 0x90142c41, 0x4fc00010, 0x90062e30,
+  0x80085010, 0x00fafc01, 0xd1000010, 0x1811e404,
+  0x28016201, 0xd5009022, 0x6ff0f330, 0x0001f651,
+  0x901c2101, 0x6ff01e50, 0x90142910, 0x150afa00,
+  0x1f505030, 0xd000800a, 0x5001f330, 0xa83f1f01,
+  0x4206a845, 0x4e06a070, 0xac3fac45, 0xe400d300,
+  0xfc431834, 0x04340200, 0x90322804, 0xd400ac21,
+  0x1841e404, 0x28016201, 0xd1009032, 0xf614f330,
+  0x21040001, 0x1e11902e, 0x29316ff1, 0xd0009026,
+  0xf001f000, 0x701102c8, 0x02c8f401, 0xe808d000,
+  0x05311801, 0x50001c01, 0xd1008108, 0x5003f330,
+  0x10501f13, 0xf000d100, 0xe808d300, 0xfdfffc45,
+  0xfffffc35, 0x01015007, 0xf210ac19, 0x18340026,
+  0xfc450454, 0x12c00200, 0xd3001c34, 0x1c35e804,
+  0x0026f213, 0xf214ac10, 0xf2100026, 0xf2150026,
+  0x12830026, 0x124512c4, 0x601060f3, 0x01326034,
+  0x28006075, 0x902a4014, 0x00615003, 0x40131017,
+  0x0014fc01, 0x01711e20, 0x0001f627, 0x10804022,
+  0x08500570, 0x00371d10, 0x24476ff7, 0x80289fde,
+  0x00605003, 0x40131017, 0x0014fc00, 0x01701e21,
+  0x0001f627, 0x10874022, 0x08570517, 0x00371d07,
+  0x24476ff7, 0xa8119fde, 0xf262a820, 0xd3000014,
+  0x1081e004, 0xfc211102, 0x05010300, 0xd2000521,
+  0x1c31e008, 0xfc000060, 0xf2610014, 0x70200018,
+  0x11011a00, 0x1c210501, 0xe00cd100, 0xf020a81a,
+  0x1c100028, 0xe010d100, 0x002cf020, 0xd1001c10,
+  0xf020e014, 0x1c100030, 0xd1005010, 0x1c10e018,
+  0xa845a83f, 0xa0704206, 0xac454e06, 0xd500ac3f,
+  0x5014e000, 0xa84d1857, 0x04470804, 0x901e2807,
+  0xac21ac32, 0xac1bac28, 0xfd04faff, 0xa828ac0d,
+  0xa832a821, 0xfa00a81b, 0x80240032, 0x2805ac32,
+  0x901cac28, 0x1811ac21, 0xa832a828, 0x0286fa00,
+  0xa828a830, 0x4ff5a821, 0x40412905, 0xa83f9fe8,
+  0x5010a845, 0xa0704206, 0xac654d06, 0xac22ac5f,
+  0xd100ac19, 0xfc44e808, 0xfc34fdff, 0x2623ffff,
+  0x04421812, 0x0200fc44, 0xd2001c12, 0x5001e804,
+  0xa86c1c24, 0x9014ac2c, 0x90322803, 0x90382913,
+  0xf000d100, 0x0268f011, 0x28338052, 0x29439038,
+  0xd200903e, 0xf021f000, 0xa8230274, 0x903c2913,
+  0x0278f022, 0xe010d300, 0x80301c32, 0xf000d100,
+  0x0264f011, 0x29238026, 0xd1009022, 0xf011f000,
+  0x8018026c, 0xf000d100, 0x0270f011, 0x2953800e,
+  0xd100900a, 0xf011f000, 0xd200027c, 0x1c21e00c,
+  0x2801a829, 0xa821911a, 0xd4005003, 0x1081e400,
+  0xac110501, 0xa8190030, 0xe004d500, 0x01011020,
+  0x00011810, 0x1101a812, 0x1c520512, 0x2911a821,
+  0x1300900a, 0xe008d100, 0xd0001c10, 0x5011e018,
+  0x1c01ac33, 0xfc401841, 0x04010400, 0x9ff62801,
+  0x04011841, 0x28015010, 0xfc4190bc, 0xd2000400,
+  0xac50e804, 0xe084d000, 0x1c21ac49, 0xe080d100,
+  0x18155012, 0xe088d100, 0x60f5ac45, 0xac381800,
+  0x00501c12, 0x00aefa00, 0x90742910, 0x1025a844,
+  0xf000d100, 0x0100fc42, 0x00400151, 0x0280f011,
+  0x0300fc20, 0x28010421, 0xd2009016, 0x1384f420,
+  0xf2230152, 0x1a220002, 0x1f341f24, 0xd2008014,
+  0x1304f420, 0xf2230152, 0x1a220002, 0x1d341d24,
+  0x902c2800, 0xf420d000, 0x01502801, 0xf2019016,
+  0x1a000002, 0xfc22a83a, 0x1282ff00, 0x1f121f02,
+  0xf201800e, 0x1a000002, 0x1d02a83a, 0xd4001d12,
+  0x1840e400, 0x0410a849, 0xa8502800, 0x2c409008,
+  0x9f484010, 0xa828a833, 0x21034013, 0xfc409ef8,
+  0xd1000200, 0x1c10e804, 0xa85f5010, 0x4306a865,
+  0xd200a070, 0x0001f000, 0x00231020, 0x50100103,
+  0x0280f033, 0x28036033, 0x29239078, 0x0014904c,
+  0xd3001021, 0x0112f380, 0xf0211014, 0x01430280,
+  0x12415094, 0x40a16031, 0x081460f1, 0xe404d100,
+  0x04141811, 0x904c2804, 0x50001a31, 0x90422801,
+  0x1000fc10, 0x90442101, 0x0280f020, 0xfc201280,
+  0x1d300fff, 0xa0705010, 0x90242913, 0x01121021,
+  0xf0205091, 0xd2000280, 0x1240e404, 0x40a06030,
+  0x080160f0, 0x04011820, 0xa3002901, 0x5000a070,
+  0xfc11a070, 0x1d311000, 0x4ff1a070, 0x1d315010,
+  0x4ec6a070, 0xac27ac2d, 0xac19ac12, 0xfaff0005,
+  0x2910ff54, 0x10259024, 0xf420d100, 0xf2100151,
+  0x1a110002, 0x2802a812, 0xa81a900a, 0x1c021c12,
+  0xa81a8008, 0x1d021d12, 0xa82da827, 0xa0704146,
+  0xac3d4e46, 0x0004ac37, 0x0004f645, 0x29001840,
+  0xd00090e2, 0x2801e404, 0xd0001802, 0x900ee410,
+  0x60421803, 0x90222802, 0x800c7043, 0x60221803,
+  0x901c2802, 0x1c037023, 0xe804d000, 0x0400fc11,
+  0x50001c01, 0x0606f800, 0xac245fb2, 0xac248006,
+  0x04235fd2, 0xe400d200, 0xac2d1c03, 0x18225000,
+  0x03fffc22, 0xf9002802, 0x50a305e4, 0x51442801,
+  0xf000d700, 0xa545a435, 0x000cf074, 0xd5000954,
+  0x0424f360, 0x00570042, 0x012761f2, 0x29521e72,
+  0x1254900a, 0x1e520145, 0x20324052, 0x5014903e,
+  0xe804d500, 0x08245013, 0x00251c54, 0x1025a824,
+  0xf2450154, 0x2805001a, 0xd1009022, 0x1812e408,
+  0xf655a825, 0x08530004, 0x1c130523, 0x001af241,
+  0xf5414ff1, 0xf800001a, 0x00230574, 0x6ff350a4,
+  0xf9002043, 0xa8240568, 0xf7425010, 0x1c400004,
+  0xac19a82d, 0xe404d000, 0x2000fc42, 0x04201800,
+  0x90182800, 0xf000d000, 0x02c4f000, 0x215060f0,
+  0x5005900a, 0xf8001c45, 0x18450530, 0x926e2915,
+  0x0004f641, 0x00400012, 0x01201022, 0x0019f602,
+  0x0018f603, 0x90262123, 0xd2001051, 0x0112f000,
+  0x0020f021, 0x0020f022, 0x13821301, 0x61f267f1,
+  0x0018f701, 0x40110121, 0x0019f701, 0xa8180007,
+  0xe444d200, 0x18235041, 0x28000801, 0xd1000513,
+  0x1c23d800, 0xd400d300, 0xa512a432, 0xf6410023,
+  0x00450004, 0xf000d400, 0x105176c3, 0xf0410114,
+  0x50040020, 0x00141c34, 0x0400fc24, 0x900c2804,
+  0x03fffc21, 0x1000fc31, 0x67f18004, 0x50107042,
+  0x1c21ac17, 0x50011c30, 0xd410d200, 0x0018f674,
+  0xf754ac25, 0xf7510017, 0xd1000005, 0xa818d810,
+  0x00702800, 0xf601a512, 0x6ff10019, 0x0041ac29,
+  0x6ff1a82b, 0x90c02513, 0x10114014, 0x0018f704,
+  0xf000d400, 0xf2470114, 0xf2450160, 0x12c50160,
+  0x00516075, 0x0160f243, 0xfc234011, 0x28030100,
+  0xa8209010, 0x0005f603, 0xf7030113, 0xa8100005,
+  0x0160fc04, 0x29030e53, 0xfc279008, 0x802607ff,
+  0x28210073, 0x05fffc23, 0x90161c23, 0x90122815,
+  0x4ff50071, 0x01fffc21, 0x1c214ff5, 0x9ffa2905,
+  0x03fffc27, 0x1a411c27, 0x0018f604, 0x0800fc21,
+  0x9f7c2801, 0x0019f601, 0x903c2541, 0xd1001014,
+  0xd200f000, 0x0141c000, 0xf2310013, 0xfc210160,
+  0x2121e000, 0xfc03901c, 0x1a310160, 0x40116ff1,
+  0x001af501, 0x0018f601, 0xf7014011, 0x80080018,
+  0xf5015001, 0xa824001a, 0x0005f640, 0x90162800,
+  0xd200a81b, 0xd100d438, 0x4ff0d838, 0xa5122803,
+  0x80141c20, 0xd100a81a, 0xd000d438, 0x2802d838,
+  0xa50151f2, 0xd0001c12, 0x1800e404, 0x0200fc20,
+  0x908e2800, 0xe41bd000, 0xd5005011, 0x1f01e408,
+  0xf6431852, 0x41030004, 0xd3000831, 0x0521e808,
+  0xfff8fc42, 0xfffffc32, 0xfc411c51, 0xfc31ffff,
+  0xfc151fff, 0xa8184000, 0xa5212800, 0x28001832,
+  0x1c320412, 0x2000fc13, 0x0001fc42, 0xd300a431,
+  0xa521e804, 0x8000d200, 0x1c312800, 0x0004fc41,
+  0x2800a512, 0x0002fc41, 0xa4521c32, 0xa5125005,
+  0xf6421c32, 0x00410004, 0x01211022, 0x001af515,
+  0x0017f642, 0x0018f712, 0x0ec2fa00, 0x801ca824,
+  0xd100a81a, 0xfc40e000, 0xd3000007, 0x5025e808,
+  0xa5012802, 0x05121832, 0x1c451c32, 0x92b82925,
+  0x0004f640, 0xd000ac28, 0x1801e400, 0x2802a81a,
+  0xfc429010, 0x04210004, 0x90122801, 0x80321800,
+  0x8000fc21, 0x90062801, 0x802e1800, 0xd200a81b,
+  0xd100d400, 0x2803d800, 0xa517a427, 0x77810071,
+  0xf6421811, 0x25120005, 0x180090b0, 0x900a2803,
+  0x0002fc41, 0x80060410, 0x4000fc20, 0x5021a81d,
+  0x917a2800, 0xd46cd100, 0xd0002805, 0xa501d86c,
+  0x28055000, 0xd1001c10, 0x1812e408, 0x0004f643,
+  0x50140047, 0x4103ac27, 0x05240834, 0xfc441c14,
+  0xfc34ffff, 0xfc411fff, 0xfc31fff8, 0xa442ffff,
+  0xe808d400, 0x1843a512, 0xfc412805, 0x04230001,
+  0xfc131c43, 0xfc142000, 0xa4324000, 0x8000d300,
+  0xd100a512, 0x2805e804, 0xfc421c12, 0xa5230004,
+  0xfc422805, 0x1c130002, 0xa523a443, 0xf6711c13,
+  0x00720004, 0x01121021, 0x001af520, 0x0017f670,
+  0x0018f720, 0x80dc0050, 0xfffffc41, 0x1ffffc31,
+  0xfc402803, 0xfc30fff8, 0xd200ffff, 0xfc15e808,
+  0xa5012000, 0xac112803, 0x04101820, 0x00411c20,
+  0xfc40a454, 0xd2000001, 0xfc45e804, 0xa5040004,
+  0x8000d000, 0x1c242803, 0xa553a403, 0xf6151c23,
+  0x28050005, 0x71079022, 0x00525005, 0x40150010,
+  0x01206ff2, 0xf7021e72, 0x00500006, 0x0005f612,
   0x24206ff0, 0xd0009fe6, 0x0017e404, 0xfc201800,
-  0x28000200, 0xd0009060, 0x5012e41b, 0xd0001f02,
+  0x28000200, 0xd000914e, 0x5012e41b, 0xd0001f02,
   0x1801e408, 0xac250075, 0x0004f657, 0x08724107,
-  0x1c020512, 0xe808d200, 0xa8291820, 0xd1000410,
+  0x1c020512, 0xe808d200, 0xa8111820, 0xd1000410,
   0x1c20e804, 0xfc110017, 0xfc424000, 0x1c740002,
-  0x50031c73, 0x2800a810, 0x1c71a521, 0x0004f652,
+  0x50031c73, 0x2800a818, 0x1c71a521, 0x0004f652,
   0x10220051, 0xf5130121, 0xf652001a, 0xf7120017,
-  0x81600018, 0xd100a810, 0xd200d46c, 0x5004d86c,
-  0xa5212800, 0xd4001c14, 0x1c43e804, 0xe408d400,
-  0x18415013, 0xf6520075, 0x08230004, 0x05135042,
-  0x1c430802, 0xe444d400, 0x18420723, 0x1c420432,
-  0x0c50fa00, 0x50310050, 0xf000d300, 0xf6021c01,
-  0x00310004, 0x01211052, 0x0020f017, 0x12c10071,
-  0x28016031, 0x4ff19056, 0x12875012, 0xd1000812,
-  0x6307e414, 0x0724ac2a, 0x18120137, 0x02bcfc07,
-  0x60f40424, 0xf6041f14, 0x10540004, 0xf2340143,
-  0xf2330024, 0x60f40024, 0x01041243, 0x406460f3,
-  0x1e454013, 0x40144ff3, 0x1f752903, 0x9ff44017,
-  0x0532a82b, 0x1f1260f2, 0x0005800a, 0xf34cfaff,
-  0x50050050, 0x180080a6, 0x4000fc20, 0x90aa2800,
-  0xd46cd100, 0xd0002803, 0x5014d86c, 0x5000a501,
-  0xd1001c10, 0x0035e408, 0xac271812, 0xf6732805,
-  0x41030004, 0x05240834, 0xfc441c14, 0xfc34ffff,
-  0xfc411fff, 0xfc31fff8, 0xa442ffff, 0xe808d400,
-  0x1843a512, 0xfc412805, 0x04230001, 0xfc131c43,
-  0xfc142000, 0xa4324000, 0x8000d300, 0xd100a512,
-  0x2805e804, 0xfc421c12, 0xa5230004, 0xfc422805,
-  0x1c130002, 0xa523a443, 0xf6711c13, 0x00720004,
-  0x01121021, 0x001af520, 0x0017f670, 0x0018f720,
-  0xfa000050, 0xa8200b2e, 0x1c055005, 0xa3002905,
-  0xa83da837, 0xa07041c6, 0x1c755025, 0x48468ff0,
-  0xacf7acfd, 0xf000d500, 0xfa008006, 0x50030962,
-  0xf05180f0, 0x12c10260, 0x211260f1, 0xd00090e4,
-  0xf600f340, 0x6ff00003, 0x90d62900, 0x0260f050,
-  0xf80013b0, 0xf537092e, 0x5010001a, 0xd094d100,
-  0xd004d200, 0x1c105fd7, 0x50120021, 0x04701810,
-  0xd1001c10, 0x0013e408, 0xf6411830, 0x08120004,
-  0x1c320502, 0xe444d200, 0x18100021, 0x1c100470,
-  0x1c415031, 0x0004f640, 0x10500051, 0xf0130101,
-  0x00310020, 0x603112c1, 0x90102901, 0xfaff0040,
-  0xd300f1fa, 0x5007f3d8, 0xd7008372, 0x4ff1e414,
-  0x12835010, 0x63030810, 0x07021871, 0x60f20412,
-  0x00521f72, 0xf6430132, 0x00470004, 0xfc020054,
-  0x105302bc, 0xf2450134, 0x00730024, 0x0024f244,
-  0x60f51244, 0x60f40153, 0x40144063, 0x4ff41e35,
-  0x29044013, 0x40121f25, 0x05019ff4, 0xe414d000,
-  0xf000d500, 0xd3005007, 0x60f1f3d8, 0x830c1f01,
-  0x02fef250, 0xe404d100, 0xf5504010, 0x181002fe,
-  0x29006200, 0xd000900a, 0x1f03f330, 0xd0008020,
-  0x1e00f330, 0x90162900, 0xf330d000, 0x00015012,
-  0xf0501f12, 0x60f002c4, 0x0001f710, 0xe440d000,
-  0x00015082, 0x1d125000, 0x0836fa00, 0xfa005010,
-  0x54000830, 0xe440d100, 0xfaff1d10, 0x5010f2ba,
-  0xe440d100, 0xf3d8d400, 0x18401d10, 0x90802900,
-  0xe404d000, 0xe410d200, 0x18201801, 0x29016011,
-  0x5fe19248, 0xd1000410, 0x1c20e400, 0xfc211811,
-  0x280103ff, 0xf050929a, 0xd200000c, 0x0410f356,
-  0x61f10001, 0x1e210112, 0x900e2951, 0xd1001250,
-  0x0101f356, 0x40511e11, 0x200150a0, 0x5010901e,
-  0xe804d200, 0x1c200810, 0x00400012, 0x01201022,
-  0x001af202, 0xf9002902, 0x00100746, 0x6ff050a2,
-  0x924c2020, 0xf7415010, 0x1c400004, 0x2910800a,
-  0xf641923e, 0x6ff10004, 0x00430010, 0x01031020,
-  0x0019f630, 0x0018f632, 0x90242102, 0x00501051,
-  0xf0010110, 0xf0000020, 0x13010020, 0x67f11380,
-  0xf73161f0, 0x01010018, 0xf7314011, 0xd0000019,
-  0xd200e444, 0xd700d094, 0x0001d004, 0x70201810,
-  0xaca31c10, 0x50110023, 0x1c315fd2, 0x04201870,
-  0xd090d200, 0x1c211c70, 0xf6405002, 0x00510004,
-  0x01011050, 0x0020f010, 0xd098d100, 0x1c106ff0,
-  0xa8a31c32, 0x70201870, 0xf7421c70, 0xf6310005,
-  0xf7410018, 0xf6320017, 0x00100019, 0x25026ff0,
-  0x10109daa, 0x01054011, 0x0018f731, 0xf253acb5,
-  0xf2500160, 0xaca80160, 0xf25112c3, 0x00620160,
-  0x40136073, 0x0060fc02, 0x0100fc21, 0x90142801,
-  0x0005f641, 0x01320012, 0x0005f742, 0x01120042,
-  0x00354062, 0x5003acbb, 0xd7005004, 0xa8a8d008,
-  0x28056ff5, 0x6ff09014, 0x40115001, 0x00141c70,
-  0x24546ff4, 0x9ff4a8bc, 0xf33cd000, 0x18005007,
-  0xf9002800, 0xa8b00602, 0x0160fc00, 0x0047acb0,
-  0x6ff75005, 0x90062907, 0x80265004, 0xd00cd000,
-  0x60401800, 0x90182800, 0xd008d100, 0x18110020,
-  0x40150150, 0x00501f01, 0x24706ff0, 0x01529fe0,
-  0x50076ff4, 0x00400254, 0x28006ff0, 0xd000901e,
-  0x1800e404, 0x0200fc20, 0x90742900, 0xf33cd000,
-  0x18004013, 0x9fa82403, 0xd0008008, 0x1800f33c,
-  0xf9002030, 0xa8b00592, 0xf000d500, 0xf3d8d400,
-  0xa8a31a00, 0x0018f631, 0x0800fc20, 0x9ef82800,
-  0x0019f630, 0x9ca42510, 0x00501011, 0xc000d200,
-  0xf2010110, 0xfc210160, 0x2121e000, 0xfc009c8a,
-  0x1a000160, 0x40106ff0, 0x001af530, 0x0018f630,
-  0xf7304010, 0x8c740018, 0x1c207010, 0x50108058,
-  0xe41bd100, 0xd0001f10, 0xd300e408, 0x5012f3d8,
-  0xf000d500, 0x18400004, 0x0004f631, 0x08124101,
-  0x1c420502, 0x0004f630, 0x10200031, 0xf5170101,
-  0xf630001a, 0xf7100017, 0x1c370018, 0xe404d000,
-  0x60101800, 0x90182800, 0xe410d000, 0x18100001,
-  0x1c107010, 0xe804d000, 0x0400fc11, 0xd0001c01,
-  0x5401e440, 0xfaff1d01, 0x5020efde, 0xe440d100,
-  0xd0001d10, 0x5001f4b8, 0xf5b0faff, 0xe440d000,
-  0x1d015401, 0xefc0faff, 0xd1005040, 0x1d10e440,
-  0xf4b8d000, 0x44005011, 0xf590faff, 0xe440d000,
-  0x1d015401, 0xefa0faff, 0xd4005007, 0x5080e400,
-  0xe440d100, 0xf0511d10, 0xd2000260, 0xfc40f340,
-  0x01720100, 0xac8a0870, 0x1e200401, 0x90302901,
-  0x6ff10001, 0x90dc2911, 0x18420070, 0x41305011,
-  0x50000801, 0x28020412, 0x007290ca, 0xfc321022,
-  0x1823dc00, 0x04131843, 0x9ff82903, 0x007180b6,
-  0x41315012, 0xacaa0812, 0x6ff10001, 0xa6112801,
-  0xac81a501, 0xac970070, 0xaca01020, 0xdc00fc30,
-  0x5000ac98, 0x1840acb8, 0x0410a8a9, 0x90802800,
-  0x0260f055, 0x0905a8a0, 0x60f00050, 0xfa00acb0,
-  0x60b50638, 0xa8b52905, 0x0050901a, 0xfa004010,
-  0x00500628, 0xfa004020, 0x00500620, 0xfa004030,
-  0xa8980618, 0xe000d200, 0x50101801, 0xace10850,
-  0x04021822, 0x900e2902, 0x50026ff5, 0xfaff0050,
-  0x801cf46c, 0xeec0faff, 0x6ff55010, 0xac085002,
-  0xfc010061, 0x00500070, 0xfaffa893, 0xa8b8f1e6,
-  0xf000d500, 0xe400d400, 0x2c304010, 0xa8809f78,
-  0xa889a897, 0x29474017, 0x9efc1f10, 0xe440d000,
-  0x00055401, 0xfaff1d51, 0x5100ee7e, 0xf334d100,
-  0x1a101d50, 0x28005001, 0xacb9910a, 0xd3000010,
-  0x1010f538, 0xa8edace8, 0x01150030, 0x01501035,
-  0x1800aca8, 0x90922910, 0x01300050, 0x0016f604,
-  0x00320051, 0x01127051, 0x00511e20, 0x70410032,
-  0x01122804, 0xd2001e21, 0x1051f000, 0xf2210112,
-  0xacb10024, 0x0024f221, 0xaca09098, 0xfaffac99,
-  0xa89af31c, 0x2910a8a4, 0x12429088, 0x401260f2,
-  0x280261f2, 0xa8b0907c, 0x50017065, 0x015060f0,
-  0x5000acb0, 0x00420027, 0xf418d300, 0x10224010,
-  0xf2320123, 0x1a330002, 0xa8b40045, 0xd1000114,
-  0x0141f538, 0x1e110054, 0x1f211f31, 0x00010072,
-  0x24216ff1, 0x803a9fd0, 0x904e2920, 0xd1000050,
-  0x7060f538, 0x01010012, 0x0050acb1, 0x01027050,
-  0xfaffaca2, 0xa8a0eda2, 0xd2007045, 0x5003f538,
-  0x1e010152, 0xa8b21e20, 0xef06faff, 0x901a2910,
-  0xd200a8b9, 0x5010f334, 0x1a210810, 0x04010700,
-  0x50011d21, 0x1c01a8a8, 0x50a0a8b9, 0x21014011,
-  0xd0009efa, 0x5401e440, 0x1d510005, 0xed58faff,
-  0xd1005200, 0x5003f332, 0x1d505004, 0xf458d500,
-  0x28001a10, 0xacbc905e, 0x0004f050, 0x90122910,
-  0x000df652, 0xf6501851, 0xfaff000c, 0x8022f2d0,
-  0x2920a8bc, 0xfaff9036, 0xf053ed1e, 0xf6520008,
-  0xf650000d, 0x5011000c, 0x0051ac09, 0xf044faff,
-  0xd100a8bc, 0x5010f332, 0x00125003, 0x08401a21,
-  0x04010700, 0xf4531d21, 0x40140004, 0x29644105,
-  0xd0009fa6, 0xfc11e440, 0xd4000080, 0xd500e400,
-  0x1d01f000, 0x18401d01, 0x0263f651, 0xfc200002,
-  0x133203ff, 0x63f20412, 0x29020502, 0xd0009042,
-  0x1800e404, 0x29006100, 0xd0009036, 0x5fe1e444,
-  0x18500005, 0x1850acb8, 0x1c500410, 0xe8a6faff,
-  0xd400a8b8, 0x5003e400, 0xe804d200, 0x01f8fc41,
-  0x07fffc31, 0x1c507010, 0xf000d500, 0xd0001c21,
-  0x1800e404, 0x28006080, 0xf958f9ff, 0x02c4f051,
-  0xf34cd000, 0x60f11842, 0x03fffc22, 0x1e000110,
-  0x0013acb8, 0x10530054, 0x50130134, 0x0020f044,
-  0x00500813, 0xf0070035, 0xfc25000c, 0xfc2403ff,
-  0x04573000, 0x90062807, 0x908c2804, 0x000cf007,
-  0x045712a7, 0x90062807, 0x909a2804, 0x000cf007,
-  0x04571347, 0x90062807, 0x90ce2804, 0x0260f001,
-  0x0005a8ba, 0x60f11301, 0x901a2112, 0xf344d000,
-  0xf6005003, 0x29000002, 0xf8d8f9ff, 0x0260f050,
-  0x812e13c0, 0x0260f051, 0x13415003, 0x211260f1,
-  0xd0009018, 0xf600f344, 0x29000006, 0xf8b4f9ff,
-  0x0260f050, 0x810a13d0, 0x0260f051, 0x211260f1,
-  0xd0009056, 0x1e00f340, 0xf9ff2900, 0xf050f896,
-  0x13800260, 0x043280ec, 0x50030005, 0xf9ff2902,
-  0xd000f882, 0x1800f3d8, 0xf9ff2800, 0xd000f780,
-  0x801ef3d8, 0x00050432, 0x29025003, 0xf864f9ff,
-  0xf4b8d000, 0x28001800, 0xf762f9ff, 0xf4b8d000,
-  0x0004f600, 0xf0518046, 0x12410260, 0x211260f1,
-  0xd000907e, 0xf600f340, 0x29000001, 0xf834f9ff,
-  0x0260f050, 0x808a1390, 0x00050432, 0x29025003,
-  0xf820f9ff, 0xf4b8d000, 0x0040f000, 0xf9ff2800,
-  0xd000f71c, 0xf600f4b8, 0x20100044, 0xf804f9ff,
-  0xf70af8ff, 0xd1005010, 0x5fd2d094, 0xd1001c10,
-  0x1810d004, 0x1c100420, 0xfabef8ff, 0xe408d100,
-  0x00175013, 0xf6421871, 0x08230004, 0x1c730513,
-  0x001af201, 0xf5014ff1, 0xf8ff001a, 0xf051faf4,
-  0x12810260, 0x211260f1, 0xf6caf9ff, 0xf340d000,
-  0x0002f600, 0xf9ff2900, 0xf050f7aa, 0x13a00260,
-  0x29006010, 0xf79cf9ff, 0xf6a2f8ff, 0xe414d000,
-  0x60711801, 0x70820012, 0x1f011f02, 0x4dc6a070,
-  0xac47ac4d, 0xf000d200, 0x1000fc41, 0xf344d700,
-  0x0260f024, 0x00420801, 0x00010412, 0x10210073,
-  0x01132802, 0x0002f633, 0x6ff10031, 0x28019014,
-  0x00019042, 0x10210072, 0xf6250112, 0x80440003,
-  0x913e2911, 0x50140001, 0x41715003, 0xd1000814,
-  0x1812e400, 0x28020442, 0xd2009128, 0x0003dc80,
-  0x01231023, 0x18131833, 0x29030443, 0x50039ff2,
-  0x00018110, 0x50050072, 0x10215013, 0xf7250112,
-  0xac1b0003, 0x00720001, 0x10216ff5, 0x01122f85,
-  0xac3a1a22, 0x00019040, 0xd7005012, 0xd300dc80,
-  0x4171e400, 0x00010812, 0x1021ac20, 0x01740014,
-  0x04271837, 0x90b62807, 0xa8380057, 0x10274015,
-  0x01702c85, 0x1c071847, 0xd0009fe8, 0xf004f000,
-  0x80040260, 0x4101ac20, 0xac2c0914, 0x60f00040,
-  0xfa00ac30, 0xa82800e4, 0x290060b0, 0xa830901a,
-  0xfa004010, 0xa83000d4, 0xfa004020, 0xa83000cc,
-  0xfa004030, 0xa82000c4, 0x29005001, 0xd0009008,
-  0x1801de50, 0x5010ac29, 0xe000d200, 0x0810a831,
-  0x04011821, 0x90222801, 0xe96cfaff, 0xa830ac0d,
-  0xa825a82a, 0xa8390053, 0x6ff26ff0, 0xfaff4043,
-  0x0050ec92, 0x80285005, 0x90202805, 0xac38a838,
-  0x1801a838, 0xa82aa830, 0x6ff26ff0, 0xeedefaff,
-  0x4ff5a838, 0x40402905, 0x50059fe6, 0x0002a820,
-  0xf344d700, 0x00711022, 0xf7150121, 0xa81b0003,
-  0x01071020, 0x0002f773, 0xa84da847, 0xa0704246,
-  0xe404d100, 0x18112800, 0x60419012, 0x90262801,
-  0xe410d000, 0x70411801, 0x60218010, 0x90162801,
-  0xe410d000, 0x70211801, 0xd0001c01, 0xfc12e804,
-  0x1c020400, 0xd100a070, 0x0101f000, 0xf6111020,
-  0x00130314, 0x60130002, 0x2000fc02, 0x900e2803,
-  0xfc311011, 0xfc212000, 0x800621fc, 0xf338d100,
-  0xf418d300, 0x1d320103, 0x0002f531, 0x0000a070,
+  0x00050018, 0x0cc6fa00, 0x5001a824, 0xd1001c41,
+  0x2805d400, 0xd0000057, 0xd200d800, 0xa501f000,
+  0xf0220010, 0x73400010, 0x50001803, 0x28036403,
+  0x001090aa, 0x18007800, 0x1000fc20, 0x90142800,
+  0xd000a82b, 0x4012f34c, 0x1e000130, 0x24204010,
+  0xd000901c, 0x1802e408, 0x0004f643, 0x50140045,
+  0x08344103, 0x1c040524, 0x50000054, 0xfc427541,
+  0xfc32ffff, 0x28071fff, 0x4000fc15, 0xfc411811,
+  0xfc31fff8, 0xa512ffff, 0xe808d100, 0x18132807,
+  0x1c130423, 0x2000fc13, 0x0001fc41, 0xd300a432,
+  0xa5128000, 0xe804d100, 0x1c122807, 0x0004fc42,
+  0x2807a523, 0x0002fc42, 0xa4531c13, 0xa5235005,
+  0xf6411c13, 0x00420004, 0x01121021, 0x001af525,
+  0x0017f643, 0x0018f723, 0xa82a1c45, 0xf34cd100,
+  0x1f100121, 0x29051845, 0xa837a300, 0x41c6a83d,
+  0xa818a070, 0xd46cd100, 0xd86cd200, 0x28005004,
+  0x1c14a521, 0xe804d400, 0xd4001c43, 0x5013e408,
+  0x00751841, 0x0004f652, 0x50420823, 0x08020513,
+  0xd4001c43, 0x0723e444, 0x04321842, 0xfa001c42,
+  0x00500b9c, 0xd3005031, 0x1c01f000, 0x0004f602,
+  0x10520031, 0xf0170121, 0x00710020, 0x603112c1,
+  0x90582801, 0x50124ff1, 0x08121287, 0xe414d100,
+  0xac1a6307, 0x01370724, 0xfc071812, 0x042402bc,
+  0x1f1460f4, 0x0004f604, 0x01431054, 0x0024f234,
+  0x0024f233, 0x124360f4, 0x60f30104, 0x40134064,
+  0x4ff31e45, 0x29034014, 0x40171f75, 0xa81b9ff4,
+  0x60f20532, 0x00051f12, 0x00058008, 0xf184faff,
+  0x1c505000, 0x8f240054, 0xacfd4846, 0xd500acf7,
+  0x8006f000, 0x0962fa00, 0x80f05003, 0x0260f051,
+  0x60f112c1, 0x90e42112, 0xf340d000, 0x0003f600,
+  0x29006ff0, 0xf05090d6, 0x13b00260, 0x092ef800,
+  0x001af537, 0xd1005010, 0xd200d094, 0x5fd7d004,
+  0x00211c10, 0x18105012, 0x1c100470, 0xe408d100,
+  0x18300013, 0x0004f641, 0x05020812, 0xd2001c32,
+  0x0021e444, 0x04701810, 0x50311c10, 0xf6401c41,
+  0x00510004, 0x01011050, 0x0020f013, 0x12c10031,
+  0x29016031, 0x00409010, 0xf0e8faff, 0xf3e0d300,
+  0x83725007, 0xe414d700, 0x50104ff1, 0x08101283,
+  0x18716303, 0x04120702, 0x1f7260f2, 0x01320052,
+  0x0004f643, 0x00540047, 0x02bcfc02, 0x01341053,
+  0x0024f245, 0xf2440073, 0x12440024, 0x015360f5,
+  0x406360f4, 0x1e354014, 0x40134ff4, 0x1f252904,
+  0x9ff44012, 0xd0000501, 0xd500e414, 0x5007f000,
+  0xf3e0d300, 0x1f0160f1, 0xf250830c, 0xd10002fe,
+  0x4010e404, 0x02fef550, 0x62001810, 0x900a2900,
+  0xf330d000, 0x80201f03, 0xf330d000, 0x29001e00,
+  0xd0009016, 0x5012f330, 0x1f120001, 0x02c4f050,
+  0xf71060f0, 0xd0000001, 0x5082e440, 0x50000001,
+  0xfa001d12, 0x50100836, 0x0830fa00, 0xd1005400,
+  0x1d10e440, 0xf1a8faff, 0xd1005010, 0xd400e440,
+  0x1d10f3e0, 0x29001840, 0xd0009080, 0xd200e404,
+  0x1801e410, 0x60111820, 0x92482901, 0x04105fe1,
+  0xe400d100, 0x18111c20, 0x03fffc21, 0x929a2801,
+  0x000cf050, 0xf360d200, 0x00010410, 0x011261f1,
+  0x29511e21, 0x1250900e, 0xf360d100, 0x1e110101,
+  0x50a04051, 0x901e2001, 0xd2005010, 0x0810e804,
+  0x00121c20, 0x10220040, 0xf2020120, 0x2902001a,
+  0x0746f900, 0x50a20010, 0x20206ff0, 0x5010924c,
+  0x0004f741, 0x800a1c40, 0x923e2910, 0x0004f641,
+  0x00106ff1, 0x10200043, 0xf6300103, 0xf6320019,
+  0x21020018, 0x10519024, 0x01100050, 0x0020f001,
+  0x0020f000, 0x13801301, 0x61f067f1, 0x0018f731,
+  0x40110101, 0x0019f731, 0xe444d000, 0xd094d200,
+  0xd004d700, 0x18100001, 0x1c107020, 0x0023aca3,
+  0x5fd25011, 0x18701c31, 0xd2000420, 0x1c70d090,
+  0x50021c21, 0x0004f640, 0x10500051, 0xf0100101,
+  0xd1000020, 0x6ff0d098, 0x1c321c10, 0x1870a8a3,
+  0x1c707020, 0x0005f742, 0x0018f631, 0x0017f741,
+  0x0019f632, 0x6ff00010, 0x9daa2502, 0x40111010,
+  0xf7310105, 0xacb50018, 0x0160f253, 0x0160f250,
+  0x12c3aca8, 0x0160f251, 0x60730062, 0xfc024013,
+  0xfc210060, 0x28010100, 0xf6419014, 0x00120005,
+  0xf7420132, 0x00420005, 0x40620112, 0xacbb0035,
+  0x50045003, 0xd008d700, 0x6ff5a8a8, 0x90142805,
+  0x50016ff0, 0x1c704011, 0x6ff40014, 0xa8bc2454,
+  0xd0009ff4, 0x5007f33c, 0x28001800, 0x0602f900,
+  0xfc00a8b0, 0xacb00160, 0x50050047, 0x29076ff7,
+  0x50049006, 0xd0008026, 0x1800d00c, 0x28006040,
+  0xd1009018, 0x0020d008, 0x01501811, 0x1f014015,
+  0x6ff00050, 0x9fe02470, 0x6ff40152, 0x02545007,
+  0x6ff00040, 0x901e2800, 0xe404d000, 0xfc201800,
+  0x29000200, 0xd0009074, 0x4013f33c, 0x24031800,
+  0x80089fa8, 0xf33cd000, 0x20301800, 0x0592f900,
+  0xd500a8b0, 0xd400f000, 0x1a00f3e0, 0xf631a8a3,
+  0xfc200018, 0x28000800, 0xf6309ef8, 0x25100019,
+  0x10119ca4, 0xd2000050, 0x0110c000, 0x0160f201,
+  0xe000fc21, 0x9c8a2121, 0x0160fc00, 0x6ff01a00,
+  0xf5304010, 0xf630001a, 0x40100018, 0x0018f730,
+  0x70108c74, 0x80581c20, 0xd1005010, 0x1f10e41b,
+  0xe408d000, 0xf3e0d300, 0xd5005012, 0x0004f000,
+  0xf6311840, 0x41010004, 0x05020812, 0xf6301c42,
+  0x00310004, 0x01011020, 0x001af517, 0x0017f630,
+  0x0018f710, 0xd0001c37, 0x1800e404, 0x28006010,
+  0xd0009018, 0x0001e410, 0x70101810, 0xd0001c10,
+  0xfc11e804, 0x1c010400, 0xe440d000, 0x1d015401,
+  0xeeccfaff, 0xd1005020, 0x1d10e440, 0xf4c0d000,
+  0xfaff5001, 0xd000f49e, 0x5401e440, 0xfaff1d01,
+  0x5040eeae, 0xe440d100, 0xd0001d10, 0x5011f4c0,
+  0xfaff4400, 0xd000f47e, 0x5401e440, 0xfaff1d01,
+  0x5007ee8e, 0xe400d400, 0xd1005080, 0x1d10e440,
+  0x0260f051, 0xf340d200, 0x0100fc40, 0x08700172,
+  0x0401ac8a, 0x29011e20, 0x00019030, 0x29116ff1,
+  0x007090dc, 0x50111842, 0x08014130, 0x04125000,
+  0x90ca2802, 0x10220072, 0xdc00fc32, 0x18431823,
+  0x29030413, 0x80b69ff8, 0x50120071, 0x08124131,
+  0x0001acaa, 0x28016ff1, 0xa501a611, 0x0070ac81,
+  0x1020ac97, 0xfc30aca0, 0xac98dc00, 0xacb85000,
+  0xa8a91840, 0x28000410, 0xf0559080, 0xa8a00260,
+  0x00500905, 0xacb060f0, 0x0638fa00, 0x290560b5,
+  0x901aa8b5, 0x40100050, 0x0628fa00, 0x40200050,
+  0x0620fa00, 0x40300050, 0x0618fa00, 0xd200a898,
+  0x1801e000, 0x08505010, 0x1822ace1, 0x29020402,
+  0x6ff5900e, 0x00505002, 0xf35afaff, 0xfaff801c,
+  0x5010edae, 0x50026ff5, 0x0061ac08, 0x0070fc01,
+  0xa8930050, 0xf0d4faff, 0xd500a8b8, 0xd400f000,
+  0x4010e400, 0x9f782c30, 0xa897a880, 0x4017a889,
+  0x1f102947, 0xd0009efc, 0x5401e440, 0x1d510005,
+  0xed6cfaff, 0xd1005100, 0x1d50f334, 0x50011a10,
+  0x910a2800, 0x0010acb9, 0xf540d300, 0xace81010,
+  0x0030a8ed, 0x10350115, 0xaca80150, 0x29101800,
+  0x00509092, 0xf6040130, 0x00510016, 0x70510032,
+  0x1e200112, 0x00320051, 0x28047041, 0x1e210112,
+  0xf000d200, 0x01121051, 0x0024f221, 0xf221acb1,
+  0x90980024, 0xac99aca0, 0xf20afaff, 0xa8a4a89a,
+  0x90882910, 0x60f21242, 0x61f24012, 0x907c2802,
+  0x7065a8b0, 0x60f05001, 0xacb00150, 0x00275000,
+  0xd3000042, 0x4010f420, 0x01231022, 0x0002f232,
+  0x00451a33, 0x0114a8b4, 0xf540d100, 0x00540141,
+  0x1f311e11, 0x00721f21, 0x6ff10001, 0x9fd02421,
+  0x2920803a, 0x0050904e, 0xf540d100, 0x00127060,
+  0xacb10101, 0x70500050, 0xaca20102, 0xec90faff,
+  0x7045a8a0, 0xf540d200, 0x01525003, 0x1e201e01,
+  0xfaffa8b2, 0x2910edf4, 0xa8b9901a, 0xf334d200,
+  0x08105010, 0x07001a21, 0x1d210401, 0xa8a85001,
+  0xa8b91c01, 0x401150a0, 0x9efa2101, 0xe440d000,
+  0x00055401, 0xfaff1d51, 0x5200ec46, 0xf332d100,
+  0x50045003, 0xd5001d50, 0x1a10f460, 0x905e2800,
+  0xf050acbc, 0x29100004, 0xf6529012, 0x1851000d,
+  0x000cf650, 0xf1befaff, 0xa8bc8022, 0x90362920,
+  0xec0cfaff, 0x0008f053, 0x000df652, 0x000cf650,
+  0xac095011, 0xfaff0051, 0xa8bcef32, 0xf332d100,
+  0x50035010, 0x1a210012, 0x07000840, 0x1d210401,
+  0x0004f453, 0x41054014, 0x9fa62964, 0xe440d000,
+  0x0080fc11, 0xe400d400, 0xf000d500, 0x1d011d01,
+  0xf6511840, 0x00020263, 0x03fffc20, 0x04121332,
+  0x050263f2, 0x90422902, 0xe404d000, 0x61001800,
+  0x90362900, 0xe444d000, 0x00055fe1, 0xacb81850,
+  0x04101850, 0xfaff1c50, 0xa8b8e78c, 0xe400d400,
+  0xd2005003, 0xfc41e804, 0xfc3101f8, 0x701007ff,
+  0xd5001c50, 0x1c21f000, 0xe404d000, 0x60801800,
+  0xf9ff2800, 0xf051f958, 0xd00002c4, 0x1842f356,
+  0xfc2260f1, 0x011003ff, 0xacb81e00, 0x00540013,
+  0x01341053, 0xf0445013, 0x08130020, 0x00350050,
+  0x000cf007, 0x03fffc25, 0x3000fc24, 0x28070457,
+  0x28049006, 0xf007908c, 0x12a7000c, 0x28070457,
+  0x28049006, 0xf007909a, 0x1347000c, 0x28070457,
+  0x28049006, 0xf00190ce, 0xa8ba0260, 0x13010005,
+  0x211260f1, 0xd000901a, 0x5003f344, 0x0002f600,
+  0xf9ff2900, 0xf050f8d8, 0x13c00260, 0xf051812e,
+  0x50030260, 0x60f11341, 0x90182112, 0xf344d000,
+  0x0006f600, 0xf9ff2900, 0xf050f8b4, 0x13d00260,
+  0xf051810a, 0x60f10260, 0x90562112, 0xf340d000,
+  0x29001e00, 0xf896f9ff, 0x0260f050, 0x80ec1380,
+  0x00050432, 0x29025003, 0xf882f9ff, 0xf3e0d000,
+  0x28001800, 0xf780f9ff, 0xf3e0d000, 0x0432801e,
+  0x50030005, 0xf9ff2902, 0xd000f864, 0x1800f4c0,
+  0xf9ff2800, 0xd000f762, 0xf600f4c0, 0x80460004,
+  0x0260f051, 0x60f11241, 0x907e2112, 0xf340d000,
+  0x0001f600, 0xf9ff2900, 0xf050f834, 0x13900260,
+  0x0432808a, 0x50030005, 0xf9ff2902, 0xd000f820,
+  0xf000f4c0, 0x28000040, 0xf71cf9ff, 0xf4c0d000,
+  0x0044f600, 0xf9ff2010, 0xf8fff804, 0x5010f70a,
+  0xd094d100, 0x1c105fd2, 0xd004d100, 0x04201810,
+  0xf8ff1c10, 0xd100fabe, 0x5013e408, 0x18710017,
+  0x0004f642, 0x05130823, 0xf2011c73, 0x4ff1001a,
+  0x001af501, 0xfaf4f8ff, 0x0260f051, 0x60f11281,
+  0xf9ff2112, 0xd000f6ca, 0xf600f340, 0x29000002,
+  0xf7aaf9ff, 0x0260f050, 0x601013a0, 0xf9ff2900,
+  0xf8fff79c, 0xd000f6a2, 0x1801e414, 0x00126071,
+  0x1f027082, 0xa0701f01, 0xac4d4dc6, 0xd200ac47,
+  0xfc41f000, 0xd7001000, 0xf024f344, 0x08010260,
+  0x04120042, 0x00730001, 0x28021021, 0xf6330113,
+  0x00310002, 0x90146ff1, 0x90422801, 0x00720001,
+  0x01121021, 0x0003f625, 0x29118044, 0x0001913e,
+  0x50035014, 0x08144171, 0xe400d100, 0x04421812,
+  0x91282802, 0xdc80d200, 0x10230003, 0x18330123,
+  0x04431813, 0x9ff22903, 0x81105003, 0x00720001,
+  0x50135005, 0x01121021, 0x0003f725, 0x0001ac1b,
+  0x6ff50072, 0x2f851021, 0x1a220112, 0x9040ac3a,
+  0x50120001, 0xdc80d700, 0xe400d300, 0x08124171,
+  0xac200001, 0x00141021, 0x18370174, 0x28070427,
+  0x005790b6, 0x4015a838, 0x2c851027, 0x18470170,
+  0x9fe81c07, 0xf000d000, 0x0260f004, 0xac208004,
+  0x09144101, 0x0040ac2c, 0xac3060f0, 0x00e4fa00,
+  0x60b0a828, 0x901a2900, 0x4010a830, 0x00d4fa00,
+  0x4020a830, 0x00ccfa00, 0x4030a830, 0x00c4fa00,
+  0x5001a820, 0x90082900, 0xde50d000, 0xac291801,
+  0xd2005010, 0xa831e000, 0x18210810, 0x28010401,
+  0xfaff9022, 0xac0de85a, 0xa82aa830, 0x0053a825,
+  0x6ff0a839, 0x40436ff2, 0xeb80faff, 0x50050050,
+  0x28058028, 0xa8389020, 0xa838ac38, 0xa8301801,
+  0x6ff0a82a, 0xfaff6ff2, 0xa838edcc, 0x29054ff5,
+  0x9fe64040, 0xa8205005, 0xd7000002, 0x1022f344,
+  0x01210071, 0x0003f715, 0x1020a81b, 0xf7730107,
+  0xa8470002, 0x4246a84d, 0xd100a070, 0x2800e404,
+  0x90121811, 0x28016041, 0xd0009026, 0x1801e410,
+  0x80107041, 0x28016021, 0xd0009016, 0x1801e410,
+  0x1c017021, 0xe804d000, 0x0400fc12, 0xa0701c02,
+  0xf000d100, 0x10200101, 0x0314f611, 0x00020013,
+  0xfc026013, 0x28032000, 0x1011900e, 0x2000fc31,
+  0x21fcfc21, 0xd1008006, 0xd300f338, 0x0103f420,
+  0xf5311d32, 0xa0700002,
 };
 
-const unsigned long sizeof_scu_isopprog_array = 7024; /* 0x00001b70 */
+const unsigned long sizeof_scu_isopprog_array = 7304; /* 0x00001c88 */

[incubator-nuttx] 21/21: arch: cxd56xx: Fix parameter check of hostif buffer

Posted by je...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

jerpelea pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git

commit 6b5a4cbfd36947407747c42874cd4f5b41a91f86
Author: SPRESENSE <41...@users.noreply.github.com>
AuthorDate: Wed May 19 17:04:54 2021 +0900

    arch: cxd56xx: Fix parameter check of hostif buffer
    
    Fix a parameter check of the buffer attribute in opening hostif driver.
---
 arch/arm/src/cxd56xx/cxd56_hostif.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/src/cxd56xx/cxd56_hostif.c b/arch/arm/src/cxd56xx/cxd56_hostif.c
index c0d3934..522e11d 100644
--- a/arch/arm/src/cxd56xx/cxd56_hostif.c
+++ b/arch/arm/src/cxd56xx/cxd56_hostif.c
@@ -211,7 +211,7 @@ static int hif_open(FAR struct file *filep)
     }
 
   if ((filep->f_oflags & O_WRONLY) &&
-      ((priv->flags & HOSTIF_BUFF_ATTR_WRITE) != 0))
+      ((priv->flags & HOSTIF_BUFF_ATTR_READ) != 0))
     {
       return -EINVAL;
     }

[incubator-nuttx] 13/21: arch: cxd56xx: Fix multiple open and close ADC driver

Posted by je...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

jerpelea pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git

commit f0cae6cdf351d6842def9aee1c7ac19f40daf76c
Author: SPRESENSE <41...@users.noreply.github.com>
AuthorDate: Wed May 19 17:04:24 2021 +0900

    arch: cxd56xx: Fix multiple open and close ADC driver
    
    ADC driver does not support multiple open and close. It causes the memory
    corruption by multiple free. This commit fixes this problem by introducing
    the reference counter.
---
 arch/arm/src/cxd56xx/cxd56_adc.c | 50 +++++++++++++++++++++++++++++++++++++++-
 1 file changed, 49 insertions(+), 1 deletion(-)

diff --git a/arch/arm/src/cxd56xx/cxd56_adc.c b/arch/arm/src/cxd56xx/cxd56_adc.c
index 728a01b..9f3ecda 100644
--- a/arch/arm/src/cxd56xx/cxd56_adc.c
+++ b/arch/arm/src/cxd56xx/cxd56_adc.c
@@ -35,6 +35,7 @@
 #include <nuttx/kmalloc.h>
 #include <nuttx/fs/fs.h>
 #include <nuttx/irq.h>
+#include <nuttx/semaphore.h>
 #include <arch/chip/scu.h>
 #include <arch/chip/adc.h>
 
@@ -172,6 +173,8 @@ struct cxd56adc_dev_s
   struct scufifo_wm_s *wm;        /* water mark */
   struct math_filter_s *filter;   /* math filter */
   struct scuev_notify_s * notify; /* notify */
+  sem_t            exclsem;       /* exclusive semaphore */
+  int              crefs;         /* reference count */
 };
 
 /****************************************************************************
@@ -218,6 +221,7 @@ static struct cxd56adc_dev_s g_lpadc0priv =
   .wm     = NULL,
   .filter = NULL,
   .notify = NULL,
+  .crefs  = 0,
 };
 #endif
 
@@ -233,6 +237,7 @@ static struct cxd56adc_dev_s g_lpadc1priv =
   .wm     = NULL,
   .filter = NULL,
   .notify = NULL,
+  .crefs  = 0,
 };
 #endif
 
@@ -248,6 +253,7 @@ static struct cxd56adc_dev_s g_lpadc2priv =
   .wm     = NULL,
   .filter = NULL,
   .notify = NULL,
+  .crefs  = 0,
 };
 #endif
 
@@ -263,6 +269,7 @@ static struct cxd56adc_dev_s g_lpadc3priv =
   .wm     = NULL,
   .filter = NULL,
   .notify = NULL,
+  .crefs  = 0,
 };
 #endif
 
@@ -278,6 +285,7 @@ static struct cxd56adc_dev_s g_hpadc0priv =
   .wm     = NULL,
   .filter = NULL,
   .notify = NULL,
+  .crefs  = 0,
 };
 #endif
 
@@ -293,6 +301,7 @@ static struct cxd56adc_dev_s g_hpadc1priv =
   .wm     = NULL,
   .filter = NULL,
   .notify = NULL,
+  .crefs  = 0,
 };
 #endif
 
@@ -703,9 +712,23 @@ static int cxd56_adc_open(FAR struct file *filep)
   int type;
 
   DEBUGASSERT(priv != NULL);
-  DEBUGASSERT(priv->seq == NULL);
   DEBUGASSERT(priv->ch < CH_MAX);
 
+  /* Increment reference counter */
+
+  nxsem_wait_uninterruptible(&priv->exclsem);
+
+  priv->crefs++;
+  DEBUGASSERT(priv->crefs > 0);
+
+  if (priv->crefs > 1)
+    {
+      nxsem_post(&priv->exclsem);
+      return OK;
+    }
+
+  DEBUGASSERT(priv->seq == NULL);
+
   type = SCU_BUS_LPADC0 + priv->ch;
 
   /* Open sequencer */
@@ -713,6 +736,7 @@ static int cxd56_adc_open(FAR struct file *filep)
   priv->seq = seq_open(SEQ_TYPE_NORMAL, type);
   if (!priv->seq)
     {
+      nxsem_post(&priv->exclsem);
       return -ENOENT;
     }
 
@@ -725,11 +749,14 @@ static int cxd56_adc_open(FAR struct file *filep)
   ret = set_ofstgain(priv);
   if (ret < 0)
     {
+      nxsem_post(&priv->exclsem);
       return ret;
     }
 
   ainfo("open ch%d freq%d scufifo%d\n", priv->ch, priv->freq, priv->fsize);
 
+  nxsem_post(&priv->exclsem);
+
   return OK;
 }
 
@@ -750,6 +777,19 @@ static int cxd56_adc_close(FAR struct file *filep)
   DEBUGASSERT(priv->seq != NULL);
   DEBUGASSERT(priv->ch < CH_MAX);
 
+  /* Decrement reference counter */
+
+  nxsem_wait_uninterruptible(&priv->exclsem);
+
+  DEBUGASSERT(priv->crefs > 0);
+  priv->crefs--;
+
+  if (priv->crefs > 0)
+    {
+      nxsem_post(&priv->exclsem);
+      return OK;
+    }
+
   /* Close sequencer */
 
   seq_close(priv->seq);
@@ -773,6 +813,8 @@ static int cxd56_adc_close(FAR struct file *filep)
       priv->notify = NULL;
     }
 
+  nxsem_post(&priv->exclsem);
+
   return OK;
 }
 
@@ -1058,6 +1100,7 @@ int cxd56_adcinitialize(void)
       return ret;
     }
 
+  nxsem_init(&g_lpadc0priv.exclsem, 0, 1);
 #endif
 #if defined (CONFIG_CXD56_LPADC1) || defined (CONFIG_CXD56_LPADC0_1) || defined (CONFIG_CXD56_LPADC_ALL)
   ret = register_driver("/dev/lpadc1", &g_adcops, 0666, &g_lpadc1priv);
@@ -1067,6 +1110,7 @@ int cxd56_adcinitialize(void)
       return ret;
     }
 
+  nxsem_init(&g_lpadc1priv.exclsem, 0, 1);
 #endif
 #if defined (CONFIG_CXD56_LPADC2) || defined (CONFIG_CXD56_LPADC_ALL)
   ret = register_driver("/dev/lpadc2", &g_adcops, 0666, &g_lpadc2priv);
@@ -1076,6 +1120,7 @@ int cxd56_adcinitialize(void)
       return ret;
     }
 
+  nxsem_init(&g_lpadc2priv.exclsem, 0, 1);
 #endif
 #if defined (CONFIG_CXD56_LPADC3) || defined (CONFIG_CXD56_LPADC_ALL)
   ret = register_driver("/dev/lpadc3", &g_adcops, 0666, &g_lpadc3priv);
@@ -1085,6 +1130,7 @@ int cxd56_adcinitialize(void)
       return ret;
     }
 
+  nxsem_init(&g_lpadc3priv.exclsem, 0, 1);
 #endif
 #ifdef CONFIG_CXD56_HPADC0
   ret = register_driver("/dev/hpadc0", &g_adcops, 0666, &g_hpadc0priv);
@@ -1094,6 +1140,7 @@ int cxd56_adcinitialize(void)
       return ret;
     }
 
+  nxsem_init(&g_hpadc0priv.exclsem, 0, 1);
 #endif
 #ifdef CONFIG_CXD56_HPADC1
   ret = register_driver("/dev/hpadc1", &g_adcops, 0666, &g_hpadc1priv);
@@ -1103,6 +1150,7 @@ int cxd56_adcinitialize(void)
       return ret;
     }
 
+  nxsem_init(&g_hpadc1priv.exclsem, 0, 1);
 #endif
 
   return ret;

[incubator-nuttx] 01/21: arch: cxd56xx: Fix uart getting stuck during a clock change

Posted by je...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

jerpelea pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git

commit 9b3a80cc372a4942f19e6f328f141c3712eddb1c
Author: SPRESENSE <41...@users.noreply.github.com>
AuthorDate: Wed May 19 17:03:36 2021 +0900

    arch: cxd56xx: Fix uart getting stuck during a clock change
    
    UART driver is stopped and re-started during a clock change. When a UART
    interrupt is generated in each process, the unexpected behavior will
    occur and a console will get stuck with UART driver. This commit fixed
    each process is performed atomically.
---
 arch/arm/src/cxd56xx/cxd56_uart.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/arch/arm/src/cxd56xx/cxd56_uart.c b/arch/arm/src/cxd56xx/cxd56_uart.c
index b8b2f3c..3ddfac6 100644
--- a/arch/arm/src/cxd56xx/cxd56_uart.c
+++ b/arch/arm/src/cxd56xx/cxd56_uart.c
@@ -206,11 +206,15 @@ static void cxd56_uart_pincontrol(int ch, bool on)
 
 static void cxd56_uart_start(int ch)
 {
+  irqstate_t flags = enter_critical_section();
+
   cxd56_setbaud(CONSOLE_BASE, CONSOLE_BASEFREQ, CONSOLE_BAUD);
 
   putreg32(g_lcr, g_uartdevs[ch].uartbase + CXD56_UART_LCR_H);
 
   putreg32(g_cr, g_uartdevs[ch].uartbase + CXD56_UART_CR);
+
+  leave_critical_section(flags);
 }
 
 /****************************************************************************
@@ -226,6 +230,8 @@ static void cxd56_uart_stop(int ch)
 {
   uint32_t cr;
 
+  irqstate_t flags = enter_critical_section();
+
   while (UART_FR_BUSY & getreg32(g_uartdevs[ch].uartbase + CXD56_UART_FR));
 
   cr   = getreg32(g_uartdevs[ch].uartbase + CXD56_UART_CR);
@@ -235,6 +241,8 @@ static void cxd56_uart_stop(int ch)
 
   g_lcr = getreg32(g_uartdevs[ch].uartbase + CXD56_UART_LCR_H);
   putreg32(0, g_uartdevs[ch].uartbase + CXD56_UART_LCR_H);
+
+  leave_critical_section(flags);
 }
 
 /****************************************************************************

[incubator-nuttx] 19/21: arch: cxd56xx: Fix uninitialized variable for gnss driver

Posted by je...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

jerpelea pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git

commit 5a7a118320c8cdcdb78c116172d371f8fcec7112
Author: SPRESENSE <41...@users.noreply.github.com>
AuthorDate: Wed May 19 17:04:44 2021 +0900

    arch: cxd56xx: Fix uninitialized variable for gnss driver
    
    Fix uninitialized variable in gnss driver.
    CodeSonar Warning 518288 - 518292
---
 arch/arm/src/cxd56xx/cxd56_gnss.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/arch/arm/src/cxd56xx/cxd56_gnss.c b/arch/arm/src/cxd56xx/cxd56_gnss.c
index 13c739a..6a89365 100644
--- a/arch/arm/src/cxd56xx/cxd56_gnss.c
+++ b/arch/arm/src/cxd56xx/cxd56_gnss.c
@@ -519,7 +519,7 @@ static int cxd56_gnss_get_satellite_system(FAR struct file *filep,
                                            unsigned long    arg)
 {
   int ret;
-  uint32_t system;
+  uint32_t system = 0;
 
   if (!arg)
     {
@@ -701,7 +701,7 @@ static int cxd56_gnss_get_tcxo_offset(FAR struct file *filep,
                                       unsigned long    arg)
 {
   int     ret;
-  int32_t offset;
+  int32_t offset = 0;
 
   if (!arg)
     {
@@ -1741,7 +1741,7 @@ static int cxd56_gnss_get_rtk_interval(FAR struct file *filep,
                                        unsigned long    arg)
 {
   int ret;
-  int interval;
+  int interval = 0;
 
   if (!arg)
     {
@@ -1798,7 +1798,7 @@ static int cxd56_gnss_get_rtk_satellite(FAR struct file *filep,
                                         unsigned long    arg)
 {
   int       ret;
-  uint32_t  gnss;
+  uint32_t  gnss = 0;
 
   if (!arg)
     {
@@ -1855,7 +1855,7 @@ static int cxd56_gnss_get_rtk_ephemeris_enable(FAR struct file *filep,
                                                unsigned long    arg)
 {
   int ret;
-  int enable;
+  int enable = 0;
 
   if (!arg)
     {