From 87df106b58c3087a3827bfb69ea3353618e32d10 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 f12b129603..4d59b30627 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 d8b130c595..cb5d342063 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 a75b62b20f..cb7d446c73 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 6aea5d5950..cf5cce6139 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 7dd6434734..9e9cd1bdff 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 b5428ba751..1f4ec63e53 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 6aba1e7235..530b3126b4 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 8b22badf79..c7d1e256b8 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 b27b078a7e..8ebec04dff 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 1d08eb3d52..08178b77ae 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]