Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upstream/rx zephyr support pr1.1 #49

Draft
wants to merge 9 commits into
base: main
Choose a base branch
from
1 change: 1 addition & 0 deletions drivers/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# SPDX-License-Identifier: Apache-2.0

add_subdirectory_ifdef(CONFIG_HAS_RENESAS_RA_FSP ra)
add_subdirectory_ifdef(CONFIG_HAS_RENESAS_RX_RDP rx)
57 changes: 57 additions & 0 deletions drivers/rx/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# SPDX-License-Identifier: Apache-2.0

set(include_dirs
rdp/src/r_bsp
rdp/src/r_bsp/mcu
rdp/src/r_bsp/mcu/all
rdp/src/r_bsp/board
rdp/src/r_bsp/board/generic_${CONFIG_SOC_SERIES}
rdp/src/r_bsp/mcu/${CONFIG_SOC_SERIES}
rdp/src/r_bsp/mcu/${CONFIG_SOC_SERIES}/register_access/gnuc
)

set(srcs
rdp/src/r_bsp/mcu/all/r_bsp_common.c
rdp/src/r_bsp/mcu/all/r_bsp_cpu.c
rdp/src/r_bsp/mcu/all/r_bsp_interrupts.c
rdp/src/r_bsp/mcu/all/r_bsp_software_interrupt.c
rdp/src/r_bsp/mcu/all/r_rx_intrinsic_functions.c
rdp/src/r_bsp/mcu/all/mcu_locks.c
rdp/src/r_bsp/mcu/${CONFIG_SOC_SERIES}/mcu_clocks.c
rdp/src/r_bsp/mcu/${CONFIG_SOC_SERIES}/mcu_init.c
rdp/src/r_bsp/mcu/${CONFIG_SOC_SERIES}/mcu_interrupts.c
)

zephyr_include_directories(${include_dirs})
zephyr_library_sources(${srcs})

# Optional build base on feature configuration
if(CONFIG_USE_RX_RDP_GPIO)
zephyr_library_sources(
rdp/src/r_gpio_rx/src/r_gpio_rx.c
rdp/src/r_gpio_rx/src/targets/${CONFIG_SOC_SERIES}/r_gpio_${CONFIG_SOC_SERIES}.c
)
zephyr_include_directories(rdp/src/r_gpio_rx)
endif()

if(CONFIG_USE_RX_RDP_MPC)
zephyr_library_sources(
rdp/src/r_mpc_rx/src/r_mpc_rx.c
)
zephyr_include_directories(rdp/src/r_mpc_rx)
endif()

if(CONFIG_USE_RX_RDP_SCI_UART)
zephyr_include_directories(rdp/src/r_pincfg
rdp/src/r_byteq
rdp/src/r_byteq/src
rdp/src/r_sci_rx
rdp/src/r_sci_rx/src
rdp/src/r_sci_rx/src/targets/${CONFIG_SOC_SERIES}
)
zephyr_library_sources(rdp/src/r_sci_rx/src/r_sci_rx.c
rdp/src/r_sci_rx/src/targets/${CONFIG_SOC_SERIES}/r_sci_${CONFIG_SOC_SERIES}.c
rdp/src/r_sci_rx/src/targets/${CONFIG_SOC_SERIES}/r_sci_${CONFIG_SOC_SERIES}_data.c
rdp/src/r_byteq/src/r_byteq.c
rdp/src/r_pincfg/r_sci_rx_pinset.c)
endif()
21 changes: 21 additions & 0 deletions drivers/rx/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2021 Renesas Electronics Corporation: RX MCUs team

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
40 changes: 40 additions & 0 deletions drivers/rx/README
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
Firmware Integration Technology (FIT)
#####################################

Origin:
Renesas Electronics Corporation
https://www.renesas.com/us/en/software-tool/fit

Status:
version v1.44

Purpose:
Firmware Integration Technology (FIT) for Renesas RX MCU Family.

Description:
This package is a snapshot from the RX FIT software released by Renesas Electronics Corporation
It contain the HAL and a set of CMSIS headers files for the Renesas RX MCUs

Dependencies:
None.

URL:
https://github.com/renesas/rx-driver-package

Commit:
04cc6a5ae3450fc7b00123635549e33fbf78458c

Maintained-by:
Renesas Electronics Corporation

License:
These software:
- can be used for any users.
- can be re-distributed by any users. (excluding r_emwin_rx)
- can be integrated with specified open source code.
- Amazon FreeRTOS has been now allowed, Renesas would accept other open source.
- use condition is basically MIT License, and details are shown in PDF file in FIT Modules directory.
- are generated by SmartConfigurator as well, the generated code (each FIT Modules and Code Generator parts) license is same as previous link.

