From 9ce1f01eb222fe28c91c2f864745f61581fd3446 Mon Sep 17 00:00:00 2001 From: aam335 Date: Sun, 8 Dec 2024 00:12:04 +0300 Subject: [PATCH 1/2] This commit introduces SPI6 hardware support for PB3-PB5 using the spi6a configuration --- src/stm32/stm32h7_spi.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/stm32/stm32h7_spi.c b/src/stm32/stm32h7_spi.c index ec69f851ade9..7e46ab272d52 100644 --- a/src/stm32/stm32h7_spi.c +++ b/src/stm32/stm32h7_spi.c @@ -53,6 +53,8 @@ DECL_CONSTANT_STR("BUS_PINS_spi5a", "PH7,PF11,PH6"); #ifdef SPI6 DECL_ENUMERATION("spi_bus", "spi6", __COUNTER__); DECL_CONSTANT_STR("BUS_PINS_spi6", "PG12,PG14,PG13"); +DECL_ENUMERATION("spi_bus", "spi6a", __COUNTER__); +DECL_CONSTANT_STR("BUS_PINS_spi6a", "PB3,PB4,PB5"); #endif @@ -76,6 +78,7 @@ static const struct spi_info spi_bus[] = { #endif #ifdef SPI6 { SPI6, GPIO('G', 12), GPIO('G', 14), GPIO('G', 13), GPIO_FUNCTION(5)}, + { SPI6, GPIO('B', 3), GPIO('B', 4), GPIO('B', 5), GPIO_FUNCTION(8)}, #endif }; From 2c778545f885b576b4feabdc8ec96bb5f00f2fa5 Mon Sep 17 00:00:00 2001 From: aam335 Date: Mon, 9 Dec 2024 23:23:50 +0300 Subject: [PATCH 2/2] fix pin order (in spi_info, not nessesary for hw spi) Signed-off-by: Andrey Melnikov Aam335@gmail.com --- src/stm32/stm32h7_spi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/stm32/stm32h7_spi.c b/src/stm32/stm32h7_spi.c index 7e46ab272d52..9025f01069f6 100644 --- a/src/stm32/stm32h7_spi.c +++ b/src/stm32/stm32h7_spi.c @@ -54,7 +54,7 @@ DECL_CONSTANT_STR("BUS_PINS_spi5a", "PH7,PF11,PH6"); DECL_ENUMERATION("spi_bus", "spi6", __COUNTER__); DECL_CONSTANT_STR("BUS_PINS_spi6", "PG12,PG14,PG13"); DECL_ENUMERATION("spi_bus", "spi6a", __COUNTER__); -DECL_CONSTANT_STR("BUS_PINS_spi6a", "PB3,PB4,PB5"); +DECL_CONSTANT_STR("BUS_PINS_spi6a", "PB4,PB5,PB3"); #endif @@ -78,7 +78,7 @@ static const struct spi_info spi_bus[] = { #endif #ifdef SPI6 { SPI6, GPIO('G', 12), GPIO('G', 14), GPIO('G', 13), GPIO_FUNCTION(5)}, - { SPI6, GPIO('B', 3), GPIO('B', 4), GPIO('B', 5), GPIO_FUNCTION(8)}, + { SPI6, GPIO('B', 4), GPIO('B', 5), GPIO('B', 3), GPIO_FUNCTION(8)}, #endif };