yf13 commented on code in PR #15593: URL: https://github.com/apache/nuttx/pull/15593#discussion_r1922963257
########## boards/arm/qemu/qemu-armv7r/src/qemu_bringup.c: ########## @@ -0,0 +1,135 @@ +/**************************************************************************** + * boards/arm/qemu/qemu-armv7r/src/qemu_bringup.c + * + * SPDX-License-Identifier: Apache-2.0 + * + * 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 <syslog.h> + +#include <nuttx/fs/fs.h> +#include <nuttx/fdt.h> + +#ifdef CONFIG_LIBC_FDT +# include <libfdt.h> +#endif + +#include "chip.h" +#include "qemu-armv7r.h" + +/**************************************************************************** + * Pre-processor Definitions + ****************************************************************************/ + +#ifndef QEMU_SPI_IRQ_BASE +#define QEMU_SPI_IRQ_BASE 32 +#endif + +/**************************************************************************** + * Private Functions + ****************************************************************************/ + +#if defined(CONFIG_LIBC_FDT) && defined(CONFIG_DEVICE_TREE) + +/**************************************************************************** + * Name: register_devices_from_fdt + ****************************************************************************/ + +static void register_devices_from_fdt(void) +{ + const void *fdt = fdt_get(); + int ret; + + if (fdt == NULL) + { + return; + } + +#ifdef CONFIG_DRIVERS_VIRTIO_MMIO + ret = fdt_virtio_mmio_devices_register(fdt, QEMU_SPI_IRQ_BASE); + if (ret < 0) + { + syslog(LOG_ERR, "fdt_virtio_mmio_devices_register failed, ret=%d\n", + ret); + } +#endif + +#ifdef CONFIG_PCI + ret = fdt_pci_ecam_register(fdt); + if (ret < 0) + { + syslog(LOG_ERR, "fdt_pci_ecam_register failed, ret=%d\n", ret); + } +#endif + + UNUSED(ret); +} + +#endif + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: imx_bringup Review Comment: thanks! see #15620 -- 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-unsubscr...@nuttx.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org