From 8ac5acfd2fb2fd6ca5872c35c485837ed07ef3bb Mon Sep 17 00:00:00 2001 From: "Cliff L. Biffle" Date: Thu, 30 Nov 2023 11:56:30 -0800 Subject: [PATCH] stm32h7: merge GPIO MPU regions. We were being careful and tiling three MPU regions to the exact boundaries of the implemented GPIO blocks on STM32H7. However, this also meant we were out of MPU slots. I need to map a region into sys for the external interrupt work. Here I've merged the regions into a single, slightly larger region. This technically exposes some undefined address space to the sys task. However, it _sure looks_ like the remaining space is reserved by ST for the addition of more GPIO blocks, since they've been stuffing more ports in here in past models. Since we won't be touching that address space -- and we can be fairly certain of that thanks to mostly-safe code -- I'd argue that this doesn't increase our risk. --- app/demo-stm32h7-nucleo/app-h743.toml | 2 +- app/demo-stm32h7-nucleo/app-h753.toml | 2 +- app/gemini-bu/app.toml | 2 +- app/gimlet/base.toml | 2 +- app/gimletlet/app-mgmt.toml | 2 +- app/gimletlet/base-gimletlet2.toml | 2 +- app/psc/base.toml | 2 +- app/sidecar/base.toml | 2 +- chips/stm32h7/chip.toml | 12 ++---------- test/tests-psc/app.toml | 2 +- 10 files changed, 11 insertions(+), 19 deletions(-) diff --git a/app/demo-stm32h7-nucleo/app-h743.toml b/app/demo-stm32h7-nucleo/app-h743.toml index f12b12960..4d59b3062 100644 --- a/app/demo-stm32h7-nucleo/app-h743.toml +++ b/app/demo-stm32h7-nucleo/app-h743.toml @@ -28,7 +28,7 @@ name = "drv-stm32xx-sys" features = ["h743"] priority = 1 max-sizes = {flash = 2048, ram = 1024} -uses = ["rcc", "gpios1", "gpios2", "gpios3", "system_flash"] +uses = ["rcc", "gpios", "system_flash"] start = true task-slots = ["jefe"] diff --git a/app/demo-stm32h7-nucleo/app-h753.toml b/app/demo-stm32h7-nucleo/app-h753.toml index d8b130c59..cb5d34206 100644 --- a/app/demo-stm32h7-nucleo/app-h753.toml +++ b/app/demo-stm32h7-nucleo/app-h753.toml @@ -28,7 +28,7 @@ name = "drv-stm32xx-sys" features = ["h753"] priority = 1 max-sizes = {flash = 2048, ram = 1024} -uses = ["rcc", "gpios1", "gpios2", "gpios3", "system_flash"] +uses = ["rcc", "gpios", "system_flash"] start = true task-slots = ["jefe"] diff --git a/app/gemini-bu/app.toml b/app/gemini-bu/app.toml index a75b62b20..cb7d446c7 100644 --- a/app/gemini-bu/app.toml +++ b/app/gemini-bu/app.toml @@ -26,7 +26,7 @@ name = "drv-stm32xx-sys" features = ["h753"] priority = 1 max-sizes = {flash = 2048, ram = 1024} -uses = ["rcc", "gpios1", "gpios2", "gpios3", "system_flash"] +uses = ["rcc", "gpios", "system_flash"] start = true task-slots = ["jefe"] diff --git a/app/gimlet/base.toml b/app/gimlet/base.toml index 6aea5d595..cf5cce613 100644 --- a/app/gimlet/base.toml +++ b/app/gimlet/base.toml @@ -53,7 +53,7 @@ name = "drv-stm32xx-sys" features = ["h753"] priority = 1 max-sizes = {flash = 2048, ram = 1024} -uses = ["rcc", "gpios1", "gpios2", "gpios3", "system_flash"] +uses = ["rcc", "gpios", "system_flash"] start = true task-slots = ["jefe"] diff --git a/app/gimletlet/app-mgmt.toml b/app/gimletlet/app-mgmt.toml index 7dd643473..9e9cd1bdf 100644 --- a/app/gimletlet/app-mgmt.toml +++ b/app/gimletlet/app-mgmt.toml @@ -26,7 +26,7 @@ name = "drv-stm32xx-sys" features = ["h753"] priority = 1 max-sizes = {flash = 2048, ram = 1024} -uses = ["rcc", "gpios1", "gpios2", "gpios3", "system_flash"] +uses = ["rcc", "gpios", "system_flash"] start = true task-slots = ["jefe"] diff --git a/app/gimletlet/base-gimletlet2.toml b/app/gimletlet/base-gimletlet2.toml index b5428ba75..1f4ec63e5 100644 --- a/app/gimletlet/base-gimletlet2.toml +++ b/app/gimletlet/base-gimletlet2.toml @@ -27,7 +27,7 @@ name = "drv-stm32xx-sys" features = ["h753"] priority = 1 max-sizes = {flash = 2048, ram = 1024} -uses = ["rcc", "gpios1", "gpios2", "gpios3", "system_flash"] +uses = ["rcc", "gpios", "system_flash"] start = true task-slots = ["jefe"] diff --git a/app/psc/base.toml b/app/psc/base.toml index 6aba1e723..530b3126b 100644 --- a/app/psc/base.toml +++ b/app/psc/base.toml @@ -37,7 +37,7 @@ name = "drv-stm32xx-sys" features = ["h753"] priority = 1 max-sizes = {flash = 2048, ram = 1024} -uses = ["rcc", "gpios1", "gpios2", "gpios3", "system_flash"] +uses = ["rcc", "gpios", "system_flash"] start = true task-slots = ["jefe"] diff --git a/app/sidecar/base.toml b/app/sidecar/base.toml index 8b22badf7..c7d1e256b 100644 --- a/app/sidecar/base.toml +++ b/app/sidecar/base.toml @@ -34,7 +34,7 @@ name = "drv-stm32xx-sys" features = ["h753"] priority = 1 max-sizes = {flash = 2048, ram = 1024} -uses = ["rcc", "gpios1", "gpios2", "gpios3", "system_flash"] +uses = ["rcc", "gpios", "system_flash"] start = true task-slots = ["jefe"] diff --git a/chips/stm32h7/chip.toml b/chips/stm32h7/chip.toml index b27b078a7..8ebec04df 100644 --- a/chips/stm32h7/chip.toml +++ b/chips/stm32h7/chip.toml @@ -2,17 +2,9 @@ address = 0x58024400 size = 1024 -[gpios1] +[gpios] address = 0x58020000 -size = 0x2000 - -[gpios2] -address = 0x58022000 -size = 0x0800 - -[gpios3] -address = 0x58022800 -size = 0x0400 +size = 0x4000 [spi1] address = 0x40013000 diff --git a/test/tests-psc/app.toml b/test/tests-psc/app.toml index 1d08eb3d5..08178b77a 100644 --- a/test/tests-psc/app.toml +++ b/test/tests-psc/app.toml @@ -48,7 +48,7 @@ name = "drv-stm32xx-sys" features = ["h753"] priority = 1 max-sizes = {flash = 2048, ram = 1024} -uses = ["rcc", "gpios1", "gpios2", "gpios3", "system_flash"] +uses = ["rcc", "gpios", "system_flash"] start = true [tasks.i2c_driver]