License Link:
https://github.com/renesas/rx-driver-package/blob/master/LICENSE
92 changes: 92 additions & 0 deletions drivers/rx/rdp/src/r_bsp/board/generic_rx130/r_bsp.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
/***********************************************************************************************************************
* DISCLAIMER
* This software is supplied by Renesas Electronics Corporation and is only intended for use with Renesas products. No
* other uses are authorized. This software is owned by Renesas Electronics Corporation and is protected under all
* applicable laws, including copyright laws.
* THIS SOFTWARE IS PROVIDED "AS IS" AND RENESAS MAKES NO WARRANTIES REGARDING
* THIS SOFTWARE, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING BUT NOT LIMITED TO WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. ALL SUCH WARRANTIES ARE EXPRESSLY DISCLAIMED. TO THE MAXIMUM
* EXTENT PERMITTED NOT PROHIBITED BY LAW, NEITHER RENESAS ELECTRONICS CORPORATION NOR ANY OF ITS AFFILIATED COMPANIES
* SHALL BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES FOR ANY REASON RELATED TO THIS
* SOFTWARE, EVEN IF RENESAS OR ITS AFFILIATES HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
* Renesas reserves the right, without notice, to make changes to this software and to discontinue the availability of
* this software. By using this software, you agree to the additional terms and conditions found by accessing the
* following link:
* http://www.renesas.com/disclaimer
*
* Copyright (C) 2017 - 2024 Renesas Electronics Corporation. All rights reserved.
Comment on lines +2 to +17
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This statement is not compatible with Zephyr's license condition.
So, the BSP can't be included in the Zephyr repository.

Needing to change the license condition.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@soburi , thank you, we are under discussion for changing the license of this software package, hopefully we can resolve this issue soon.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK. This means we cannot merge this PR at this time.
Please mark as DNM.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@duynguyenxa Change it to Draft.

***********************************************************************************************************************/
/***********************************************************************************************************************
* File Name : r_bsp.h
* H/W Platform : GENERIC_RX130
* Description : Has the header files that should be included for this platform.
***********************************************************************************************************************/
/***********************************************************************************************************************
* History : DD.MM.YYYY Version Description
* : 15.05.2017 1.00 First release
* : 28.02.2019 2.00 Added the following include path.
* - r_rx_compiler.h
* - r_rtos.h
* - r_bsp_interrupts.h
* - mcu_clocks.h
* - r_rx_intrinsic_functions.h
* Modified the following include path.
* - lowsrc.h
* - r_bsp_mcu_startup.h
* - vecttbl.h
* Added support for GNUC and ICCRX.
* Fixed coding style.
* : 08.10.2019 2.01 Added the following include path.
* - r_bsp_software_interrupt.h
* Changed include of r_bsp_config.h for added support of Renesas RTOS(RI600V4 or RI600PX).
* : 23.04.2021 2.02 Added the include of fsp_common_api.h and r_fsp_error.h.
* : 30.11.2021 2.03 Modified the include file.
***********************************************************************************************************************/

/* Make sure that no other platforms have already been defined. Do not touch this! */
#ifdef PLATFORM_DEFINED
#error "Error - Multiple platforms defined in platform.h!"
#else
#define PLATFORM_DEFINED
#endif

#ifdef __cplusplus
extern "C" {
#endif

/***********************************************************************************************************************
INCLUDE APPROPRIATE MCU AND BOARD FILES
***********************************************************************************************************************/
#include "r_bsp_config.h"
#include "r_bsp_common.h"
#include "r_rx_compiler.h"

#if defined(__CCRX__)
#include "register_access/ccrx/iodefine.h"
#elif defined(__GNUC__)
#include "iodefine.h"
#elif defined(__ICCRX__)
#include "register_access/iccrx/iodefine.h"
#endif /* defined(__CCRX__), defined(__GNUC__), defined(__ICCRX__) */
#include "r_bsp_cpu.h"
#include "mcu_clocks.h"
#include "mcu_info.h"
#include "mcu_init.h"
#include "mcu_interrupts.h"
#include "mcu_locks.h"
#include "vecttbl.h"

#include "r_bsp_interrupts.h"
#include "r_bsp_software_interrupt.h"
#include "r_rx_intrinsic_functions.h"


#ifdef __cplusplus
}
#endif

#ifndef BSP_BOARD_GENERIC_RX130
#define BSP_BOARD_GENERIC_RX130

#endif /* BSP_BOARD_GENERIC_RX130 */

48 changes: 48 additions & 0 deletions drivers/rx/rdp/src/r_bsp/mcu/all/mcu_locks.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
/***********************************************************************************************************************
* DISCLAIMER
* This software is supplied by Renesas Electronics Corporation and is only intended for use with Renesas products. No
* other uses are authorized. This software is owned by Renesas Electronics Corporation and is protected under all
* applicable laws, including copyright laws.
* THIS SOFTWARE IS PROVIDED "AS IS" AND RENESAS MAKES NO WARRANTIES REGARDING
* THIS SOFTWARE, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING BUT NOT LIMITED TO WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. ALL SUCH WARRANTIES ARE EXPRESSLY DISCLAIMED. TO THE MAXIMUM
* EXTENT PERMITTED NOT PROHIBITED BY LAW, NEITHER RENESAS ELECTRONICS CORPORATION NOR ANY OF ITS AFFILIATED COMPANIES
* SHALL BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES FOR ANY REASON RELATED TO THIS
* SOFTWARE, EVEN IF RENESAS OR ITS AFFILIATES HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
* Renesas reserves the right, without notice, to make changes to this software and to discontinue the availability of
* this software. By using this software, you agree to the additional terms and conditions found by accessing the
* following link:
* http://www.renesas.com/disclaimer
*
* Copyright (C) 2013 Renesas Electronics Corporation. All rights reserved.
***********************************************************************************************************************/
/***********************************************************************************************************************
* File Name : mcu_locks.c
* Description : This source file has 1 lock per MCU resource.
***********************************************************************************************************************/
/**********************************************************************************************************************
* History : DD.MM.YYYY Version Description
* : 28.02.2019 2.00 Merged processing of all devices.
* Fixed coding style.
***********************************************************************************************************************/

/***********************************************************************************************************************
Includes <System Includes> , "Project Includes"
***********************************************************************************************************************/
/* Used for getting MCU information to accurately reflect available MCU resources. */
#include "platform.h"

/***********************************************************************************************************************
Macro definitions
***********************************************************************************************************************/

/***********************************************************************************************************************
Typedef definitions
***********************************************************************************************************************/

/***********************************************************************************************************************
Exported global variables (to be accessed by other files)
***********************************************************************************************************************/
/* Below are locks for controlling access to MCU resources. */
BSP_CFG_USER_LOCKING_TYPE g_bsp_Locks[BSP_NUM_LOCKS];

Loading