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 2020/12/19 03:42:48 UTC

[GitHub] [incubator-nuttx] v01d commented on a change in pull request #2566: arch/risc-v: Add BL602 support

v01d commented on a change in pull request #2566:
URL: https://github.com/apache/incubator-nuttx/pull/2566#discussion_r546185247



##########
File path: arch/risc-v/src/bl602/bl602_entry.S
##########
@@ -0,0 +1,144 @@
+/****************************************************************************
+ * arch/risc-v/src/bl602/bl602_entry.S
+ *
+ * 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 <arch/rv32im/irq.h>
+
+	.section .init
+	.globl bl602_start
+	.globl __start
+	.type bl602_start,@function
+
+__start:
+bl602_start:
+	.cfi_startproc
+	.cfi_undefined ra
+  .option push
+  .option norelax
+
+  /*disable IRQ*/
+
+	li t0, MSTATUS_MIE
+	csrc mstatus, t0
+
+	la gp, __global_pointer$
+.option pop
+	la sp, _sp_main
+
+#ifndef RUN_IN_RAM
+	/* Load boot2 partition address */
+
+	la a0, __boot2_pt_addr_src
+	la a1, __boot2_pt_addr_start
+	la a2, __boot2_pt_addr_end
+	bgeu a1, a2, 2f
+
+1:

Review comment:
       use declarative names for labels, so that is easier to understand what is going on




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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org