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

Added arduino support #17

Open
wants to merge 15 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,11 @@ CONFIG_FB_TFT=y
CONFIG_FB_TFT_SSD1306=y
CONFIG_FB_TFT_ST7789V=y
# CONFIG_IOMMU_SUPPORT is not set
CONFIG_REMOTEPROC=y
CONFIG_REMOTEPROC_CDEV=y
CONFIG_CVITEK_REMOTEPROC=y
CONFIG_RPMSG_CHAR=y
CONFIG_RPMSG_VIRTIO=y
CONFIG_CV1835_SYSDMA_REMAP=y
CONFIG_PWM=y
CONFIG_SIFIVE_PLIC=y
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class MemoryMap:
# =================
# Multimedia buffer. Used by u-boot/kernel/FreeRTOS
# =================
ION_SIZE = 26.5 * SIZE_1M
ION_SIZE = 0 * SIZE_1M
H26X_BITSTREAM_SIZE = 0 * SIZE_1M
H26X_ENC_BUFF_SIZE = 0
ISP_MEM_BASE_SIZE = 0 * SIZE_1M
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -263,3 +263,8 @@ CONFIG_DYNAMIC_DEBUG=y
# CONFIG_RCU_TRACE is not set
# CONFIG_FTRACE is not set
# CONFIG_RUNTIME_TESTING_MENU is not set
CONFIG_REMOTEPROC=y
CONFIG_REMOTEPROC_CDEV=y
CONFIG_CVITEK_REMOTEPROC=y
CONFIG_RPMSG_CHAR=y
CONFIG_RPMSG_VIRTIO=y
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,11 @@ CONFIG_ION_SYSTEM_HEAP=y
CONFIG_ION_CARVEOUT_HEAP=y
CONFIG_ION_CMA_HEAP=y
# CONFIG_IOMMU_SUPPORT is not set
CONFIG_REMOTEPROC=y
CONFIG_REMOTEPROC_CDEV=y
CONFIG_CVITEK_REMOTEPROC=y
CONFIG_RPMSG_CHAR=y
CONFIG_RPMSG_VIRTIO=y
CONFIG_CV1835_SYSDMA_REMAP=y
CONFIG_PWM=y
CONFIG_SIFIVE_PLIC=y
Expand Down
14 changes: 14 additions & 0 deletions build/boards/default/dts/cv180x/cv180x_default_memmap.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,19 @@
compatible = "ion-region";
size = <0x0 CVIMMAP_ION_SIZE>;
};


c906l: rtos_dram@CVIMMAP_FREERTOS_ADDR {
reg = <0x0 CVIMMAP_FREERTOS_ADDR 0x0 CVIMMAP_FREERTOS_SIZE>;
no-map;
};
};

c906l_rproc: c906l_rproc@0 {
compatible = "cvitek,cv18xx-c906l-rproc";
memory-region = <&c906l>;
core-name = "cv18xx-c906l";
firmware-name = "cvirtos.elf";
status = "okay";
};
};
14 changes: 14 additions & 0 deletions build/boards/default/dts/cv181x/cv181x_default_memmap.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,19 @@
compatible = "ion-region";
size = <0x0 CVIMMAP_ION_SIZE>;
};


c906l: rtos_dram@CVIMMAP_FREERTOS_ADDR {
reg = <0x0 CVIMMAP_FREERTOS_ADDR 0x0 CVIMMAP_FREERTOS_SIZE>;
no-map;
};
};

c906l_rproc: c906l_rproc@0 {
compatible = "cvitek,cv18xx-c906l-rproc";
memory-region = <&c906l>;
core-name = "cv18xx-c906l";
firmware-name = "cvirtos.elf";
status = "okay";
};
};
4 changes: 2 additions & 2 deletions cvi_mpi/sample/vdec/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ VDEC_DEPS = $(VDEC_SRCS:.c=.d)
TARGET = sample_vdec

ifeq ($(TARGET_MACHINE),arm-linux-gnueabihf)
TARGET_WITH_ASAN = sample_vdec_asan
#TARGET_WITH_ASAN = sample_vdec_asan
else ifeq ($(TARGET_MACHINE),aarch64-linux-gnu)
TARGET_WITH_ASAN = sample_vdec_asan
#TARGET_WITH_ASAN = sample_vdec_asan
else
TARGET_WITH_ASAN =
endif
Expand Down
4 changes: 2 additions & 2 deletions cvi_mpi/sample/vdecvo/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ VDEC_DEPS = $(VDEC_SRCS:.c=.d)
TARGET = sample_vdecvo
#
ifeq ($(TARGET_MACHINE), arm-linux-gnueabihf)
TARGET_WITH_ASAN = sample_vdecvo_asan
#TARGET_WITH_ASAN = sample_vdecvo_asan
else ifeq ($(TARGET_MACHINE), aarch64-linux-gnu)
TARGET_WITH_ASAN = sample_vdecvo_asan
#TARGET_WITH_ASAN = sample_vdecvo_asan
else
TARGET_WITH_ASAN =
endif
Expand Down
10 changes: 5 additions & 5 deletions cvi_mpi/sample/venc/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,11 @@ VCODEC_DEPS = $(VCODEC_SRCS:.c=.d)
TARGET_VENC = sample_venc
TARGET_VCODEC = sample_vcodec
ifeq ($(TARGET_MACHINE),arm-linux-gnueabihf)
TARGET_VENC_WITH_ASAN = sample_venc_asan
TARGET_VCODEC_WITH_ASAN = sample_vcodec_asan
#TARGET_VENC_WITH_ASAN = sample_venc_asan
#TARGET_VCODEC_WITH_ASAN = sample_vcodec_asan
else ifeq ($(TARGET_MACHINE), aarch64-linux-gnu)
TARGET_VENC_WITH_ASAN = sample_venc_asan
TARGET_VCODEC_WITH_ASAN = sample_vcodec_asan
#TARGET_VENC_WITH_ASAN = sample_venc_asan
#TARGET_VCODEC_WITH_ASAN = sample_vcodec_asan
else
TARGET_VENC_WITH_ASAN =
TARGET_VCODEC_WITH_ASAN =
Expand All @@ -67,7 +67,7 @@ endif

