-
Notifications
You must be signed in to change notification settings - Fork 961
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(VirtIO): move VirtIOSerial as a built-in library
Including OpenAMP. Signed-off-by: Frederic Pillon <[email protected]>
- Loading branch information
Showing
46 changed files
with
160 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,6 +11,8 @@ Note: most license information is available on top of each source file | |
|
||
* cores/arduino/stm32/ mainly contains source from STMicroelectronics. | ||
* system/Drivers/STM32*xx_HAL_Driver folders include the STMicroelectronics HAL Drivers. | ||
* system/Middlewares/OpenAMP folders. | ||
* libraries/VirtIO/ OpenAMP part except virtio* implementation see [MIT License](#mit-license) | ||
* libraries/SrcWrapper/inc/PinName*.h | ||
|
||
[Ultimate Liberty License](#Ultimate-Liberty-License) is used for: | ||
|
@@ -22,6 +24,9 @@ Note: most license information is available on top of each source file | |
* libraries/SrcWrapper/src/stm32/pinmap.c | ||
* tools/platformio/platformio-build.py | ||
|
||
[MIT License](#mit-license) | ||
* libraries/VirtIO/*/virtio* | ||
|
||
Note: | ||
* system/STM32*xx/system_stm32*xx.c uses same license than system/Drivers/ subfolders | ||
* system/STM32*xx/stm32*xx_hal_conf_default.h uses same license than system/Drivers/CMSIS | ||
|
@@ -776,3 +781,14 @@ the License. You may obtain a copy of the License at: | |
limitations under the License. | ||
|
||
------------------------------------------------------------------------------- | ||
## MIT License | ||
The MIT License (MIT) | ||
Copyright (c) 2020 Bumsik kim <[email protected]> | ||
|
||
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. | ||
|
||
------------------------------------------------------------------------------- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
# v3.21 implemented semantic changes regarding $<TARGET_OBJECTS:...> | ||
# See https://cmake.org/cmake/help/v3.21/command/target_link_libraries.html#linking-object-libraries-via-target-objects | ||
cmake_minimum_required(VERSION 3.21) | ||
|
||
add_library(VirtIO INTERFACE) | ||
add_library(VirtIO_usage INTERFACE) | ||
|
||
target_include_directories(VirtIO_usage INTERFACE | ||
src | ||
) | ||
|
||
|
||
target_link_libraries(VirtIO_usage INTERFACE | ||
base_config | ||
) | ||
|
||
target_link_libraries(VirtIO INTERFACE VirtIO_usage) | ||
|
||
|
||
|
||
add_library(VirtIO_bin OBJECT EXCLUDE_FROM_ALL | ||
src/libmetal/device.c | ||
src/libmetal/generic/condition.c | ||
src/libmetal/generic/cortexm/sys.c | ||
src/libmetal/generic/generic_device.c | ||
src/libmetal/generic/generic_init.c | ||
src/libmetal/generic/generic_io.c | ||
src/libmetal/generic/generic_shmem.c | ||
src/libmetal/generic/time.c | ||
src/libmetal/init.c | ||
src/libmetal/io.c | ||
src/libmetal/log.c | ||
src/libmetal/shmem.c | ||
src/mbox_ipcc.c | ||
src/open-amp/remoteproc/remoteproc_virtio.c | ||
src/open-amp/rpmsg/rpmsg.c | ||
src/open-amp/rpmsg/rpmsg_virtio.c | ||
src/openamp.c | ||
src/rsc_table.c | ||
src/virt_uart.c | ||
src/virtio/virtio.c | ||
src/virtio/virtqueue.c | ||
src/virtio_buffer.c | ||
src/virtio_log.c | ||
src/VirtIOSerial.cpp | ||
) | ||
target_link_libraries(VirtIO_bin PUBLIC VirtIO_usage) | ||
|
||
target_link_libraries(VirtIO INTERFACE | ||
VirtIO_bin | ||
$<TARGET_OBJECTS:VirtIO_bin> | ||
) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
int available; | ||
char buffer[1024]; | ||
|
||
unsigned long start_time = 0; | ||
|
||
void setup() { | ||
Serial.begin(115200); | ||
pinMode(LED_BUILTIN, OUTPUT); | ||
} | ||
|
||
void loop() { | ||
available = Serial.available(); | ||
while (available > 0) { | ||
int size = min(available, Serial.availableForWrite()); | ||
Serial.readBytes(buffer, size); | ||
Serial.write(buffer, size); | ||
available -= size; | ||
} | ||
|
||
// Heartbeat. If Arduino stops the LED won't flash anymore. | ||
if ((millis() - start_time) > 1000) { | ||
start_time = millis(); | ||
digitalWrite(LED_BUILTIN, !digitalRead(LED_BUILTIN)); | ||
} | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
####################################### | ||
# Syntax Coloring Map For VirtIO | ||
####################################### | ||
|
||
####################################### | ||
# Datatypes (KEYWORD1) | ||
####################################### | ||
VirtIOSerial KEYWORD1 | ||
VIRT_UART_HandleTypeDef KEYWORD1 | ||
VirtIOSerialObj_t KEYWORD1 | ||
virtio_buffer_t KEYWORD1 | ||
|
||
####################################### | ||
# Methods and Functions (KEYWORD2) | ||
####################################### | ||
SerialVirtIO KEYWORD2 | ||
begin KEYWORD2 | ||
available KEYWORD2 | ||
availableForWrite KEYWORD2 | ||
peek KEYWORD2 | ||
read KEYWORD2 | ||
readBytes KEYWORD2 | ||
write KEYWORD2 | ||
flush KEYWORD2 | ||
rxGenericCallback KEYWORD2 | ||
rxCallback KEYWORD2 | ||
|
||
####################################### | ||
# Constants (LITERAL1) | ||
####################################### |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
name=VirtIO | ||
version=1.0.0 | ||
author=Bumsik kim | ||
maintainer=stm32duino | ||
sentence=Enables the communication between cortex-A7 (Linux) and cortex-m4 (Arduino) via shared memory. | ||
paragraph=Provide VirtIOSerial based on OpenAMP. | ||
category=Communication | ||
url=https://github.com/stm32duino/Arduino_Core_STM32 | ||
architectures=stm32 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#ifndef __VIRTIO_H__ | ||
#define __VIRTIO_H__ | ||
|
||
#endif /* __VIRTIO_H__ */ |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters