You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by "anjiahao1 (via GitHub)" <gi...@apache.org> on 2024/04/25 08:34:24 UTC

[PR] mps3-an547:support nuttx run qmeu(cortex-m55) [nuttx]

anjiahao1 opened a new pull request, #12233:
URL: https://github.com/apache/nuttx/pull/12233

   ## Summary
   support nuttx run qmeu
   ## Impact
   mps3-an547
   ## Testing
   
   ```
      Configuring NuttX and compile:
      $ ./tools/configure.sh -l mps-an547:nsh
      $ make
      Running with qemu
      $ qemu-system-arm -M mps3-an547 -nographic -kernel nuttx.bin
   
   ```
   
   run `ostest` pass


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


Re: [PR] mps3-an547:support nuttx run qemu(cortex-m55) [nuttx]

Posted by "acassis (via GitHub)" <gi...@apache.org>.
acassis merged PR #12233:
URL: https://github.com/apache/nuttx/pull/12233


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


Re: [PR] mps3-an547:support nuttx run qemu(cortex-m55) [nuttx]

Posted by "anjiahao1 (via GitHub)" <gi...@apache.org>.
anjiahao1 commented on code in PR #12233:
URL: https://github.com/apache/nuttx/pull/12233#discussion_r1581070541


##########
arch/arm/include/mps/irq.h:
##########
@@ -0,0 +1,69 @@
+/****************************************************************************
+ * arch/arm/include/mps/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 directly but, rather,
+ * only indirectly through nuttx/irq.h
+ */
+
+#ifndef __ARCH_ARM_INCLUDE_MPS_IRQ_H
+#define __ARCH_ARM_INCLUDE_MPS_IRQ_H
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+/****************************************************************************
+ * Pre-processor Prototypes
+ ****************************************************************************/
+
+#define NR_IRQS                 130  /* Total number of interrupts */

