Skip to content

Commit

Permalink
v6x-rt: move romapi to platform
Browse files Browse the repository at this point in the history
  • Loading branch information
PetervdPerk-NXP committed Jan 4, 2024
1 parent 6be8cbe commit b1cf4cc
Show file tree
Hide file tree
Showing 11 changed files with 134 additions and 21 deletions.
4 changes: 2 additions & 2 deletions boards/px4/fmu-v6xrt/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ if("${PX4_BOARD_LABEL}" STREQUAL "bootloader")
bootloader_main.c
init.c
usb.c
imxrt_romapi.c
imxrt_flexspi_nor_boot.c
imxrt_flexspi_nor_flash.c
imxrt_clockconfig.c
Expand All @@ -48,6 +47,7 @@ if("${PX4_BOARD_LABEL}" STREQUAL "bootloader")
nuttx_drivers # sdio
px4_layer #gpio
arch_io_pins # iotimer
arch_board_romapi
bootloader
)
target_include_directories(drivers_board PRIVATE ${PX4_SOURCE_DIR}/platforms/nuttx/src/bootloader/common)
Expand All @@ -72,7 +72,6 @@ else()
spi.cpp
timer_config.cpp
usb.c
imxrt_romapi.c
imxrt_flexspi_fram.c
imxrt_flexspi_nor_boot.c
imxrt_flexspi_nor_flash.c
Expand All @@ -83,6 +82,7 @@ else()
target_link_libraries(drivers_board
PRIVATE
arch_board_hw_info
arch_board_romapi
arch_spi
drivers__led # drv_led_start
nuttx_arch # sdio
Expand Down
2 changes: 1 addition & 1 deletion boards/px4/fmu-v6xrt/src/imxrt_flexspi_nor_flash.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
* Included Files
****************************************************************************/

#include "imxrt_flexspi_nor_flash.h"
#include <px4_arch/imxrt_flexspi_nor_flash.h>

/****************************************************************************
* Public Data
Expand Down
5 changes: 3 additions & 2 deletions boards/px4/fmu-v6xrt/src/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,7 @@

#include "arm_internal.h"
#include "imxrt_flexspi_nor_boot.h"
#include "imxrt_flexspi_nor_flash.h"
#include "imxrt_romapi.h"
#include <px4_arch/imxrt_flexspi_nor_flash.h>
#include "imxrt_iomuxc.h"
#include "imxrt_flexcan.h"
#include "imxrt_enet.h"
Expand All @@ -79,10 +78,12 @@

#include <arch/board/board.h>


#include <drivers/drv_hrt.h>
#include <drivers/drv_board_led.h>
#include <systemlib/px4_macros.h>
#include <px4_arch/io_timer.h>
#include <px4_arch/imxrt_romapi.h>
#include <px4_platform_common/init.h>
#include <px4_platform/gpio.h>
#include <px4_platform/board_determine_hw_info.h>
Expand Down
4 changes: 2 additions & 2 deletions platforms/nuttx/src/bootloader/nxp/imxrt_common/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
#include <px4_defines.h>

#include "hw_config.h"
#include "imxrt_flexspi_nor_flash.h"
#include "imxrt_romapi.h"
#include <px4_arch/imxrt_flexspi_nor_flash.h>
#include <px4_arch/imxrt_romapi.h>
#include <hardware/rt117x/imxrt117x_ocotp.h>
#include <hardware/rt117x/imxrt117x_anadig.h>
#include <hardware/rt117x/imxrt117x_snvs.h>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/****************************************************************************
* boards/px4/fmu-v6xrt/src/imxrt_flexspi_nor_flash.h
* platforms/nuttx/src/px4/nxp/imrt/include/px4_arch/imxrt_flexspi_nor_flash.h
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
Expand All @@ -18,8 +18,8 @@
*
****************************************************************************/

#ifndef __BOARDS_PX4_FMU_V6XRT_SRC_IMXRT_FLEXSPI_NOR_FLASH_H
#define __BOARDS_PX4_FMU_V6XRT_SRC_IMXRT_FLEXSPI_NOR_FLASH_H
#ifndef __PX4_ARCH_IMXRT_FLEXSPI_NOR_FLASH_H
#define __PX4_ARCH_IMXRT_FLEXSPI_NOR_FLASH_H

/****************************************************************************
* Included Files
Expand Down Expand Up @@ -349,4 +349,4 @@ extern const struct flexspi_nor_config_s g_flash_config;
extern const struct flexspi_nor_config_s g_flash_fast_config;


#endif /* __BOARDS_PX4_FMU_V6XRT_SRC_IMXRT_FLEXSPI_NOR_FLASH_H */
#endif /* __PX4_ARCH_IMXRT_FLEXSPI_NOR_FLASH_H */
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
/****************************************************************************
* boards/px4/fmu-v6xrt/src/imxrt_romapi.c
* platforms/nuttx/src/px4/nxp/imrt/include/px4_arch/imxrt_romapi.c
*
* Copyright 2017-2020 NXP
* Copyright 2017-2024 NXP
* All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*
****************************************************************************/
#ifndef __BOARDS_PX4_FMU_V6XRT_SRC_IMXRT_ROMAPI_H
#define __BOARDS_PX4_FMU_V6XRT_SRC_IMXRT_ROMAPI_H
#ifndef __PX4_ARCH_IMXRT_ROMAPI_H
#define __PX4_ARCH_IMXRT_ROMAPI_H

/****************************************************************************
*
Expand Down Expand Up @@ -370,4 +370,8 @@ void ROM_FLEXSPI_NorFlash_ClearCache(uint32_t instance);

/*@}*/

#endif /* __BOARDS_PX4_FMU_V6XRT_SRC_IMXRT_ROMAPI_H */
#ifdef __cplusplus
}
#endif

