You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2022/01/05 20:10:46 UTC
[GitHub] [incubator-nuttx] acassis commented on a change in pull request #5165: CEVA: add ceva platform xc5 xm6 support
acassis commented on a change in pull request #5165:
URL: https://github.com/apache/incubator-nuttx/pull/5165#discussion_r779104609
##########
File path: arch/ceva/include/xm6/irq.h
##########
@@ -0,0 +1,256 @@
+/****************************************************************************
+ * arch/ceva/include/xm6/irq.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.
+ *
+ ****************************************************************************/
+
+/* This file should never be included directed but, rather, only indirectly
+ * through nuttx/irq.h
+ */
+
+#ifndef __ARCH_CEVA_INCLUDE_XM6_IRQ_H
+#define __ARCH_CEVA_INCLUDE_XM6_IRQ_H
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#include <nuttx/config.h>
+
+#ifndef __ASSEMBLY__
+# include <stdint.h>
+#endif
+
+/* Included implementation-dependent register save structure layouts */
+
+#include <arch/xm6/reg.h>
+
+/****************************************************************************
+ * Pre-processor Definitions
+ ****************************************************************************/
+
+/* Configuration ************************************************************/
+
+/* If this is kernel build, how many nested system calls should we support? */
+
+#ifndef CONFIG_SYS_NNEST
+# define CONFIG_SYS_NNEST 2
+#endif
+
+/* Alternate register names *************************************************/
+
+#define REG_A0 REG_R0
+#define REG_A1 REG_R1
+#define REG_A2 REG_R2
+#define REG_A3 REG_R3
+#define REG_A4 REG_R4
+#define REG_A5 REG_R5
+#define REG_A6 REG_R6
+#define REG_FP REG_R8
+#define REG_LR REG_RETREG
+#define REG_PC REG_RETREGI
+#define REG_OM REG_MODC /* Operation Mode */
+
+/* MODA: IRQ enable/disable */
Review comment:
Please include a blank line after a comment line
##########
File path: arch/ceva/include/xm6/irq.h
##########
@@ -0,0 +1,256 @@
+/****************************************************************************
+ * arch/ceva/include/xm6/irq.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.
+ *
+ ****************************************************************************/
+
+/* This file should never be included directed but, rather, only indirectly
+ * through nuttx/irq.h
+ */
+
+#ifndef __ARCH_CEVA_INCLUDE_XM6_IRQ_H
+#define __ARCH_CEVA_INCLUDE_XM6_IRQ_H
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#include <nuttx/config.h>
+
+#ifndef __ASSEMBLY__
+# include <stdint.h>
+#endif
+
+/* Included implementation-dependent register save structure layouts */
+
+#include <arch/xm6/reg.h>
+
+/****************************************************************************
+ * Pre-processor Definitions
+ ****************************************************************************/
+
+/* Configuration ************************************************************/
+
+/* If this is kernel build, how many nested system calls should we support? */
+
+#ifndef CONFIG_SYS_NNEST
+# define CONFIG_SYS_NNEST 2
+#endif
+
+/* Alternate register names *************************************************/
+
+#define REG_A0 REG_R0
+#define REG_A1 REG_R1
+#define REG_A2 REG_R2
+#define REG_A3 REG_R3
+#define REG_A4 REG_R4
+#define REG_A5 REG_R5
+#define REG_A6 REG_R6
+#define REG_FP REG_R8
+#define REG_LR REG_RETREG
+#define REG_PC REG_RETREGI
+#define REG_OM REG_MODC /* Operation Mode */
+
+/* MODA: IRQ enable/disable */
+#define REG_MODA_DEFAULT 0x07f0
+
+#define REG_MODA_ENABLE 0x07f0
+#define REG_MODA_DISABLE 0x0010
+
+/* MODC: Operation mode */
Review comment:
Ditto
##########
File path: arch/ceva/src/common/up_assert.c
##########
@@ -0,0 +1,372 @@
+/****************************************************************************
+ * arch/ceva/src/common/up_assert.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 <assert.h>
+#include <debug.h>
+
+#include <nuttx/arch.h>
+#include <nuttx/syslog/syslog.h>
+#include <nuttx/usb/usbdev_trace.h>
+
+#include "sched/sched.h"
+#include "irq/irq.h"
+#include "up_internal.h"
+
+/****************************************************************************
+ * Pre-processor Definitions
+ ****************************************************************************/
+
+/* USB trace dumping */
+
+#ifndef CONFIG_USBDEV_TRACE
+# undef CONFIG_ARCH_USBDUMP
+#endif
+
+#ifndef CONFIG_BOARD_RESET_ON_ASSERT
+# define CONFIG_BOARD_RESET_ON_ASSERT 0
+#endif
+
+/****************************************************************************
+ * Private Data
+ ****************************************************************************/
+
+#ifdef CONFIG_ARCH_STACKDUMP
+static uint32_t s_last_regs[XCPTCONTEXT_REGS];
+#endif
+
+/****************************************************************************
+ * Private Functions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Name: up_stackdump
+ ****************************************************************************/
+
+#ifdef CONFIG_ARCH_STACKDUMP
+static void up_stackdump(uint32_t sp, uint32_t stack_base)
+{
+ uint32_t stack;
+
+ for (stack = sp; stack < stack_base; stack += 8 * sizeof(uint32_t))
+ {
+ uint32_t *ptr = (uint32_t *)stack;
+ _alert("%08x: %08x %08x %08x %08x %08x %08x %08x %08x\n",
+ stack, ptr[0], ptr[1], ptr[2], ptr[3],
+ ptr[4], ptr[5], ptr[6], ptr[7]);
+ }
+}
+#else
+# define up_stackdump(sp, stack_base)
+#endif
+
+/****************************************************************************
+ * Name: up_taskdump
+ ****************************************************************************/
+
+#ifdef CONFIG_STACK_COLORATION
+static void up_taskdump(FAR struct tcb_s *tcb, FAR void *arg)
+{
+ /* Dump interesting properties of this task */
+
+#if CONFIG_TASK_NAME_SIZE > 0
+ _alert("%s: PID=%d Stack Used=%lu of %lu\n",
+ tcb->name, tcb->pid, up_check_tcbstack(tcb),
+ tcb->adj_stack_size);
+#else
+ _alert("PID: %d Stack Used=%lu of %lu\n",
+ tcb->pid, up_check_tcbstack(tcb),
+ tcb->adj_stack_size);
+#endif
+}
+#endif
+
+/****************************************************************************
+ * Name: up_showtasks
+ ****************************************************************************/
+
+#ifdef CONFIG_STACK_COLORATION
+static inline void up_showtasks(void)
+{
+ /* Dump interesting properties of each task in the crash environment */
+
+ sched_foreach(up_taskdump, NULL);
+}
+#else
+# define up_showtasks()
+#endif
+
+/****************************************************************************
+ * Name: up_registerdump
+ ****************************************************************************/
+
+#ifdef CONFIG_ARCH_STACKDUMP
+static inline void up_registerdump(void)
+{
+ volatile uint32_t *regs = CURRENT_REGS;
+ int rx;
+
+ /* Are user registers available from interrupt processing? */
+
+ if (regs == NULL)
+ {
+ /* No.. capture user registers by hand */
+
+ up_saveusercontext(s_last_regs);
+ regs = s_last_regs;
+ }
+
+ /* Dump the interrupt registers */
+
+ for (rx = 0; rx < XCPTCONTEXT_REGS; rx += 8)
+ {
+ _alert("R%03d: %08x %08x %08x %08x %08x %08x %08x %08x\n",
+ rx, regs[rx], regs[rx + 1], regs[rx + 2], regs[rx + 3],
Review comment:
The variables line need to move a single character to the right to be aligned after the "("
##########
File path: arch/ceva/include/xm6/irq.h
##########
@@ -0,0 +1,256 @@
+/****************************************************************************
+ * arch/ceva/include/xm6/irq.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.
+ *
+ ****************************************************************************/
+
+/* This file should never be included directed but, rather, only indirectly
+ * through nuttx/irq.h
+ */
+
+#ifndef __ARCH_CEVA_INCLUDE_XM6_IRQ_H
+#define __ARCH_CEVA_INCLUDE_XM6_IRQ_H
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#include <nuttx/config.h>
+
+#ifndef __ASSEMBLY__
+# include <stdint.h>
+#endif
+
+/* Included implementation-dependent register save structure layouts */
+
+#include <arch/xm6/reg.h>
+
+/****************************************************************************
+ * Pre-processor Definitions
+ ****************************************************************************/
+
+/* Configuration ************************************************************/
+
+/* If this is kernel build, how many nested system calls should we support? */
+
+#ifndef CONFIG_SYS_NNEST
+# define CONFIG_SYS_NNEST 2
+#endif
+
+/* Alternate register names *************************************************/
+
+#define REG_A0 REG_R0
+#define REG_A1 REG_R1
+#define REG_A2 REG_R2
+#define REG_A3 REG_R3
+#define REG_A4 REG_R4
+#define REG_A5 REG_R5
+#define REG_A6 REG_R6
+#define REG_FP REG_R8
+#define REG_LR REG_RETREG
+#define REG_PC REG_RETREGI
+#define REG_OM REG_MODC /* Operation Mode */
+
+/* MODA: IRQ enable/disable */
+#define REG_MODA_DEFAULT 0x07f0
+
+#define REG_MODA_ENABLE 0x07f0
+#define REG_MODA_DISABLE 0x0010
+
+/* MODC: Operation mode */
+#define REG_OM_DEFAULT 0x20 /* PI and Supervisor */
+
+/* Note: this is POM field not OM field */
Review comment:
Ditto
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org