-
Notifications
You must be signed in to change notification settings - Fork 967
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
47 changed files
with
160 additions
and
38 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
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 serial communication between Cortex-A7 (Linux) and Cortex-M4 (Arduino) on STM32 MPUs 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
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