btashton commented on a change in pull request #2566: URL: https://github.com/apache/incubator-nuttx/pull/2566#discussion_r546182940
########## File path: arch/risc-v/src/bl602/bl602_start.c ########## @@ -0,0 +1,155 @@ +/**************************************************************************** + * arch/risc-v/src/bl602/bl602_init.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 <stdint.h> + +#include <nuttx/config.h> +#include <nuttx/arch.h> + +#include <arch/board/board.h> + +#include "riscv_internal.h" +#include "chip.h" + +#include "bl602_boot2.h" +#include "hardware/bl602_hbn.h" + +/**************************************************************************** + * Pre-processor Definitions + ****************************************************************************/ + +#ifdef CONFIG_DEBUG_FEATURES +#define showprogress(c) up_lowputc(c) +#else +#define showprogress(c) +#endif + +#define PARTITION_BOOT2_RAM_ADDR_ACTIVE (0x42049C00) +#define PARTITION_HEADER_BOOT2_RAM_ADDR (0x42049C04) +#define PARTITION_BOOT2_FLASH_HEADER (0x42049d14) +#define PARTITION_BOOT2_FLASH_CONFIG (0x42049d18) +#define PARTITION_MAGIC (0x54504642) +#define PARTITION_FW_PART_NAME "FW" +#define PARTITION_FW_PART_HEADER_SIZE (0x1000) + +/* TODO use header file from project */ + +#define FW_XIP_ADDRESS (0x23000000) + +#define BL602_IDLESTACK_SIZE (CONFIG_IDLETHREAD_STACKSIZE & ~3) + +/**************************************************************************** + * Private Data + ****************************************************************************/ + +/* g_idle_topstack: _sbss is the start of the BSS region as defined by the + * linker script. _ebss lies at the end of the BSS region. The idle task + * stack starts at the end of BSS and is of size CONFIG_IDLETHREAD_STACKSIZE. + * The IDLE thread is the thread that the system boots on and, eventually, + * becomes the IDLE, do nothing task that runs only when there is nothing + * else to run. The heap continues from there until the end of memory. + * g_idle_topstack is a read-only variable the provides this computed + * address. + */ + +static uint8_t idle_stack[BL602_IDLESTACK_SIZE]; + +/* Dont change the name of varaible, since we refer this + * boot2_partition_table in linker script + */ + +static struct Review comment: This needs to be updated to follow the style guide, including no unnamed structures. http://nuttx.apache.org/docs/latest/contributing/coding_style.html#structures ---------------------------------------------------------------- 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: [email protected]