#endif /* __PX4_ARCH_IMXRT_ROMAPI_H */
36 changes: 36 additions & 0 deletions platforms/nuttx/src/px4/nxp/imxrt/romapi/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
############################################################################
#
# Copyright (c) 2019 PX4 Development Team. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in
# the documentation and/or other materials provided with the
# distribution.
# 3. Neither the name PX4 nor the names of its contributors may be
# used to endorse or promote products derived from this software
# without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
#
############################################################################

px4_add_library(arch_board_romapi
imxrt_romapi.c
)
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/****************************************************************************
* boards/px4/fmu-v6xrt/src/imxrt_romapi.c
* platforms/nuttx/src/px4/nxp/imrt/romapi/imxrt_romapi.c
*
* Copyright 2017-2020 NXP
* Copyright 2017-2024 NXP
* All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
Expand All @@ -22,8 +22,8 @@

#include "arm_internal.h"

#include "imxrt_flexspi_nor_flash.h"
#include "imxrt_romapi.h"
#include <px4_arch/imxrt_flexspi_nor_flash.h>
#include <px4_arch/imxrt_romapi.h>

#include <hardware/rt117x/imxrt117x_anadig.h>

Expand Down
2 changes: 1 addition & 1 deletion platforms/nuttx/src/px4/nxp/rt117x/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ add_subdirectory(adc)
add_subdirectory(../imxrt/board_critmon board_critmon)
add_subdirectory(../imxrt/board_hw_info board_hw_info)
add_subdirectory(../imxrt/board_reset board_reset)
#add_subdirectory(../imxrt/dshot dshot)
add_subdirectory(../imxrt/romapi romapi)
add_subdirectory(../imxrt/hrt hrt)
add_subdirectory(../imxrt/led_pwm led_pwm)
add_subdirectory(../imxrt/io_pins io_pins)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/****************************************************************************
*
* Copyright (c) 2024 PX4 Development Team. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* 3. Neither the name PX4 nor the names of its contributors may be
* used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
****************************************************************************/
#pragma once


#include "../../../imxrt/include/px4_arch/imxrt_flexspi_nor_flash.h"
36 changes: 36 additions & 0 deletions platforms/nuttx/src/px4/nxp/rt117x/include/px4_arch/imxrt_romapi.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/****************************************************************************
*
* Copyright (c) 2024 PX4 Development Team. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* 3. Neither the name PX4 nor the names of its contributors may be
* used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
****************************************************************************/
#pragma once


#include "../../../imxrt/include/px4_arch/imxrt_romapi.h"

0 comments on commit b1cf4cc

Please sign in to comment.