Kernel minimization (#334)

* adds patch to remove unused kernel components

* new boards, rebase patches to match

* rename boards for deployment
This commit is contained in:
kaczmarczyck
2021-06-28 14:55:20 +02:00
committed by GitHub
parent 5f20ba544b
commit ce0ee6c054
32 changed files with 1234 additions and 155 deletions

View File

@@ -101,11 +101,11 @@ index 000000000..69e95c3c7
+ usb_driver
+ }
+}
diff --git a/boards/nordic/nrf52840_dongle/src/main.rs b/boards/nordic/nrf52840_dongle/src/main.rs
index d72d20482..118ea6d68 100644
--- a/boards/nordic/nrf52840_dongle/src/main.rs
+++ b/boards/nordic/nrf52840_dongle/src/main.rs
@@ -45,6 +45,17 @@ const PAN_ID: u16 = 0xABCD;
diff --git a/boards/nordic/nrf52840_dongle_opensk/src/main.rs b/boards/nordic/nrf52840_dongle_opensk/src/main.rs
index b485a0997..f5d29d025 100644
--- a/boards/nordic/nrf52840_dongle_opensk/src/main.rs
+++ b/boards/nordic/nrf52840_dongle_opensk/src/main.rs
@@ -40,6 +40,17 @@ const _SPI_CLK: Pin = Pin::P1_04;
/// UART Writer
pub mod io;
@@ -123,7 +123,7 @@ index d72d20482..118ea6d68 100644
// State for loading and holding applications.
// How should the kernel respond when a process faults.
const FAULT_RESPONSE: kernel::procs::FaultResponse = kernel::procs::FaultResponse::Panic;
@@ -96,6 +107,11 @@ pub struct Platform {
@@ -84,6 +95,11 @@ pub struct Platform {
capsules::virtual_alarm::VirtualMuxAlarm<'static, nrf52840::rtc::Rtc<'static>>,
>,
nvmc: &'static nrf52840::nvmc::SyscallDriver,
@@ -135,15 +135,15 @@ index d72d20482..118ea6d68 100644
}
impl kernel::Platform for Platform {
@@ -115,6 +131,7 @@ impl kernel::Platform for Platform {
capsules::temperature::DRIVER_NUM => f(Some(self.temp)),
@@ -100,6 +116,7 @@ impl kernel::Platform for Platform {
capsules::rng::DRIVER_NUM => f(Some(self.rng)),
capsules::analog_comparator::DRIVER_NUM => f(Some(self.analog_comparator)),
nrf52840::nvmc::DRIVER_NUM => f(Some(self.nvmc)),
+ capsules::usb::usb_ctap::DRIVER_NUM => f(Some(self.usb)),
kernel::ipc::DRIVER_NUM => f(Some(&self.ipc)),
_ => f(None),
}
@@ -323,6 +340,21 @@ pub unsafe fn reset_handler() {
@@ -286,6 +303,21 @@ pub unsafe fn reset_handler() {
)
);
@@ -165,7 +165,7 @@ index d72d20482..118ea6d68 100644
nrf52_components::NrfClockComponent::new().finalize(());
let platform = Platform {
@@ -338,6 +370,7 @@ pub unsafe fn reset_handler() {
@@ -298,6 +330,7 @@ pub unsafe fn reset_handler() {
alarm,
analog_comparator,
nvmc,
@@ -173,13 +173,13 @@ index d72d20482..118ea6d68 100644
ipc: kernel::ipc::IPC::new(board_kernel, &memory_allocation_capability),
};
diff --git a/boards/nordic/nrf52840dk/src/main.rs b/boards/nordic/nrf52840dk/src/main.rs
index 2ebb384d8..4a7bfffdd 100644
--- a/boards/nordic/nrf52840dk/src/main.rs
+++ b/boards/nordic/nrf52840dk/src/main.rs
@@ -113,6 +113,17 @@ pub mod io;
diff --git a/boards/nordic/nrf52840dk_opensk/src/main.rs b/boards/nordic/nrf52840dk_opensk/src/main.rs
index ebee8704b..6a2f8715b 100644
--- a/boards/nordic/nrf52840dk_opensk/src/main.rs
+++ b/boards/nordic/nrf52840dk_opensk/src/main.rs
@@ -104,6 +104,17 @@ pub mod io;
// - Set to true to use Segger RTT over USB.
const USB_DEBUGGING: bool = false;
const USB_DEBUGGING: bool = true;
+const VENDOR_ID: u16 = 0x1915; // Nordic Semiconductor
+const PRODUCT_ID: u16 = 0x521f; // nRF52840 Dongle (PCA10059)
@@ -195,9 +195,9 @@ index 2ebb384d8..4a7bfffdd 100644
// State for loading and holding applications.
// How should the kernel respond when a process faults.
const FAULT_RESPONSE: kernel::procs::FaultResponse = kernel::procs::FaultResponse::Panic;
@@ -164,6 +175,11 @@ pub struct Platform {
@@ -147,6 +158,11 @@ pub struct Platform {
capsules::virtual_alarm::VirtualMuxAlarm<'static, nrf52840::rtc::Rtc<'static>>,
>,
nonvolatile_storage: &'static capsules::nonvolatile_storage_driver::NonvolatileStorage<'static>,
nvmc: &'static nrf52840::nvmc::SyscallDriver,
+ usb: &'static capsules::usb::usb_ctap::CtapUsbSyscallDriver<
+ 'static,
@@ -207,15 +207,15 @@ index 2ebb384d8..4a7bfffdd 100644
}
impl kernel::Platform for Platform {
@@ -184,6 +200,7 @@ impl kernel::Platform for Platform {
@@ -163,6 +179,7 @@ impl kernel::Platform for Platform {
capsules::rng::DRIVER_NUM => f(Some(self.rng)),
capsules::analog_comparator::DRIVER_NUM => f(Some(self.analog_comparator)),
capsules::nonvolatile_storage_driver::DRIVER_NUM => f(Some(self.nonvolatile_storage)),
nrf52840::nvmc::DRIVER_NUM => f(Some(self.nvmc)),
+ capsules::usb::usb_ctap::DRIVER_NUM => f(Some(self.usb)),
kernel::ipc::DRIVER_NUM => f(Some(&self.ipc)),
_ => f(None),
}
@@ -448,6 +465,21 @@ pub unsafe fn reset_handler() {
@@ -371,6 +388,21 @@ pub unsafe fn reset_handler() {
)
);
@@ -237,9 +237,9 @@ index 2ebb384d8..4a7bfffdd 100644
nrf52_components::NrfClockComponent::new().finalize(());
let platform = Platform {
@@ -464,6 +496,7 @@ pub unsafe fn reset_handler() {
@@ -383,6 +415,7 @@ pub unsafe fn reset_handler() {
alarm,
analog_comparator,
nonvolatile_storage,
nvmc,
+ usb,
ipc: kernel::ipc::IPC::new(board_kernel, &memory_allocation_capability),