Skip to content
Merged
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
1 change: 1 addition & 0 deletions Kbuild
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ neuron-objs += neuron_fw_io.o
neuron-objs += neuron_dmabuf.o
neuron-objs += neuron_log.o
neuron-objs += neuron_power.o
neuron-objs += neuron_test.o
neuron-objs += vc/neuron_dhal_vc.o
neuron-objs += v2/notific.o v2/neuron_dhal_v2.o
neuron-objs += v3/notific.o v3/neuron_dhal_v3.o v3/neuron_pelect.o
Expand Down
23 changes: 23 additions & 0 deletions Kbuild.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
obj-m += neuron.o

neuron-objs := neuron_arch.o neuron_dhal.o
neuron-objs += neuron_reg_access.o
neuron-objs += neuron_module.o neuron_pci.o neuron_mempool.o neuron_dma.o neuron_ring.o neuron_ds.o
neuron-objs += neuron_core.o neuron_crwl.o neuron_cdev.o neuron_topsp.o neuron_pid.o
neuron-objs += neuron_reset.o neuron_cinit.o neuron_mmap.o neuron_p2p.o
neuron-objs += neuron_nq.o
neuron-objs += neuron_mc_handle.o
neuron-objs += neuron_metrics.o neuron_sysfs_metrics.o
neuron-objs += udma/udma_iofic.o udma/udma_m2m.o udma/udma_main.o
neuron-objs += neuron_fw_io.o
neuron-objs += neuron_dmabuf.o
neuron-objs += neuron_log.o
neuron-objs += neuron_power.o
neuron-objs += vc/neuron_dhal_vc.o
neuron-objs += v2/notific.o v2/neuron_dhal_v2.o
neuron-objs += v3/notific.o v3/neuron_dhal_v3.o v3/neuron_pelect.o
neuron-objs += v4/neuron_dhal_v4.o
{extra-objs}
ccflags-y += -O3 -Wall -Werror -Wno-declaration-after-statement -Wunused-macros -Wunused-local-typedefs
ccflags-y += -I$(src)/
ccflags-y += $(call cc-option,-march=armv8.2-a)
2 changes: 1 addition & 1 deletion aws-neuronx-dkms-mkdeb/debian/postinst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
#!/usr/bin/sh
# Copyright (C) 2002-2005 Flavio Stanchina
# Copyright (C) 2005-2006 Aric Cyr
# Copyright (C) 2007 Mario Limonciello
Expand Down
2 changes: 1 addition & 1 deletion aws-neuronx-dkms-mkdeb/debian/prerm
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
#!/usr/bin/sh

NAME=MODULE_NAME
VERSION=MODULE_VERSION
Expand Down
7 changes: 7 additions & 0 deletions aws-neuronx-dkms-mkrpm.spec
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@
%{?!_srcdir: %define _srcdir %_prefix/src}
%{?!_datarootdir: %define _datarootdir %{_datadir}}

%define _source_filedigest_algorithm 10
%define _binary_filedigest_algorithm 10
%define _binary_payload w7.xzdio

Summary: %{module_name} %{version} dkms package
Name: aws-neuronx-dkms
Version: %{version}
Expand Down Expand Up @@ -84,6 +88,9 @@ exit 0
%files
%defattr(-,root,root)
%{_srcdir}
%attr(755,root,root) %{_srcdir}/%{module_name}-%{version}/preinstall
%attr(755,root,root) %{_srcdir}/%{module_name}-%{version}/postinstall
%attr(755,root,root) %{_srcdir}/%{module_name}-%{version}/postremove
%{_datarootdir}/%{module_name}/

%changelog
Expand Down
12 changes: 12 additions & 0 deletions aws-neuronx-dkms-mkrpm/post_install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
for POSTINST in /usr/lib/dkms/common.postinst /usr/share/MODULE_NAME/postinst; do
if [ -f $POSTINST ]; then
$POSTINST MODULE_NAME MODULE_VERSION /usr/share/MODULE_NAME
exit $?
fi
echo "WARNING: $POSTINST does not exist."
done
echo -e "ERROR: DKMS version is too old and MODULE_NAME was not"
echo -e "built with legacy DKMS support."
echo -e "You must either rebuild MODULE_NAME with legacy postinst"
echo -e "support or upgrade DKMS to a more current version."
exit 1
12 changes: 12 additions & 0 deletions aws-neuronx-dkms-mkrpm/pre_uninstall.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
echo -e
echo -e "Uninstall of MODULE_NAME module (version MODULE_VERSION) beginning:"
if lsmod | grep -q "^neuron "; then
echo "Neuron module is currently loaded. Attempting to unload..."
if ! rmmod neuron 2>/dev/null; then
echo "ERROR: Cannot unload neuron module - it is currently in use."
echo "Please stop all processes using the neuron module before uninstalling."
exit 1
fi
fi
dkms remove -m MODULE_NAME -v MODULE_VERSION --all --rpm_safe_upgrade
exit 0
2 changes: 1 addition & 1 deletion dkms.conf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
PACKAGE_NAME=aws-neuronx
PACKAGE_VERSION=2.27.4.0
PACKAGE_VERSION=2.28.0.0
BUILT_MODULE_NAME[0]="neuron"
MAKE[0]="make -C ${kernel_source_dir} M=${dkms_tree}/${PACKAGE_NAME}/${PACKAGE_VERSION}/build"
CLEAN="make -C ${kernel_source_dir} M=${dkms_tree}/${PACKAGE_NAME}/${PACKAGE_VERSION}/build clean"
Expand Down
5 changes: 5 additions & 0 deletions neuron_arch.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ enum neuron_platform_type {
NEURON_PLATFORM_TYPE_INVALID,
};

enum neuron_platform_operation_type {
NEURON_PLATFORM_OP_TYPE_DEVOPEN = 0,
NEURON_PLATFORM_OP_TYPE_EXEC = 1,
};

/**
* narch_init() - Set neuron devices architecture and revision.
*
Expand Down
Loading