eenurkka commented on a change in pull request #5040: URL: https://github.com/apache/incubator-nuttx/pull/5040#discussion_r772448860
########## File path: arch/risc-v/src/mpfs/mpfs_opensbi.c ########## @@ -0,0 +1,523 @@ +/**************************************************************************** + * arch/risc-v/src/mpfs/mpfs_opensbi.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 <errno.h> +#include <stdint.h> +#include <riscv_internal.h> +#include <riscv_arch.h> + +#include <hardware/mpfs_plic.h> +#include <hardware/mpfs_memorymap.h> +#include <hardware/mpfs_clint.h> +#include <hardware/mpfs_sysreg.h> + +/* OpenSBI will also define NULL. Undefine NULL in order to avoid warning: + * 'warning: "NULL" redefined' + */ + +#ifdef NULL + #undef NULL +#endif + +#include <sbi/sbi_types.h> +#include <sbi/riscv_atomic.h> +#include <sbi/riscv_asm.h> +#include <sbi/riscv_io.h> +#include <sbi/riscv_encoding.h> +#include <sbi/sbi_hart.h> +#include <sbi/sbi_console.h> +#include <sbi/sbi_platform.h> +#include <sbi/sbi_domain.h> +#include <sbi/sbi_timer.h> +#include <sbi/sbi_init.h> +#include <sbi/sbi_scratch.h> +#include <sbi_utils/irqchip/plic.h> +#include <sbi_utils/ipi/aclint_mswi.h> +#include <sbi_utils/timer/aclint_mtimer.h> + +/**************************************************************************** + * Pre-processor Definitions + ****************************************************************************/ + +#define MPFS_SYS_CLK 1000000000 +#define MPFS_MAX_NUM_HARTS 5 +#define MPFS_HART_COUNT 5 + +#define MPFS_ACLINT_MSWI_ADDR MPFS_CLINT_MSIP0 +#define MPFS_ACLINT_MTIMER_ADDR MPFS_CLINT_MTIMECMP0 + +#define MPFS_PMP_DEFAULT_ADDR 0xfffffffff +#define MPFS_PMP_DEFAULT_PERM 0x000000009f + +static bool mpfs_console_ready = false; Review comment: That's right, will fix -- 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