EXTRA_CFLAGS = $(INCS) $(DEFS)
EXTRA_LDFLAGS = $(LIBS) -lini -lpthread

EXTRA_LDFLAGS = $(LIBS) -lpthread -lm -lini -latomic
EXTRA_LDFLAGS_WITH_ASAN = -Wl,-Bdynamic $(LIBS) -lini -lpthread

ifeq ($(DEBUG), 1)
Expand Down
Copy link

Choose a reason for hiding this comment

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

I think using burnd source code is better than a binary file.

Binary file not shown.
13 changes: 13 additions & 0 deletions device/generic/rootfs_overlay/duo256m/mnt/system/usb-ncm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

/etc/uhubon.sh device >> /tmp/ncm.log 2>&1
/etc/run_usb.sh probe ncm >> /tmp/ncm.log 2>&1
if test -e /mnt/system/burnd; then
/etc/run_usb.sh probe acm >> /tmp/ncm.log 2>&1
fi
/etc/run_usb.sh start ncm >> /tmp/ncm.log 2>&1

sleep 0.5
Expand All @@ -13,3 +16,13 @@ if [ ${count} -lt 1 ] ;then
/etc/init.d/S80dnsmasq start >> /tmp/ncm.log 2>&1
fi

sleep 2
mkdir -p /lib/firmware
if test -e /mnt/system/burnd; then
burnd &
if test -e /lib/firmware/arduino.elf; then
sleep 2
echo stop > /sys/class/remoteproc/remoteproc0/state
echo start > /sys/class/remoteproc/remoteproc0/state
fi
fi
13 changes: 13 additions & 0 deletions device/generic/rootfs_overlay/duos/mnt/system/usb-ncm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ sleep 0.5

/etc/uhubon.sh device >> /tmp/ncm.log 2>&1
/etc/run_usb.sh probe ncm >> /tmp/ncm.log 2>&1
if test -e /mnt/system/burnd; then
/etc/run_usb.sh probe acm >> /tmp/ncm.log 2>&1
fi
/etc/run_usb.sh start ncm >> /tmp/ncm.log 2>&1

sleep 0.5
Expand All @@ -38,3 +41,13 @@ if [ ${count} -lt 1 ] ;then
/etc/init.d/S80dnsmasq start >> /tmp/ncm.log 2>&1
fi

sleep 2
mkdir -p /lib/firmware
if test -e /mnt/system/burnd; then
burnd &
if test -e /lib/firmware/arduino.elf; then
sleep 2
echo stop > /sys/class/remoteproc/remoteproc0/state
echo start > /sys/class/remoteproc/remoteproc0/state
fi
fi
2 changes: 1 addition & 1 deletion linux_5.10/arch/riscv/kernel/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ void __init setup_arch(char **cmdline_p)
else
pr_err("No DTB found in kernel mappings\n");
#endif

early_init_fdt_scan_reserved_mem();
#ifdef CONFIG_SWIOTLB
swiotlb_init(1);
#endif
Expand Down
1 change: 0 additions & 1 deletion linux_5.10/arch/riscv/mm/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,6 @@ void __init setup_bootmem(void)
else
memblock_reserve(__pa(PAGE_OFFSET), LOAD_OFFSET);

early_init_fdt_scan_reserved_mem();
memblock_allow_resize();
memblock_dump_all();
}
Expand Down
4 changes: 4 additions & 0 deletions linux_5.10/drivers/of/of_reserved_mem.c
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,11 @@ void __init fdt_reserved_mem_save_node(unsigned long node, const char *uname,
}

rmem->fdt_node = node;
#if defined(CONFIG_ARCH_CVITEK) && !defined(CONFIG_CVITEK_REMOTEPROC)
strncpy(rmem->name, uname, 8);
#else
rmem->name = uname;
#endif
rmem->base = base;
rmem->size = size;

Expand Down
7 changes: 7 additions & 0 deletions linux_5.10/drivers/remoteproc/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,13 @@ config TI_K3_R5_REMOTEPROC
It's safe to say N here if you're not interested in utilizing
a slave processor.

config CVITEK_REMOTEPROC
tristate "cvitek remoteproc support"
depends on ARCH_CVITEK
help
Say y here to support CVITEK's processors via the remote
processor framework.
This can be either built-in or a loadable module.
endif # REMOTEPROC

endmenu
1 change: 1 addition & 0 deletions linux_5.10/drivers/remoteproc/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,4 @@ obj-$(CONFIG_ST_SLIM_REMOTEPROC) += st_slim_rproc.o
obj-$(CONFIG_STM32_RPROC) += stm32_rproc.o
obj-$(CONFIG_TI_K3_DSP_REMOTEPROC) += ti_k3_dsp_remoteproc.o
obj-$(CONFIG_TI_K3_R5_REMOTEPROC) += ti_k3_r5_remoteproc.o
obj-$(CONFIG_CVITEK_REMOTEPROC) += cvitek_remoteproc.o
Loading