Review Comment:
   ![image](https://github.com/apache/nuttx/assets/75056955/dfeaf0fe-d49a-4cc4-a44e-bb3757bab869)
   [mps3-an547.pdf](https://developer.arm.com/-/media/Arm%20Developer%20Community/PDF/DAI0547B_SSE300_PLUS_U55_FPGA_for_mps3.pdf)
   
   page 38 Table 7-1



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


Re: [PR] mps3-an547:support nuttx run qmeu(cortex-m55) [nuttx]

Posted by "acassis (via GitHub)" <gi...@apache.org>.
acassis commented on code in PR #12233:
URL: https://github.com/apache/nuttx/pull/12233#discussion_r1579399827


##########
drivers/serial/Kconfig-cmsdk:
##########
@@ -0,0 +1,150 @@
+#
+# For a description of the syntax of this configuration file,
+# see the file kconfig-language.txt in the NuttX tools repository.
+#
+
+if CMSDK_UART
+
+config CMSDK_UART0
+	bool "CMSDK UART0"
+	default n
+
+if CMSDK_UART0
+
+config CMSDK_UART0_BASE
+	hex "CMSDK UART0 base address"
+
+config CMSDK_UART0_CLOCK
+	int "CMSDK UART0 clock"
+
+config CMSDK_UART0_TX_IRQ
+	int "CMSDK UART0 TX IRQ number"
+
+config CMSDK_UART0_RX_IRQ
+	int "CMSDK UART0 RX IRQ number"
+
+config CMSDK_UART0_OV_IRQ
+	int "CMSDK UART0 OVERRUN IRQ number"
+
+config CMSDK_UART0_BAUD
+	int "CMSDK UART0 BAUD"
+	default 115200
+
+config CMSDK_UART0_RXBUFSIZE
+	int "CMSDK UART0 Rx buffer size"
+	default 256
+	---help---
+		CMSDK UART0 Rx buffer size.  Default: 256
+
+config CMSDK_UART0_TXBUFSIZE
+	int "CMSDK UART0 Tx buffer size"
+	default 256
+	---help---
+		CMSDK UART0 Tx buffer size.  Default: 256
+
+endif # CMSDK_UART0
+
+config CMSDK_UART1
+	bool "CMSDK UART1"
+	default n
+
+if CMSDK_UART1
+
+config CMSDK_UART1_BASE
+	hex "CMSDK UART1 base address"
+
+config CMSDK_UART1_CLOCK
+	int "CMSDK UART1 clock"
+
+config CMSDK_UART1_TX_IRQ
+	int "CMSDK UART1 TX IRQ number"
+
+config CMSDK_UART1_RX_IRQ
+	int "CMSDK UART1 RX IRQ number"
+
+config CMSDK_UART1_OV_IRQ
+	int "CMSDK UART1 OVERRUN IRQ number"
+
+config CMSDK_UART1_BAUD
+	int "CMSDK UART1 BAUD"
+	default 115200
+
+config CMSDK_UART1_RXBUFSIZE
+	int "CMSDK UART1 Rx buffer size"

Review Comment:
   ```suggestion
   	int "CMSDK UART1 RX buffer size"



##########
drivers/serial/Kconfig-cmsdk:
##########
@@ -0,0 +1,150 @@
+#
+# For a description of the syntax of this configuration file,
+# see the file kconfig-language.txt in the NuttX tools repository.
+#
+
+if CMSDK_UART
+
+config CMSDK_UART0
+	bool "CMSDK UART0"
+	default n
+
+if CMSDK_UART0
+
+config CMSDK_UART0_BASE
+	hex "CMSDK UART0 base address"
+
+config CMSDK_UART0_CLOCK
+	int "CMSDK UART0 clock"
+
+config CMSDK_UART0_TX_IRQ
+	int "CMSDK UART0 TX IRQ number"
+
+config CMSDK_UART0_RX_IRQ
+	int "CMSDK UART0 RX IRQ number"
+
+config CMSDK_UART0_OV_IRQ
+	int "CMSDK UART0 OVERRUN IRQ number"
+
+config CMSDK_UART0_BAUD
+	int "CMSDK UART0 BAUD"
+	default 115200
+
+config CMSDK_UART0_RXBUFSIZE
+	int "CMSDK UART0 Rx buffer size"
+	default 256
+	---help---
+		CMSDK UART0 Rx buffer size.  Default: 256
+
+config CMSDK_UART0_TXBUFSIZE
+	int "CMSDK UART0 Tx buffer size"
+	default 256
+	---help---
+		CMSDK UART0 Tx buffer size.  Default: 256
+
+endif # CMSDK_UART0
+
+config CMSDK_UART1
+	bool "CMSDK UART1"
+	default n
+
+if CMSDK_UART1
+
+config CMSDK_UART1_BASE
+	hex "CMSDK UART1 base address"
+
+config CMSDK_UART1_CLOCK
+	int "CMSDK UART1 clock"
+
+config CMSDK_UART1_TX_IRQ
+	int "CMSDK UART1 TX IRQ number"
+
+config CMSDK_UART1_RX_IRQ
+	int "CMSDK UART1 RX IRQ number"
+
+config CMSDK_UART1_OV_IRQ
+	int "CMSDK UART1 OVERRUN IRQ number"
+
+config CMSDK_UART1_BAUD
+	int "CMSDK UART1 BAUD"
+	default 115200
+
+config CMSDK_UART1_RXBUFSIZE
+	int "CMSDK UART1 Rx buffer size"
+	default 256
+	---help---
+		CMSDK UART1 Rx buffer size.  Default: 256
+
+config CMSDK_UART1_TXBUFSIZE
+	int "CMSDK UART1 Tx buffer size"
+	default 256
+	---help---
+		CMSDK UART1 Tx buffer size.  Default: 256
+
+endif # CMSDK_UART1
+
+config CMSDK_UART2
+	bool "CMSDK UART2"
+	default n
+
+if CMSDK_UART2
+
+config CMSDK_UART2_BASE
+	hex "CMSDK UART2 base address"
+
+config CMSDK_UART2_CLOCK
+	hex "CMSDK UART2 clock"
+
+config CMSDK_UART2_TX_IRQ
+	int "CMSDK UART2 TX IRQ number"
+
+config CMSDK_UART2_RX_IRQ
+	int "CMSDK UART2 RX IRQ number"
+
+config CMSDK_UART2_OV_IRQ
+	int "CMSDK UART2 OVERRUN IRQ number"
+
+config CMSDK_UART2_BAUD
+	int "CMSDK UART2 BAUD"
+	default 115200
+
+config CMSDK_UART2_RXBUFSIZE
+	int "CMSDK UART2 Rx buffer size"
+	default 256
+	---help---
+		CMSDK UART2 Rx buffer size.  Default: 256

Review Comment:
   ```suggestion
   		CMSDK UART2 RX buffer size.  Default: 256



##########
drivers/serial/Kconfig-cmsdk:
##########
@@ -0,0 +1,150 @@
+#
+# For a description of the syntax of this configuration file,
+# see the file kconfig-language.txt in the NuttX tools repository.
+#
+
+if CMSDK_UART
+
+config CMSDK_UART0
+	bool "CMSDK UART0"
+	default n
+
+if CMSDK_UART0
+
+config CMSDK_UART0_BASE
+	hex "CMSDK UART0 base address"
+
+config CMSDK_UART0_CLOCK
+	int "CMSDK UART0 clock"
+
+config CMSDK_UART0_TX_IRQ
+	int "CMSDK UART0 TX IRQ number"
+
+config CMSDK_UART0_RX_IRQ
+	int "CMSDK UART0 RX IRQ number"
+
+config CMSDK_UART0_OV_IRQ
+	int "CMSDK UART0 OVERRUN IRQ number"
+
+config CMSDK_UART0_BAUD
+	int "CMSDK UART0 BAUD"
+	default 115200
+
+config CMSDK_UART0_RXBUFSIZE
+	int "CMSDK UART0 Rx buffer size"
+	default 256
+	---help---
+		CMSDK UART0 Rx buffer size.  Default: 256
+
+config CMSDK_UART0_TXBUFSIZE
+	int "CMSDK UART0 Tx buffer size"
+	default 256
+	---help---
+		CMSDK UART0 Tx buffer size.  Default: 256
+
+endif # CMSDK_UART0
+
+config CMSDK_UART1
+	bool "CMSDK UART1"
+	default n
+
+if CMSDK_UART1
+
+config CMSDK_UART1_BASE
+	hex "CMSDK UART1 base address"
+
+config CMSDK_UART1_CLOCK
+	int "CMSDK UART1 clock"
+
+config CMSDK_UART1_TX_IRQ
+	int "CMSDK UART1 TX IRQ number"
+
+config CMSDK_UART1_RX_IRQ
+	int "CMSDK UART1 RX IRQ number"
+
+config CMSDK_UART1_OV_IRQ
+	int "CMSDK UART1 OVERRUN IRQ number"
+
+config CMSDK_UART1_BAUD
+	int "CMSDK UART1 BAUD"
+	default 115200
+
+config CMSDK_UART1_RXBUFSIZE
+	int "CMSDK UART1 Rx buffer size"
+	default 256
+	---help---
+		CMSDK UART1 Rx buffer size.  Default: 256
+
+config CMSDK_UART1_TXBUFSIZE
+	int "CMSDK UART1 Tx buffer size"

Review Comment:
   ```suggestion
   	int "CMSDK UART1 TX buffer size"



##########
drivers/serial/Kconfig-cmsdk:
##########
@@ -0,0 +1,150 @@
+#
+# For a description of the syntax of this configuration file,
+# see the file kconfig-language.txt in the NuttX tools repository.
+#
+
+if CMSDK_UART
+
+config CMSDK_UART0
+	bool "CMSDK UART0"
+	default n
+
+if CMSDK_UART0
+
+config CMSDK_UART0_BASE
+	hex "CMSDK UART0 base address"
+
+config CMSDK_UART0_CLOCK
+	int "CMSDK UART0 clock"
+
+config CMSDK_UART0_TX_IRQ
+	int "CMSDK UART0 TX IRQ number"
+
+config CMSDK_UART0_RX_IRQ
+	int "CMSDK UART0 RX IRQ number"
+
+config CMSDK_UART0_OV_IRQ
+	int "CMSDK UART0 OVERRUN IRQ number"
+
+config CMSDK_UART0_BAUD
+	int "CMSDK UART0 BAUD"
+	default 115200
+
+config CMSDK_UART0_RXBUFSIZE
+	int "CMSDK UART0 Rx buffer size"
+	default 256
+	---help---
+		CMSDK UART0 Rx buffer size.  Default: 256
+
+config CMSDK_UART0_TXBUFSIZE
+	int "CMSDK UART0 Tx buffer size"
+	default 256
+	---help---
+		CMSDK UART0 Tx buffer size.  Default: 256
+
+endif # CMSDK_UART0
+
+config CMSDK_UART1
+	bool "CMSDK UART1"
+	default n
+
+if CMSDK_UART1
+
+config CMSDK_UART1_BASE
+	hex "CMSDK UART1 base address"
+
+config CMSDK_UART1_CLOCK
+	int "CMSDK UART1 clock"
+
+config CMSDK_UART1_TX_IRQ
+	int "CMSDK UART1 TX IRQ number"
+
+config CMSDK_UART1_RX_IRQ
+	int "CMSDK UART1 RX IRQ number"
+
+config CMSDK_UART1_OV_IRQ
+	int "CMSDK UART1 OVERRUN IRQ number"
+
+config CMSDK_UART1_BAUD
+	int "CMSDK UART1 BAUD"
+	default 115200
+
+config CMSDK_UART1_RXBUFSIZE
+	int "CMSDK UART1 Rx buffer size"
+	default 256
+	---help---
+		CMSDK UART1 Rx buffer size.  Default: 256
+
+config CMSDK_UART1_TXBUFSIZE
+	int "CMSDK UART1 Tx buffer size"
+	default 256
+	---help---
+		CMSDK UART1 Tx buffer size.  Default: 256
+
+endif # CMSDK_UART1
+
+config CMSDK_UART2
+	bool "CMSDK UART2"
+	default n
+
+if CMSDK_UART2
+
+config CMSDK_UART2_BASE
+	hex "CMSDK UART2 base address"
+
+config CMSDK_UART2_CLOCK
+	hex "CMSDK UART2 clock"
+
+config CMSDK_UART2_TX_IRQ
+	int "CMSDK UART2 TX IRQ number"
+
+config CMSDK_UART2_RX_IRQ
+	int "CMSDK UART2 RX IRQ number"
+
+config CMSDK_UART2_OV_IRQ
+	int "CMSDK UART2 OVERRUN IRQ number"
+
+config CMSDK_UART2_BAUD
+	int "CMSDK UART2 BAUD"
+	default 115200
+
+config CMSDK_UART2_RXBUFSIZE
+	int "CMSDK UART2 Rx buffer size"

Review Comment:
   ```suggestion
   	int "CMSDK UART2 RX buffer size"



##########
drivers/serial/Kconfig-cmsdk:
##########
@@ -0,0 +1,150 @@
+#
+# For a description of the syntax of this configuration file,
+# see the file kconfig-language.txt in the NuttX tools repository.
+#
+
+if CMSDK_UART
+
+config CMSDK_UART0
+	bool "CMSDK UART0"
+	default n
+
+if CMSDK_UART0
+
+config CMSDK_UART0_BASE
+	hex "CMSDK UART0 base address"
+
+config CMSDK_UART0_CLOCK
+	int "CMSDK UART0 clock"
+
+config CMSDK_UART0_TX_IRQ
+	int "CMSDK UART0 TX IRQ number"
+
+config CMSDK_UART0_RX_IRQ
+	int "CMSDK UART0 RX IRQ number"
+
+config CMSDK_UART0_OV_IRQ
+	int "CMSDK UART0 OVERRUN IRQ number"
+
+config CMSDK_UART0_BAUD
+	int "CMSDK UART0 BAUD"
+	default 115200
+
+config CMSDK_UART0_RXBUFSIZE
+	int "CMSDK UART0 Rx buffer size"
+	default 256
+	---help---
+		CMSDK UART0 Rx buffer size.  Default: 256
+
+config CMSDK_UART0_TXBUFSIZE
+	int "CMSDK UART0 Tx buffer size"
+	default 256
+	---help---
+		CMSDK UART0 Tx buffer size.  Default: 256
+
+endif # CMSDK_UART0
+
+config CMSDK_UART1
+	bool "CMSDK UART1"
+	default n
+
+if CMSDK_UART1
+
+config CMSDK_UART1_BASE
+	hex "CMSDK UART1 base address"
+
+config CMSDK_UART1_CLOCK
+	int "CMSDK UART1 clock"
+
+config CMSDK_UART1_TX_IRQ
+	int "CMSDK UART1 TX IRQ number"
+
+config CMSDK_UART1_RX_IRQ
+	int "CMSDK UART1 RX IRQ number"
+
+config CMSDK_UART1_OV_IRQ
+	int "CMSDK UART1 OVERRUN IRQ number"
+
+config CMSDK_UART1_BAUD
+	int "CMSDK UART1 BAUD"
+	default 115200
+
+config CMSDK_UART1_RXBUFSIZE
+	int "CMSDK UART1 Rx buffer size"
+	default 256
+	---help---
+		CMSDK UART1 Rx buffer size.  Default: 256
+
+config CMSDK_UART1_TXBUFSIZE
+	int "CMSDK UART1 Tx buffer size"
+	default 256
+	---help---
+		CMSDK UART1 Tx buffer size.  Default: 256
+
+endif # CMSDK_UART1
+
+config CMSDK_UART2
+	bool "CMSDK UART2"
+	default n
+
+if CMSDK_UART2
+
+config CMSDK_UART2_BASE
+	hex "CMSDK UART2 base address"
+
+config CMSDK_UART2_CLOCK
+	hex "CMSDK UART2 clock"
+
+config CMSDK_UART2_TX_IRQ
+	int "CMSDK UART2 TX IRQ number"
+
+config CMSDK_UART2_RX_IRQ
+	int "CMSDK UART2 RX IRQ number"
+
+config CMSDK_UART2_OV_IRQ
+	int "CMSDK UART2 OVERRUN IRQ number"
+
+config CMSDK_UART2_BAUD
+	int "CMSDK UART2 BAUD"
+	default 115200
+
+config CMSDK_UART2_RXBUFSIZE
+	int "CMSDK UART2 Rx buffer size"
+	default 256
+	---help---
+		CMSDK UART2 Rx buffer size.  Default: 256
+
+config CMSDK_UART2_TXBUFSIZE
+	int "CMSDK UART2 Tx buffer size"
+	default 256
+	---help---
+		CMSDK UART2 Tx buffer size.  Default: 256

Review Comment:
   ```suggestion
   		CMSDK UART2 TX buffer size.  Default: 256



##########
drivers/serial/Kconfig-cmsdk:
##########
@@ -0,0 +1,150 @@
+#
+# For a description of the syntax of this configuration file,
+# see the file kconfig-language.txt in the NuttX tools repository.
+#
+
+if CMSDK_UART
+
+config CMSDK_UART0
+	bool "CMSDK UART0"
+	default n
+
+if CMSDK_UART0
+
+config CMSDK_UART0_BASE
+	hex "CMSDK UART0 base address"
+
+config CMSDK_UART0_CLOCK
+	int "CMSDK UART0 clock"
+
+config CMSDK_UART0_TX_IRQ
+	int "CMSDK UART0 TX IRQ number"
+
+config CMSDK_UART0_RX_IRQ
+	int "CMSDK UART0 RX IRQ number"
+
+config CMSDK_UART0_OV_IRQ
+	int "CMSDK UART0 OVERRUN IRQ number"
+
+config CMSDK_UART0_BAUD
+	int "CMSDK UART0 BAUD"
+	default 115200
+
+config CMSDK_UART0_RXBUFSIZE
+	int "CMSDK UART0 Rx buffer size"
+	default 256
+	---help---
+		CMSDK UART0 Rx buffer size.  Default: 256
+
+config CMSDK_UART0_TXBUFSIZE
+	int "CMSDK UART0 Tx buffer size"
+	default 256
+	---help---
+		CMSDK UART0 Tx buffer size.  Default: 256
+
+endif # CMSDK_UART0
+
+config CMSDK_UART1
+	bool "CMSDK UART1"
+	default n
+
+if CMSDK_UART1
+
+config CMSDK_UART1_BASE
+	hex "CMSDK UART1 base address"
+
+config CMSDK_UART1_CLOCK
+	int "CMSDK UART1 clock"
+
+config CMSDK_UART1_TX_IRQ
+	int "CMSDK UART1 TX IRQ number"
+
+config CMSDK_UART1_RX_IRQ
+	int "CMSDK UART1 RX IRQ number"
+
+config CMSDK_UART1_OV_IRQ
+	int "CMSDK UART1 OVERRUN IRQ number"
+
+config CMSDK_UART1_BAUD
+	int "CMSDK UART1 BAUD"
+	default 115200
+
+config CMSDK_UART1_RXBUFSIZE
+	int "CMSDK UART1 Rx buffer size"
+	default 256
+	---help---
+		CMSDK UART1 Rx buffer size.  Default: 256

Review Comment:
   ```suggestion
   		CMSDK UART1 RX buffer size.  Default: 256



##########
drivers/serial/Kconfig-cmsdk:
##########
@@ -0,0 +1,150 @@
+#
+# For a description of the syntax of this configuration file,
+# see the file kconfig-language.txt in the NuttX tools repository.
+#
+
+if CMSDK_UART
+
+config CMSDK_UART0
+	bool "CMSDK UART0"
+	default n
+
+if CMSDK_UART0
+
+config CMSDK_UART0_BASE
+	hex "CMSDK UART0 base address"
+
+config CMSDK_UART0_CLOCK
+	int "CMSDK UART0 clock"
+
+config CMSDK_UART0_TX_IRQ
+	int "CMSDK UART0 TX IRQ number"
+
+config CMSDK_UART0_RX_IRQ
+	int "CMSDK UART0 RX IRQ number"
+
+config CMSDK_UART0_OV_IRQ
+	int "CMSDK UART0 OVERRUN IRQ number"
+
+config CMSDK_UART0_BAUD
+	int "CMSDK UART0 BAUD"
+	default 115200
+
+config CMSDK_UART0_RXBUFSIZE
+	int "CMSDK UART0 Rx buffer size"
+	default 256
+	---help---
+		CMSDK UART0 Rx buffer size.  Default: 256
+
+config CMSDK_UART0_TXBUFSIZE
+	int "CMSDK UART0 Tx buffer size"
+	default 256
+	---help---
+		CMSDK UART0 Tx buffer size.  Default: 256
+
+endif # CMSDK_UART0
+
+config CMSDK_UART1
+	bool "CMSDK UART1"
+	default n
+
+if CMSDK_UART1
+
+config CMSDK_UART1_BASE
+	hex "CMSDK UART1 base address"
+
+config CMSDK_UART1_CLOCK
+	int "CMSDK UART1 clock"
+
+config CMSDK_UART1_TX_IRQ
+	int "CMSDK UART1 TX IRQ number"
+
+config CMSDK_UART1_RX_IRQ
+	int "CMSDK UART1 RX IRQ number"
+
+config CMSDK_UART1_OV_IRQ
+	int "CMSDK UART1 OVERRUN IRQ number"
+
+config CMSDK_UART1_BAUD
+	int "CMSDK UART1 BAUD"
+	default 115200
+
+config CMSDK_UART1_RXBUFSIZE
+	int "CMSDK UART1 Rx buffer size"
+	default 256
+	---help---
+		CMSDK UART1 Rx buffer size.  Default: 256
+
+config CMSDK_UART1_TXBUFSIZE
+	int "CMSDK UART1 Tx buffer size"
+	default 256
+	---help---
+		CMSDK UART1 Tx buffer size.  Default: 256
+
+endif # CMSDK_UART1
+
+config CMSDK_UART2
+	bool "CMSDK UART2"
+	default n
+
+if CMSDK_UART2
+
+config CMSDK_UART2_BASE
+	hex "CMSDK UART2 base address"
+
+config CMSDK_UART2_CLOCK
+	hex "CMSDK UART2 clock"
+
+config CMSDK_UART2_TX_IRQ
+	int "CMSDK UART2 TX IRQ number"
+
+config CMSDK_UART2_RX_IRQ
+	int "CMSDK UART2 RX IRQ number"
+
+config CMSDK_UART2_OV_IRQ
+	int "CMSDK UART2 OVERRUN IRQ number"
+
+config CMSDK_UART2_BAUD
+	int "CMSDK UART2 BAUD"
+	default 115200
+
+config CMSDK_UART2_RXBUFSIZE
+	int "CMSDK UART2 Rx buffer size"
+	default 256
+	---help---
+		CMSDK UART2 Rx buffer size.  Default: 256
+
+config CMSDK_UART2_TXBUFSIZE
+	int "CMSDK UART2 Tx buffer size"

Review Comment:
   ```suggestion
   	int "CMSDK UART2 TX buffer size"



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


Re: [PR] mps3-an547:support nuttx run qmeu(cortex-m55) [nuttx]

Posted by "anchao (via GitHub)" <gi...@apache.org>.
anchao commented on code in PR #12233:
URL: https://github.com/apache/nuttx/pull/12233#discussion_r1579337030


##########
boards/arm/mps/mps3-an547/include/board.h:
##########
@@ -0,0 +1,61 @@
+/****************************************************************************
+ * boards/arm/mps/mps3-an547/include/board.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 __BOARDS_ARM_MSP_MSP3_AN547_INCLUDE_BOARD_H

Review Comment:
   ```suggestion
   #ifndef __BOARDS_ARM_MPS_MPS3_AN547_INCLUDE_BOARD_H
   ```



##########
arch/arm/include/mps/irq.h:
##########
@@ -0,0 +1,69 @@
+/****************************************************************************
+ * arch/arm/include/mps/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 directly but, rather,
+ * only indirectly through nuttx/irq.h
+ */
+
+#ifndef __ARCH_ARM_INCLUDE_MPS_IRQ_H
+#define __ARCH_ARM_INCLUDE_MPS_IRQ_H
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+/****************************************************************************
+ * Pre-processor Prototypes
+ ****************************************************************************/
+
+#define NR_IRQS                 130  /* Total number of interrupts */

Review Comment:
   why 130



##########
drivers/serial/serial_cmsdk.c:
##########
@@ -0,0 +1,796 @@
+/****************************************************************************
+ * drivers/serial/serial_cmsdk.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 <sys/types.h>
+#include <stdint.h>
+#include <stdbool.h>
+#include <unistd.h>
+#include <semaphore.h>
+#include <string.h>
+#include <errno.h>
+#include <debug.h>
+#include <stdio.h>
+
+#include <nuttx/irq.h>
+#include <nuttx/arch.h>
+#include <nuttx/serial/serial.h>
+#include <nuttx/fs/ioctl.h>
+#include <nuttx/serial/uart_cmsdk.h>
+
+#include <arch/board/board.h>
+
+/****************************************************************************
+ * Pre-processor definitions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Private Types
+ ****************************************************************************/
+
+struct uart_cmsdk_s
+{
+  uint32_t uartbase;  /* Base address of UART registers */
+  uint32_t baud;      /* Configured baud */
+  uint32_t uartclk;   /* UART clock frequency */
+  uint8_t  tx_irq;
+  uint8_t  rx_irq;
+  uint8_t  ov_irq;
+};
+
+/****************************************************************************
+ * Private Function Prototypes
+ ****************************************************************************/
+
+static int  uart_cmsdk_setup(FAR struct uart_dev_s *dev);
+static void uart_cmsdk_shutdown(FAR struct uart_dev_s *dev);
+static int  uart_cmsdk_attach(FAR struct uart_dev_s *dev);
+static void uart_cmsdk_detach(FAR struct uart_dev_s *dev);
+static int  uart_cmsdk_rx_interrupt(int irq, FAR void *context,
+                                    FAR void *arg);
+static int  uart_cmsdk_ov_interrupt(int irq, FAR void *context,
+                                    FAR void *arg);
+static int  uart_cmsdk_tx_interrupt(int irq, FAR void *context,
+                                    FAR void *arg);
+static int  uart_cmsdk_ioctl(FAR struct file *filep, int cmd,
+                             unsigned long arg);
+static int  uart_cmsdk_receive(FAR struct uart_dev_s *dev,
+                               FAR unsigned int *status);
+static void uart_cmsdk_rxint(FAR struct uart_dev_s *dev, bool enable);
+static bool uart_cmsdk_rxavailable(FAR struct uart_dev_s *dev);
+static void uart_cmsdk_send(FAR struct uart_dev_s *dev, int ch);
+static void uart_cmsdk_txint(FAR struct uart_dev_s *dev, bool enable);
+static bool uart_cmsdk_txready(FAR struct uart_dev_s *dev);
+static bool uart_cmsdk_txempty(FAR struct uart_dev_s *dev);
+
+/****************************************************************************
+ * Private Data
+ ****************************************************************************/
+
+static const struct uart_ops_s g_uart_ops =
+{
+  .setup       = uart_cmsdk_setup,
+  .shutdown    = uart_cmsdk_shutdown,
+  .attach      = uart_cmsdk_attach,
+  .detach      = uart_cmsdk_detach,
+  .ioctl       = uart_cmsdk_ioctl,
+  .receive     = uart_cmsdk_receive,
+  .rxint       = uart_cmsdk_rxint,
+  .rxavailable = uart_cmsdk_rxavailable,
+  .send        = uart_cmsdk_send,
+  .txint       = uart_cmsdk_txint,
+  .txready     = uart_cmsdk_txready,
+  .txempty     = uart_cmsdk_txempty,
+};
+
+/* I/O buffers */
+
+#ifdef CONFIG_CMSDK_UART0
+static char g_uart0rxbuffer[CONFIG_CMSDK_UART0_RXBUFSIZE];
+static char g_uart0txbuffer[CONFIG_CMSDK_UART0_TXBUFSIZE];
+#endif
+#ifdef CONFIG_CMSDK_UART1
+static char g_uart1rxbuffer[CONFIG_CMSDK_UART1_RXBUFSIZE];
+static char g_uart1txbuffer[CONFIG_CMSDK_UART1_TXBUFSIZE];
+#endif
+#ifdef CONFIG_CMSDK_UART2
+static char g_uart2rxbuffer[CONFIG_CMSDK_UART2_RXBUFSIZE];
+static char g_uart2txbuffer[CONFIG_CMSDK_UART2_TXBUFSIZE];
+#endif
+
+/* This describes the state of the CMSDK uart0 port. */
+
+#ifdef CONFIG_CMSDK_UART0
+static struct uart_cmsdk_s g_uart0priv =
+{
+  .uartbase = CONFIG_CMSDK_UART0_BASE,
+  .baud     = CONFIG_CMSDK_UART0_BAUD,
+  .uartclk  = CONFIG_CMSDK_UART0_CLOCK,
+  .tx_irq   = CONFIG_CMSDK_UART0_TX_IRQ,
+  .rx_irq   = CONFIG_CMSDK_UART0_RX_IRQ,
+  .ov_irq   = CONFIG_CMSDK_UART0_OV_IRQ,
+};
+
+static uart_dev_t g_uart0port =
+{
+  .recv     =
+  {
+    .size   = CONFIG_CMSDK_UART0_RXBUFSIZE,
+    .buffer = g_uart0rxbuffer,
+  },
+  .xmit     =
+  {
+    .size   = CONFIG_CMSDK_UART0_TXBUFSIZE,
+    .buffer = g_uart0txbuffer,
+  },
+  .ops      = &g_uart_ops,
+  .priv     = &g_uart0priv,
+};
+#endif
+
+/* This describes the state of the CMSDK uart1 port. */
+
+#ifdef CONFIG_CMSDK_UART1
+static struct uart_cmsdk_s g_uart1priv =
+{
+  .uartbase = CONFIG_CMSDK_UART1_BASE,
+  .baud     = CONFIG_CMSDK_UART1_BAUD,
+  .uartclk  = CONFIG_CMSDK_UART1_CLOCK,
+  .tx_irq   = CONFIG_CMSDK_UART1_TX_IRQ,
+  .rx_irq   = CONFIG_CMSDK_UART1_RX_IRQ,
+  .ov_irq   = CONFIG_CMSDK_UART1_OV_IRQ,
+};
+
+static uart_dev_t g_uart1port =
+{
+  .recv     =
+  {
+    .size   = CONFIG_CMSDK_UART1_RXBUFSIZE,
+    .buffer = g_uart1rxbuffer,
+  },
+  .xmit     =
+  {
+    .size   = CONFIG_CMSDK_UART1_TXBUFSIZE,
+    .buffer = g_uart1txbuffer,
+  },
+  .ops      = &g_uart_ops,
+  .priv     = &g_uart1priv,
+};
+#endif
+
+#ifdef CONFIG_CMSDK_UART2
+static struct uart_cmsdk_s g_uart2priv =
+{
+  .uartbase = CONFIG_CMSDK_UART2_BASE,
+  .baud     = CONFIG_CMSDK_UART2_BAUD,
+  .uartclk  = CONFIG_CMSDK_UART2_CLOCK,
+  .tx_irq   = CONFIG_CMSDK_UART2_TX_IRQ,
+  .rx_irq   = CONFIG_CMSDK_UART2_RX_IRQ,
+  .ov_irq   = CONFIG_CMSDK_UART2_OV_IRQ,
+};
+
+static uart_dev_t g_uart2port =
+{
+  .recv     =
+  {
+    .size   = CONFIG_CMSDK_UART2_RXBUFSIZE,
+    .buffer = g_uart2rxbuffer,
+  },
+  .xmit     =
+  {
+    .size   = CONFIG_CMSDK_UART2_TXBUFSIZE,
+    .buffer = g_uart2txbuffer,
+  },
+  .ops      = &g_uart_ops,
+  .priv     = &g_uart2priv,
+};
+#endif
+
+/* Which UART with be console */
+
+#if defined(CONFIG_CMSDK_UART0_SERIAL_CONSOLE)
+#  define CONSOLE_DEV     g_uart0port    /* UART0=console */
+#elif defined(CONFIG_CMSDK_UART1_SERIAL_CONSOLE)
+#  define CONSOLE_DEV     g_uart1port    /* UART1=console */
+#elif defined(CONFIG_CMSDK_UART2_SERIAL_CONSOLE)
+#  define CONSOLE_DEV     g_uart2port    /* UART2=console */
+#endif
+
+#ifdef CONFIG_CMSDK_UART0
+#  define TTYS0_DEV       g_uart0port
+#endif
+
+#ifdef CONFIG_CMSDK_UART1
+#  define TTYS1_DEV       g_uart1port
+#endif
+
+#ifdef CONFIG_CMSDK_UART2
+#  define TTYS2_DEV       g_uart2port
+#endif
+
+/****************************************************************************
+ * Private Functions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Name: uart_cmsdk_serialin
+ ****************************************************************************/
+
+static inline uint32_t uart_cmsdk_serialin(FAR struct uart_cmsdk_s *priv,
+                                           uint32_t offset)
+{
+  return *((FAR volatile uint32_t *)priv->uartbase + offset);
+}
+
+/****************************************************************************
+ * Name: uart_cmsdk_serialout
+ ****************************************************************************/
+
+static inline void uart_cmsdk_serialout(FAR struct uart_cmsdk_s *priv,
+                                        uint32_t offset, uint32_t value)
+{
+  *((FAR volatile uint32_t *)priv->uartbase + offset) = value;
+}
+
+/****************************************************************************
+ * Name: uart_cmsdk_serialmodify
+ ****************************************************************************/
+
+static uint32_t uart_cmsdk_serialmodify(FAR struct uart_cmsdk_s *priv,
+                                        uint32_t offset, uint32_t clearbits,
+                                        uint32_t setbits)
+{
+  uint32_t oldval;
+  uint32_t newval;
+
+  oldval = uart_cmsdk_serialin(priv, offset);
+  newval = (oldval & ~clearbits) | setbits;
+  uart_cmsdk_serialout(priv, offset, newval);
+
+  return oldval;
+}
+
+/****************************************************************************
+ * Name: uart_cmsdk_disableuartint
+ ****************************************************************************/
+
+static inline uint32_t
+uart_cmsdk_disableuartint(FAR struct uart_cmsdk_s *priv)
+{
+  return uart_cmsdk_serialmodify(priv, UART_CTRL_OFFSET, UART_CTRL_ALLIE, 0);
+}
+
+/****************************************************************************
+ * Name: uart_cmsdk_restoreuartint
+ ****************************************************************************/
+
+static inline void uart_cmsdk_restoreuartint(FAR struct uart_cmsdk_s *priv,
+                                             uint32_t ier)
+{
+  uart_cmsdk_serialmodify(priv, UART_CTRL_OFFSET, 0, ier & UART_CTRL_ALLIE);
+}
+
+/****************************************************************************
+ * Name: uart_cmsdk_divisor
+ *
+ * Description:
+ *   Select a divider to produce the BAUD from the UART_CLK.
+ *
+ *     DIV  = UART_CLK / BAUD
+ *
+ *   Between UART_BAUDDIV_MIN and UART_BAUDDIV_MAX.
+ *
+ ****************************************************************************/
+
+static inline uint32_t uart_cmsdk_divisor(FAR struct uart_cmsdk_s *priv)
+{
+  return priv->uartclk / priv->baud;
+}
+
+/****************************************************************************
+ * Name: uart_cmsdk_setup
+ *
+ * Description:
+ *   Configure the UART baud, bits, parity, fifos, etc. This
+ *   method is called the first time that the serial port is
+ *   opened.
+ *
+ ****************************************************************************/
+
+static int uart_cmsdk_setup(FAR struct uart_dev_s *dev)
+{
+  FAR struct uart_cmsdk_s *priv = (FAR struct uart_cmsdk_s *)dev->priv;
+  uint32_t bauddiv;
+
+  /* Set the BAUD divisor */
+
+  bauddiv = uart_cmsdk_divisor(priv);
+  uart_cmsdk_serialout(priv, UART_BAUDDIV_OFFSET, bauddiv);
+
+  /* Enable TX and RX logic */
+
+  uart_cmsdk_serialmodify(priv, UART_CTRL_OFFSET,
+                 0, UART_CTRL_TX_ENABLE | UART_CTRL_RX_ENABLE);
+
+  return OK;
+}
+
+/****************************************************************************
+ * Name: uart_cmsdk_shutdown
+ *
+ * Description:
+ *   Disable the UART.  This method is called when the serial
+ *   port is closed
+ *
+ ****************************************************************************/
+
+static void uart_cmsdk_shutdown(struct uart_dev_s *dev)
+{
+  FAR struct uart_cmsdk_s *priv = (FAR struct uart_cmsdk_s *)dev->priv;
+
+  uart_cmsdk_disableuartint(priv);
+}
+
+/****************************************************************************
+ * Name: uart_cmsdk_attach
+ *
+ * Description:
+ *   Configure the UART to operation in interrupt driven mode.
+ *   This method is called when the serial port is opened.
+ *   Normally, this is just after the setup() method is called,
+ *   however, the serial console may operate in a non-interrupt driven
+ *   mode during the boot phase.
+ *
+ *   RX and TX interrupts are not enabled when by the
+ *   attach method (unless the hardware supports multiple levels of
+ *   interrupt enabling).  The RX and TX
+ *   interrupts are not enabled until the txint() and rxint()
+ *   methods are called.
+ *
+ ****************************************************************************/
+
+static int uart_cmsdk_attach(struct uart_dev_s *dev)
+{
+  FAR struct uart_cmsdk_s *priv = (FAR struct uart_cmsdk_s *)dev->priv;
+  int ret = 0;
+
+  /* Attach and enable the IRQ */
+
+  ret = irq_attach(priv->tx_irq, uart_cmsdk_tx_interrupt, dev);
+  ret |= irq_attach(priv->rx_irq, uart_cmsdk_rx_interrupt, dev);
+  ret |= irq_attach(priv->ov_irq, uart_cmsdk_ov_interrupt, dev);
+#ifndef CONFIG_ARCH_NOINTC
+  if (ret == OK)
+    {
+      /* Enable the interrupt (RX and TX interrupts are still disabled
+       * in the UART
+       */
+
+      up_enable_irq(priv->tx_irq);
+      up_enable_irq(priv->rx_irq);
+      up_enable_irq(priv->ov_irq);
+    }
+#endif
+
+  return ret;
+}
+
+/****************************************************************************
+ * Name: uart_cmsdk_detach
+ *
+ * Description:
+ *   Detach UART interrupts.  This method is called when the serial port is
+ *   closed normally just before the shutdown method is called.
+ *   The exception is the serial console which is never shutdown.
+ *
+ ****************************************************************************/
+
+static void uart_cmsdk_detach(FAR struct uart_dev_s *dev)
+{
+  FAR struct uart_cmsdk_s *priv = (FAR struct uart_cmsdk_s *)dev->priv;
+
+  up_disable_irq(priv->tx_irq);
+  irq_detach(priv->tx_irq);
+  up_disable_irq(priv->rx_irq);
+  irq_detach(priv->rx_irq);
+  up_disable_irq(priv->ov_irq);
+  irq_detach(priv->ov_irq);
+}
+
+/****************************************************************************
+ * Name: uart_cmsdk_interrupt
+ *
+ * Description:
+ *   This is the UART interrupt handler.  It will be invoked when an
+ *   interrupt received on the 'irq'  It should call uart_transmitchars or
+ *   uart_receivechar to perform the appropriate data transfers.  The
+ *   interrupt handling logic must be able to map the 'irq' number into the
+ *   appropriate uart_cmsdk_s structure in order to call these functions.
+ *
+ ****************************************************************************/
+
+static int uart_cmsdk_rx_interrupt(int irq, FAR void *context, FAR void *arg)
+{
+  FAR struct uart_dev_s *dev = (struct uart_dev_s *)arg;
+  FAR struct uart_cmsdk_s *priv;
+
+  DEBUGASSERT(dev != NULL && dev->priv != NULL);
+  priv = (FAR struct uart_cmsdk_s *)dev->priv;
+
+  uart_cmsdk_serialout(priv, UART_INTSTS_OFFSET, UART_INTSTATUS_RX);
+  uart_recvchars(dev);
+
+  return OK;
+}
+
+static int uart_cmsdk_ov_interrupt(int irq, FAR void *context, FAR void *arg)
+{
+  FAR struct uart_dev_s *dev = (struct uart_dev_s *)arg;
+  FAR struct uart_cmsdk_s *priv;
+
+  DEBUGASSERT(dev != NULL && dev->priv != NULL);
+  priv = (FAR struct uart_cmsdk_s *)dev->priv;
+  if (uart_cmsdk_serialin(priv, UART_INTSTS_OFFSET) &
+     UART_INTSTATUS_RX_OVERRUN)
+    {
+      uart_cmsdk_serialout(priv, UART_INTSTS_OFFSET,
+                           UART_INTSTATUS_RX_OVERRUN);
+      uart_cmsdk_serialout(priv, UART_STATE_OFFSET,
+                           UART_STATE_RX_BUF_OVERRUN);
+    }
+
+  if (uart_cmsdk_serialin(priv, UART_INTSTS_OFFSET) &
+     UART_INTSTATUS_TX_OVERRUN)
+    {
+      uart_cmsdk_serialout(priv, UART_INTSTS_OFFSET,
+                           UART_INTSTATUS_TX_OVERRUN);
+      uart_cmsdk_serialout(priv, UART_STATE_OFFSET,
+                           UART_STATE_TX_BUF_OVERRUN);
+    }
+
+  return OK;
+}
+
+static int uart_cmsdk_tx_interrupt(int irq, FAR void *context, FAR void *arg)
+{
+  FAR struct uart_dev_s *dev = (struct uart_dev_s *)arg;
+  FAR struct uart_cmsdk_s *priv;
+
+  DEBUGASSERT(dev != NULL && dev->priv != NULL);
+  priv = (FAR struct uart_cmsdk_s *)dev->priv;
+
+  uart_cmsdk_serialout(priv, UART_INTSTS_OFFSET, UART_INTSTATUS_TX);
+  uart_xmitchars(dev);
+
+  return OK;
+}
+
+/****************************************************************************
+ * Name: uart_cmsdk_ioctl
+ *
+ * Description:
+ *   All ioctl calls will be routed through this method
+ *
+ ****************************************************************************/
+
+static int uart_cmsdk_ioctl(struct file *filep, int cmd, unsigned long arg)
+{
+  FAR struct uart_dev_s *dev = filep->f_inode->i_private;
+  FAR struct uart_cmsdk_s *priv = (FAR struct uart_cmsdk_s *)dev->priv;

Review Comment:
   ```suggestion
     FAR struct uart_cmsdk_s *priv = dev->priv;
   ```
   remove all `void *` cast



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