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:
@@ -1,8 +1,8 @@
|
||||
diff --git a/boards/nordic/nrf52840_dongle/src/main.rs b/boards/nordic/nrf52840_dongle/src/main.rs
|
||||
index fc53f59c8..d72d20482 100644
|
||||
--- a/boards/nordic/nrf52840_dongle/src/main.rs
|
||||
+++ b/boards/nordic/nrf52840_dongle/src/main.rs
|
||||
@@ -55,6 +55,11 @@ const NUM_PROCS: usize = 8;
|
||||
diff --git a/boards/nordic/nrf52840_dongle_opensk/src/main.rs b/boards/nordic/nrf52840_dongle_opensk/src/main.rs
|
||||
index e0e292a7e..b485a0997 100644
|
||||
--- a/boards/nordic/nrf52840_dongle_opensk/src/main.rs
|
||||
+++ b/boards/nordic/nrf52840_dongle_opensk/src/main.rs
|
||||
@@ -50,6 +50,11 @@ const NUM_PROCS: usize = 8;
|
||||
static mut PROCESSES: [Option<&'static dyn kernel::procs::ProcessType>; NUM_PROCS] =
|
||||
[None; NUM_PROCS];
|
||||
|
||||
@@ -14,7 +14,7 @@ index fc53f59c8..d72d20482 100644
|
||||
// Static reference to chip for panic dumps
|
||||
static mut CHIP: Option<&'static nrf52840::chip::Chip> = None;
|
||||
|
||||
@@ -90,6 +95,7 @@ pub struct Platform {
|
||||
@@ -78,6 +83,7 @@ pub struct Platform {
|
||||
'static,
|
||||
capsules::virtual_alarm::VirtualMuxAlarm<'static, nrf52840::rtc::Rtc<'static>>,
|
||||
>,
|
||||
@@ -22,9 +22,9 @@ index fc53f59c8..d72d20482 100644
|
||||
}
|
||||
|
||||
impl kernel::Platform for Platform {
|
||||
@@ -108,10 +114,30 @@ impl kernel::Platform for Platform {
|
||||
capsules::ieee802154::DRIVER_NUM => f(Some(self.ieee802154_radio)),
|
||||
capsules::temperature::DRIVER_NUM => f(Some(self.temp)),
|
||||
@@ -93,10 +99,30 @@ impl kernel::Platform for Platform {
|
||||
capsules::button::DRIVER_NUM => f(Some(self.button)),
|
||||
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)),
|
||||
kernel::ipc::DRIVER_NUM => f(Some(&self.ipc)),
|
||||
@@ -53,7 +53,7 @@ index fc53f59c8..d72d20482 100644
|
||||
}
|
||||
|
||||
/// Entry point in the vector table called on hard reset.
|
||||
@@ -120,7 +146,10 @@ pub unsafe fn reset_handler() {
|
||||
@@ -105,7 +131,10 @@ pub unsafe fn reset_handler() {
|
||||
// Loads relocations and clears BSS
|
||||
nrf52840::init();
|
||||
|
||||
@@ -65,7 +65,7 @@ index fc53f59c8..d72d20482 100644
|
||||
|
||||
// GPIOs
|
||||
let gpio = components::gpio::GpioComponent::new(
|
||||
@@ -286,6 +315,14 @@ pub unsafe fn reset_handler() {
|
||||
@@ -249,6 +278,14 @@ pub unsafe fn reset_handler() {
|
||||
nrf52840::acomp::Comparator
|
||||
));
|
||||
|
||||
@@ -80,19 +80,19 @@ index fc53f59c8..d72d20482 100644
|
||||
nrf52_components::NrfClockComponent::new().finalize(());
|
||||
|
||||
let platform = Platform {
|
||||
@@ -300,6 +337,7 @@ pub unsafe fn reset_handler() {
|
||||
temp,
|
||||
@@ -260,6 +297,7 @@ pub unsafe fn reset_handler() {
|
||||
rng,
|
||||
alarm,
|
||||
analog_comparator,
|
||||
+ nvmc,
|
||||
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 169f3d393..2ebb384d8 100644
|
||||
--- a/boards/nordic/nrf52840dk/src/main.rs
|
||||
+++ b/boards/nordic/nrf52840dk/src/main.rs
|
||||
@@ -123,6 +123,11 @@ const NUM_PROCS: usize = 8;
|
||||
diff --git a/boards/nordic/nrf52840dk_opensk/src/main.rs b/boards/nordic/nrf52840dk_opensk/src/main.rs
|
||||
index 8e4238018..ebee8704b 100644
|
||||
--- a/boards/nordic/nrf52840dk_opensk/src/main.rs
|
||||
+++ b/boards/nordic/nrf52840dk_opensk/src/main.rs
|
||||
@@ -114,6 +114,11 @@ const NUM_PROCS: usize = 8;
|
||||
static mut PROCESSES: [Option<&'static dyn kernel::procs::ProcessType>; NUM_PROCS] =
|
||||
[None; NUM_PROCS];
|
||||
|
||||
@@ -104,18 +104,18 @@ index 169f3d393..2ebb384d8 100644
|
||||
static mut CHIP: Option<&'static nrf52840::chip::Chip> = None;
|
||||
|
||||
/// Dummy buffer that causes the linker to reserve enough space for the stack.
|
||||
@@ -158,6 +163,7 @@ pub struct Platform {
|
||||
@@ -141,6 +146,7 @@ pub struct Platform {
|
||||
'static,
|
||||
capsules::virtual_alarm::VirtualMuxAlarm<'static, nrf52840::rtc::Rtc<'static>>,
|
||||
>,
|
||||
nonvolatile_storage: &'static capsules::nonvolatile_storage_driver::NonvolatileStorage<'static>,
|
||||
+ nvmc: &'static nrf52840::nvmc::SyscallDriver,
|
||||
}
|
||||
|
||||
impl kernel::Platform for Platform {
|
||||
@@ -177,10 +183,30 @@ impl kernel::Platform for Platform {
|
||||
capsules::temperature::DRIVER_NUM => f(Some(self.temp)),
|
||||
@@ -156,10 +162,30 @@ impl kernel::Platform for Platform {
|
||||
capsules::button::DRIVER_NUM => f(Some(self.button)),
|
||||
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)),
|
||||
kernel::ipc::DRIVER_NUM => f(Some(&self.ipc)),
|
||||
_ => f(None),
|
||||
@@ -143,7 +143,7 @@ index 169f3d393..2ebb384d8 100644
|
||||
}
|
||||
|
||||
/// Entry point in the vector table called on hard reset.
|
||||
@@ -204,7 +230,10 @@ pub unsafe fn reset_handler() {
|
||||
@@ -183,7 +209,10 @@ pub unsafe fn reset_handler() {
|
||||
UartChannel::Pins(UartPins::new(UART_RTS, UART_TXD, UART_CTS, UART_RXD))
|
||||
};
|
||||
|
||||
@@ -155,7 +155,7 @@ index 169f3d393..2ebb384d8 100644
|
||||
|
||||
let gpio = components::gpio::GpioComponent::new(
|
||||
board_kernel,
|
||||
@@ -411,6 +440,14 @@ pub unsafe fn reset_handler() {
|
||||
@@ -334,6 +363,14 @@ pub unsafe fn reset_handler() {
|
||||
nrf52840::acomp::Comparator
|
||||
));
|
||||
|
||||
@@ -170,10 +170,10 @@ index 169f3d393..2ebb384d8 100644
|
||||
nrf52_components::NrfClockComponent::new().finalize(());
|
||||
|
||||
let platform = Platform {
|
||||
@@ -426,6 +463,7 @@ pub unsafe fn reset_handler() {
|
||||
@@ -345,6 +382,7 @@ pub unsafe fn reset_handler() {
|
||||
rng,
|
||||
alarm,
|
||||
analog_comparator,
|
||||
nonvolatile_storage,
|
||||
+ nvmc,
|
||||
ipc: kernel::ipc::IPC::new(board_kernel, &memory_allocation_capability),
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user