Add M4 example
Signed-off-by: Christophe Priouzeau <christophe.priouzeau@st.com>
This commit is contained in:
parent
b848fd8712
commit
02fce41bed
|
|
@ -0,0 +1,628 @@
|
|||
From 56696e74c6de23f39c56a3eb114dfca4534e0ae8 Mon Sep 17 00:00:00 2001
|
||||
From: christophe montaud <christophe.montaud@st.com>
|
||||
Date: Wed, 3 Oct 2018 17:23:23 +0200
|
||||
Subject: [PATCH] DTSO: align to new kernel delivery r3-rc4
|
||||
|
||||
DTBO: update pin config names
|
||||
DTBO: align to new kernel stm32mp157c-m4-srm.dtsi
|
||||
so
|
||||
DTBO: disable DMA at the end
|
||||
---
|
||||
.../stm32mp157-dk/M4ResourcesForAllExamples.dtso | 204 +++++++++---------
|
||||
.../stm32mp157-ev/M4ResourcesForAllExamples.dtso | 239 +++++++++++----------
|
||||
2 files changed, 234 insertions(+), 209 deletions(-)
|
||||
|
||||
diff --git a/Utilities/DTSO/stm32mp157-dk/M4ResourcesForAllExamples.dtso b/Utilities/DTSO/stm32mp157-dk/M4ResourcesForAllExamples.dtso
|
||||
index 9a0e508..c0c9dd7 100644
|
||||
--- a/Utilities/DTSO/stm32mp157-dk/M4ResourcesForAllExamples.dtso
|
||||
+++ b/Utilities/DTSO/stm32mp157-dk/M4ResourcesForAllExamples.dtso
|
||||
@@ -8,7 +8,7 @@
|
||||
compatible = "st,stm32mp157";
|
||||
|
||||
fragment@0 {
|
||||
- target = <&dma2>;
|
||||
+ target = <&dac>;
|
||||
|
||||
__overlay__ {
|
||||
status = "disabled";
|
||||
@@ -16,7 +16,7 @@
|
||||
};
|
||||
|
||||
fragment@1 {
|
||||
- target = <&dac>;
|
||||
+ target = <&adc>;
|
||||
|
||||
__overlay__ {
|
||||
status = "disabled";
|
||||
@@ -24,7 +24,7 @@
|
||||
};
|
||||
|
||||
fragment@2 {
|
||||
- target = <&adc>;
|
||||
+ target = <&timers1>;
|
||||
|
||||
__overlay__ {
|
||||
status = "disabled";
|
||||
@@ -32,7 +32,7 @@
|
||||
};
|
||||
|
||||
fragment@3 {
|
||||
- target = <&timers1>;
|
||||
+ target = <&dma2>;
|
||||
|
||||
__overlay__ {
|
||||
status = "disabled";
|
||||
@@ -44,7 +44,7 @@
|
||||
|
||||
__overlay__ {
|
||||
dma-masters = <&dma1>;
|
||||
- dma-channels = <8>;
|
||||
+ dma-channels = <8>;
|
||||
};
|
||||
};
|
||||
|
||||
@@ -55,120 +55,132 @@
|
||||
m4_system_resources {
|
||||
status = "okay";
|
||||
|
||||
- m4_crc2: crc@4c00400 {
|
||||
+ button {
|
||||
compatible = "rproc-srm-dev";
|
||||
- reg = <0x4c00400 0x400>;
|
||||
- clocks = <&rcc CRC2>;
|
||||
+ interrupt-parent = <&gpioa>;
|
||||
+ interrupts = <14 2>;
|
||||
+ interrupt-names = "irq";
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
- m4_cryp2: cryp@4c005000 {
|
||||
+ m4_led: m4_led {
|
||||
compatible = "rproc-srm-dev";
|
||||
- reg = <0x4c005000 0x400>;
|
||||
- clocks = <&rcc CRYP2>;
|
||||
+ pinctrl-names = "rproc_default", "rproc_sleep";
|
||||
+ pinctrl-0 = <&leds_orange_pins>;
|
||||
+ pinctrl-1 = <&leds_orange_sleep_pins>;
|
||||
status = "okay";
|
||||
};
|
||||
+ };
|
||||
+ };
|
||||
+ };
|
||||
|
||||
- m4_hash2: hash@4c002000 {
|
||||
- compatible = "rproc-srm-dev";
|
||||
- reg = <0x4c002000 0x400>;
|
||||
- clocks = <&rcc HASH2>;
|
||||
- status = "okay";
|
||||
- };
|
||||
+ fragment@6 {
|
||||
+ target = <&m4_crc2>;
|
||||
|
||||
- m4_rng2: rng@4c003000 {
|
||||
- compatible = "rproc-srm-dev";
|
||||
- reg = <0x4c003000 0x400>;
|
||||
- clocks = <&rcc RNG2_K>;
|
||||
- status = "okay";
|
||||
- };
|
||||
+ __overlay__ {
|
||||
+ status = "okay";
|
||||
+ };
|
||||
+ };
|
||||
|
||||
- m4_uart7: serial@40018000 {
|
||||
- compatible = "rproc-srm-dev";
|
||||
- reg = <0x40018000 0x400>;
|
||||
- clocks = <&rcc UART7_K>;
|
||||
- pinctrl-names = "default";
|
||||
- pinctrl-0 = <&uart7_pins>;
|
||||
- status = "okay";
|
||||
- };
|
||||
+ fragment@7 {
|
||||
+ target = <&m4_cryp2>;
|
||||
|
||||
- m4_spi4: spi@44005000 {
|
||||
- compatible = "rproc-srm-dev";
|
||||
- reg = <0x44005000 0x400>;
|
||||
- clocks = <&rcc SPI4_K>;
|
||||
- pinctrl-names = "default";
|
||||
- pinctrl-0 = <&spi4_pins_a>;
|
||||
- status = "okay";
|
||||
- };
|
||||
+ __overlay__ {
|
||||
+ status = "okay";
|
||||
+ };
|
||||
+ };
|
||||
|
||||
- m4_i2c5: i2c@40015000 {
|
||||
- compatible = "rproc-srm-dev";
|
||||
- reg = <0x40015000 0x400>;
|
||||
- clocks = <&rcc I2C5_K>;
|
||||
- pinctrl-names = "default";
|
||||
- pinctrl-0 = <&i2c5_pins_a>;
|
||||
- status = "okay";
|
||||
- };
|
||||
+ fragment@8 {
|
||||
+ target = <&m4_hash2>;
|
||||
|
||||
- m4_timers2: timer@40000000 {
|
||||
- compatible = "rproc-srm-dev";
|
||||
- reg = <0x40000000 0x400>;
|
||||
- clocks = <&rcc TIM2_K>;
|
||||
- status = "okay";
|
||||
- };
|
||||
+ __overlay__ {
|
||||
+ status = "okay";
|
||||
+ };
|
||||
+ };
|
||||
|
||||
- m4_timers1: timer@44000000 {
|
||||
- compatible = "rproc-srm-dev";
|
||||
- reg = <0x44000000 0x400>;
|
||||
- clocks = <&rcc TIM1_K>;
|
||||
- pinctrl-names = "default";
|
||||
- pinctrl-0 = <&timer1_pins>;
|
||||
- status = "okay";
|
||||
- };
|
||||
+ fragment@9 {
|
||||
+ target = <&m4_rng2>;
|
||||
|
||||
- m4_dac: dac@40017000 {
|
||||
- compatible = "rproc-srm-dev";
|
||||
- reg = <0x40017000 0x400>;
|
||||
- clocks = <&rcc DAC12>;
|
||||
- status = "okay";
|
||||
- };
|
||||
+ __overlay__ {
|
||||
+ status = "okay";
|
||||
+ };
|
||||
+ };
|
||||
|
||||
- m4_adc: adc@48003000 {
|
||||
- compatible = "rproc-srm-dev";
|
||||
- reg = <0x48003000 0x400>;
|
||||
- vref-supply = <&vrefbuf>;
|
||||
- clocks = <&rcc ADC12>, <&rcc ADC12_K>;
|
||||
- status = "okay";
|
||||
- };
|
||||
+ fragment@10 {
|
||||
+ target = <&m4_uart7>;
|
||||
|
||||
- m4_dma2: dma@48001000 {
|
||||
- compatible = "rproc-srm-dev";
|
||||
- reg = <0x48001000 0x400>;
|
||||
- clocks = <&rcc DMA2>;
|
||||
- status = "okay";
|
||||
- };
|
||||
+ __overlay__ {
|
||||
+ pinctrl-names = "rproc_default";
|
||||
+ pinctrl-0 = <&uart7_pins>;
|
||||
+ status = "okay";
|
||||
+ };
|
||||
+ };
|
||||
|
||||
- button {
|
||||
- compatible = "rproc-srm-dev";
|
||||
- interrupt-parent = <&gpioa>;
|
||||
- interrupts = <14 2>;
|
||||
- interrupt-names = "irq";
|
||||
- status = "okay";
|
||||
- };
|
||||
+ fragment@11 {
|
||||
+ target = <&m4_spi4>;
|
||||
|
||||
- m4_led: m4_led {
|
||||
- compatible = "rproc-srm-dev";
|
||||
- pinctrl-names = "default", "sleep";
|
||||
- pinctrl-0 = <&leds_orange_pins>;
|
||||
- pinctrl-1 = <&leds_orange_sleep_pins>;
|
||||
- status = "okay";
|
||||
- };
|
||||
- };
|
||||
+ __overlay__ {
|
||||
+ pinctrl-names = "rproc_default";
|
||||
+ pinctrl-0 = <&spi4_pins_a>;
|
||||
+ status = "okay";
|
||||
};
|
||||
};
|
||||
|
||||
+ fragment@12 {
|
||||
+ target = <&m4_i2c5>;
|
||||
|
||||
- fragment@6 {
|
||||
+ __overlay__ {
|
||||
+ pinctrl-names = "rproc_default";
|
||||
+ pinctrl-0 = <&i2c5_pins_a>;
|
||||
+ status = "okay";
|
||||
+ };
|
||||
+ };
|
||||
+
|
||||
+ fragment@13 {
|
||||
+ target = <&m4_timers2>;
|
||||
+
|
||||
+ __overlay__ {
|
||||
+ pinctrl-names = "rproc_default";
|
||||
+ status = "okay";
|
||||
+ };
|
||||
+ };
|
||||
+
|
||||
+ fragment@14 {
|
||||
+ target = <&m4_timers1>;
|
||||
+
|
||||
+ __overlay__ {
|
||||
+ pinctrl-names = "rproc_default";
|
||||
+ pinctrl-0 = <&timer1_pins>;
|
||||
+ status = "okay";
|
||||
+ };
|
||||
+ };
|
||||
+
|
||||
+ fragment@15 {
|
||||
+ target = <&m4_dac>;
|
||||
+
|
||||
+ __overlay__ {
|
||||
+ status = "okay";
|
||||
+ };
|
||||
+ };
|
||||
+
|
||||
+ fragment@16 {
|
||||
+ target = <&m4_adc>;
|
||||
+
|
||||
+ __overlay__ {
|
||||
+ vref-supply = <&vrefbuf>;
|
||||
+ status = "okay";
|
||||
+ };
|
||||
+ };
|
||||
+
|
||||
+ fragment@17 {
|
||||
+ target = <&m4_dma2>;
|
||||
+
|
||||
+ __overlay__ {
|
||||
+ status = "okay";
|
||||
+ };
|
||||
+ };
|
||||
+
|
||||
+ fragment@18 {
|
||||
target = <&pinctrl>;
|
||||
__overlay__ {
|
||||
|
||||
diff --git a/Utilities/DTSO/stm32mp157-ev/M4ResourcesForAllExamples.dtso b/Utilities/DTSO/stm32mp157-ev/M4ResourcesForAllExamples.dtso
|
||||
index 37e73d1..84cf399 100644
|
||||
--- a/Utilities/DTSO/stm32mp157-ev/M4ResourcesForAllExamples.dtso
|
||||
+++ b/Utilities/DTSO/stm32mp157-ev/M4ResourcesForAllExamples.dtso
|
||||
@@ -8,7 +8,7 @@
|
||||
compatible = "st,stm32mp157";
|
||||
|
||||
fragment@0 {
|
||||
- target = <&dma2>;
|
||||
+ target = <&dac>;
|
||||
|
||||
__overlay__ {
|
||||
status = "disabled";
|
||||
@@ -16,7 +16,7 @@
|
||||
};
|
||||
|
||||
fragment@1 {
|
||||
- target = <&dac>;
|
||||
+ target = <&adc>;
|
||||
|
||||
__overlay__ {
|
||||
status = "disabled";
|
||||
@@ -24,7 +24,7 @@
|
||||
};
|
||||
|
||||
fragment@2 {
|
||||
- target = <&adc>;
|
||||
+ target = <&timers2>;
|
||||
|
||||
__overlay__ {
|
||||
status = "disabled";
|
||||
@@ -32,7 +32,7 @@
|
||||
};
|
||||
|
||||
fragment@3 {
|
||||
- target = <&timers2>;
|
||||
+ target = <&sai2b>;
|
||||
|
||||
__overlay__ {
|
||||
status = "disabled";
|
||||
@@ -40,7 +40,7 @@
|
||||
};
|
||||
|
||||
fragment@4 {
|
||||
- target = <&sai2b>;
|
||||
+ target = <&fmc2_nand>;
|
||||
|
||||
__overlay__ {
|
||||
status = "disabled";
|
||||
@@ -48,7 +48,7 @@
|
||||
};
|
||||
|
||||
fragment@5 {
|
||||
- target = <&fmc2_nand>;
|
||||
+ target = <&i2c5>;
|
||||
|
||||
__overlay__ {
|
||||
status = "disabled";
|
||||
@@ -56,16 +56,15 @@
|
||||
};
|
||||
|
||||
fragment@6 {
|
||||
- target = <&dmamux1>;
|
||||
+ target = <&qspi>;
|
||||
|
||||
__overlay__ {
|
||||
- dma-masters = <&dma1>;
|
||||
- dma-channels = <8>;
|
||||
+ status = "disabled";
|
||||
};
|
||||
};
|
||||
|
||||
fragment@7 {
|
||||
- target = <&i2c5>;
|
||||
+ target = <&dma2>;
|
||||
|
||||
__overlay__ {
|
||||
status = "disabled";
|
||||
@@ -73,10 +72,11 @@
|
||||
};
|
||||
|
||||
fragment@8 {
|
||||
- target = <&qspi>;
|
||||
+ target = <&dmamux1>;
|
||||
|
||||
__overlay__ {
|
||||
- status = "disabled";
|
||||
+ dma-masters = <&dma1>;
|
||||
+ dma-channels = <8>;
|
||||
};
|
||||
};
|
||||
|
||||
@@ -87,131 +87,144 @@
|
||||
m4_system_resources {
|
||||
status = "okay";
|
||||
|
||||
- m4_crc2: crc@4c00400 {
|
||||
+
|
||||
+ button {
|
||||
compatible = "rproc-srm-dev";
|
||||
- reg = <0x4c00400 0x400>;
|
||||
- clocks = <&rcc CRC2>;
|
||||
+ interrupt-parent = <&gpioa>;
|
||||
+ interrupts = <14 2>;
|
||||
+ interrupt-names = "irq";
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
- m4_cryp2: cryp@4c005000 {
|
||||
+ m4_led: m4_led {
|
||||
compatible = "rproc-srm-dev";
|
||||
- reg = <0x4c005000 0x400>;
|
||||
- clocks = <&rcc CRYP2>;
|
||||
+ pinctrl-names = "rproc_default", "rproc_sleep";
|
||||
+ pinctrl-0 = <&leds_orange_pins>;
|
||||
+ pinctrl-1 = <&leds_orange_sleep_pins>;
|
||||
status = "okay";
|
||||
};
|
||||
+ };
|
||||
+ };
|
||||
+ };
|
||||
|
||||
- m4_hash2: hash@4c002000 {
|
||||
- compatible = "rproc-srm-dev";
|
||||
- reg = <0x4c002000 0x400>;
|
||||
- clocks = <&rcc HASH2>;
|
||||
- status = "okay";
|
||||
- };
|
||||
+ fragment@10 {
|
||||
+ target = <&m4_crc2>;
|
||||
|
||||
- m4_rng2: rng@4c003000 {
|
||||
- compatible = "rproc-srm-dev";
|
||||
- reg = <0x4c003000 0x400>;
|
||||
- clocks = <&rcc RNG2_K>;
|
||||
- status = "okay";
|
||||
- };
|
||||
+ __overlay__ {
|
||||
+ status = "okay";
|
||||
+ };
|
||||
+ };
|
||||
|
||||
- m4_usart3: serial@4000f000 {
|
||||
- compatible = "rproc-srm-dev";
|
||||
- reg = <0x4000f000 0x400>;
|
||||
- clocks = <&rcc USART3_K>;
|
||||
- pinctrl-names = "default";
|
||||
- pinctrl-0 = <&usart3_pins_a>;
|
||||
- status = "okay";
|
||||
- };
|
||||
+ fragment@11 {
|
||||
+ target = <&m4_cryp2>;
|
||||
|
||||
- m4_spi1: spi@44004000 {
|
||||
- compatible = "rproc-srm-dev";
|
||||
- reg = <0x44004000 0x400>;
|
||||
- clocks = <&rcc SPI1_K>;
|
||||
- pinctrl-names = "default";
|
||||
- pinctrl-0 = <&spi1_pins_a>;
|
||||
- status = "okay";
|
||||
- };
|
||||
+ __overlay__ {
|
||||
+ status = "okay";
|
||||
+ };
|
||||
+ };
|
||||
|
||||
- m4_i2c5: i2c@40015000 {
|
||||
- compatible = "rproc-srm-dev";
|
||||
- reg = <0x40015000 0x400>;
|
||||
- clocks = <&rcc I2C5_K>;
|
||||
- pinctrl-names = "default";
|
||||
- pinctrl-0 = <&i2c5_pins_a>;
|
||||
- status = "okay";
|
||||
- };
|
||||
+ fragment@12 {
|
||||
+ target = <&m4_hash2>;
|
||||
|
||||
- m4_timers2: timer@40000000 {
|
||||
- compatible = "rproc-srm-dev";
|
||||
- reg = <0x40000000 0x400>;
|
||||
- pinctrl-names = "default";
|
||||
- pinctrl-0 = <&pwm2_pins_a>;
|
||||
- clocks = <&rcc TIM2_K>;
|
||||
- status = "okay";
|
||||
- };
|
||||
+ __overlay__ {
|
||||
+ status = "okay";
|
||||
+ };
|
||||
+ };
|
||||
|
||||
- m4_timers1: timer@44000000 {
|
||||
- compatible = "rproc-srm-dev";
|
||||
- reg = <0x44000000 0x400>;
|
||||
- clocks = <&rcc TIM1_K>;
|
||||
- pinctrl-names = "default";
|
||||
- pinctrl-0 = <&pwm1_pins_a>;
|
||||
- status = "okay";
|
||||
- };
|
||||
+ fragment@13 {
|
||||
+ target = <&m4_rng2>;
|
||||
|
||||
- m4_dac: dac@40017000 {
|
||||
- compatible = "rproc-srm-dev";
|
||||
- reg = <0x40017000 0x400>;
|
||||
- clocks = <&rcc DAC12>;
|
||||
- status = "okay";
|
||||
- };
|
||||
+ __overlay__ {
|
||||
+ status = "okay";
|
||||
+ };
|
||||
+ };
|
||||
|
||||
- m4_adc: adc@48003000 {
|
||||
- compatible = "rproc-srm-dev";
|
||||
- reg = <0x48003000 0x400>;
|
||||
- vref-supply = <&vdda>;
|
||||
- clocks = <&rcc ADC12>, <&rcc ADC12_K>;
|
||||
- status = "okay";
|
||||
- };
|
||||
+ fragment@14 {
|
||||
+ target = <&m4_usart3>;
|
||||
|
||||
- m4_dma2: dma@48001000 {
|
||||
- compatible = "rproc-srm-dev";
|
||||
- reg = <0x48001000 0x400>;
|
||||
- clocks = <&rcc DMA2>;
|
||||
- status = "okay";
|
||||
- };
|
||||
+ __overlay__ {
|
||||
+ pinctrl-names = "rproc_default";
|
||||
+ pinctrl-0 = <&usart3_pins_a>;
|
||||
+ status = "okay";
|
||||
+ };
|
||||
+ };
|
||||
|
||||
- m4_qspi: qspi@58003000 {
|
||||
- compatible = "rproc-srm-dev";
|
||||
- reg = <0x58003000 0x1000>;
|
||||
- pinctrl-names = "default";
|
||||
- pinctrl-0 = <&qspi_clk_pins_a &qspi_bk1_pins_a &qspi_bk2_pins_a>;
|
||||
- clocks = <&rcc QSPI_K>;
|
||||
- status = "okay";
|
||||
- };
|
||||
+ fragment@15 {
|
||||
+ target = <&m4_spi1>;
|
||||
|
||||
- button {
|
||||
- compatible = "rproc-srm-dev";
|
||||
- interrupt-parent = <&gpioa>;
|
||||
- interrupts = <14 2>;
|
||||
- interrupt-names = "irq";
|
||||
- status = "okay";
|
||||
- };
|
||||
+ __overlay__ {
|
||||
+ pinctrl-names = "rproc_default";
|
||||
+ pinctrl-0 = <&spi1_pins_a>;
|
||||
+ status = "okay";
|
||||
+ };
|
||||
+ };
|
||||
|
||||
- m4_led: m4_led {
|
||||
- compatible = "rproc-srm-dev";
|
||||
- pinctrl-names = "default", "sleep";
|
||||
- pinctrl-0 = <&leds_orange_pins>;
|
||||
- pinctrl-1 = <&leds_orange_sleep_pins>;
|
||||
- status = "okay";
|
||||
- };
|
||||
- };
|
||||
+ fragment@16 {
|
||||
+ target = <&m4_i2c5>;
|
||||
+
|
||||
+ __overlay__ {
|
||||
+ pinctrl-names = "rproc_default";
|
||||
+ pinctrl-0 = <&i2c5_pins_a>;
|
||||
+ status = "okay";
|
||||
};
|
||||
};
|
||||
|
||||
+ fragment@17 {
|
||||
+ target = <&m4_timers2>;
|
||||
|
||||
- fragment@10 {
|
||||
+ __overlay__ {
|
||||
+ pinctrl-names = "rproc_default";
|
||||
+ pinctrl-0 = <&pwm2_pins_a>;
|
||||
+ status = "okay";
|
||||
+ };
|
||||
+ };
|
||||
+
|
||||
+ fragment@18 {
|
||||
+ target = <&m4_timers1>;
|
||||
+
|
||||
+ __overlay__ {
|
||||
+ pinctrl-names = "rproc_default";
|
||||
+ pinctrl-0 = <&pwm1_pins_a>;
|
||||
+ status = "okay";
|
||||
+ };
|
||||
+ };
|
||||
+
|
||||
+ fragment@19 {
|
||||
+ target = <&m4_dac>;
|
||||
+
|
||||
+ __overlay__ {
|
||||
+ status = "okay";
|
||||
+ };
|
||||
+ };
|
||||
+
|
||||
+ fragment@20 {
|
||||
+ target = <&m4_adc>;
|
||||
+
|
||||
+ __overlay__ {
|
||||
+ vref-supply = <&vdda>;
|
||||
+ status = "okay";
|
||||
+ };
|
||||
+ };
|
||||
+
|
||||
+ fragment@21 {
|
||||
+ target = <&m4_dma2>;
|
||||
+
|
||||
+ __overlay__ {
|
||||
+ status = "okay";
|
||||
+ };
|
||||
+ };
|
||||
+
|
||||
+ fragment@22 {
|
||||
+ target = <&m4_qspi>;
|
||||
+
|
||||
+ __overlay__ {
|
||||
+ pinctrl-names = "rproc_default";
|
||||
+ pinctrl-0 = <&qspi_clk_pins_a &qspi_bk1_pins_a &qspi_bk2_pins_a>;
|
||||
+ status = "okay";
|
||||
+ };
|
||||
+ };
|
||||
+
|
||||
+ fragment@23 {
|
||||
target = <&pinctrl>;
|
||||
__overlay__ {
|
||||
|
||||
--
|
||||
2.7.4
|
||||
|
||||
|
|
@ -0,0 +1,82 @@
|
|||
CC := $(CROSS_COMPILE)gcc
|
||||
LD := $(CROSS_COMPILE)ld
|
||||
AS := $(CROSS_COMPILE)ar
|
||||
STRIP := $(CROSS_COMPILE)strip
|
||||
OBJCOPY := $(CROSS_COMPILE)objcopy
|
||||
SIZE := $(CROSS_COMPILE)size
|
||||
|
||||
ifeq ($(CPU_TYPE),M4)
|
||||
COMMONFLAGS += -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16
|
||||
endif
|
||||
ifeq ($(CPU_TYPE),A7)
|
||||
COMMONFLAGS += -mcpu=cortex-a7 -mthumb -mfloat-abi=hard -mfpu=neon-vfpv4
|
||||
endif
|
||||
|
||||
# Project settings
|
||||
PROJ_DIR := $(PROJECT_DIR)
|
||||
PROJ_NAME := $(BIN_NAME)
|
||||
|
||||
# Output
|
||||
OUT := $(PROJ_DIR)/out
|
||||
BUILD_OUT := $(OUT)/$(BUILD_CONFIG)
|
||||
|
||||
# Bin
|
||||
TESTELF := $(BUILD_OUT)/$(PROJ_NAME).elf
|
||||
TESTBIN := $(BUILD_OUT)/$(PROJ_NAME).bin
|
||||
|
||||
# CFLAGS rules
|
||||
CFLAGS += $(COMMONFLAGS)
|
||||
CFLAGS += -Os
|
||||
CFLAGS += -Wall -fmessage-length=0 -ffunction-sections -c -fmessage-length=0 -MMD -MP
|
||||
#CFLAGS += -Wno-unused-function
|
||||
#CFLAGS += -Wno-unused-variable
|
||||
CFLAGS += -g3
|
||||
#CFLAGS += -g
|
||||
#CFLAGS += -Werror
|
||||
|
||||
# LDFLAGS rules
|
||||
LDFLAGS += $(COMMONFLAGS)
|
||||
LDFLAGS += -specs=nosys.specs -specs=nano.specs
|
||||
LDFLAGS += -Wl,-Map=$(BUILD_OUT)/output.map -Wl,--gc-sections -lm
|
||||
#LDFLAGS += -D__MEM_START__=0x2ffc2000 -D__MEM_END__=0x2fff3000 -D__MEM_SIZE__=0x31000
|
||||
#debug LINKER
|
||||
#LDFLAGS += -Wl,--verbose
|
||||
|
||||
|
||||
# Get config code from the project to compile (source, cflags, ldflags, ldlibs)
|
||||
include $(BUILD_OUT)/conf/config.in
|
||||
|
||||
# Build rule
|
||||
define c-compilation-rule
|
||||
$1: $2 $(LDSCRIPT)
|
||||
@echo $2 \< $1
|
||||
@mkdir -pv `dirname $1`
|
||||
$(CC) $(CFLAGS) -c $2 -o $1
|
||||
COBJ+=$1
|
||||
endef
|
||||
|
||||
# generate a compilation rule for each source file
|
||||
$(foreach r,$(CSRC), $(eval $(call c-compilation-rule,$(BUILD_OUT)/$(r).o,$(r))))
|
||||
|
||||
# Include dep files
|
||||
#DEPS= $(foreach file,$(CSRC),$(file).d)
|
||||
#-include $(DEPS)
|
||||
|
||||
# Build elf output
|
||||
$(TESTELF): $(COBJ)
|
||||
@echo link $@
|
||||
$(CC) $(LDFLAGS) -o $@.sym $^ $(LDLIBS) -T$(LDSCRIPT)
|
||||
@cp $@.sym $@
|
||||
@$(STRIP) -g $@
|
||||
@$(SIZE) $@
|
||||
|
||||
# Build bin output
|
||||
$(TESTBIN): $(TESTELF)
|
||||
@$(OBJCOPY) -O binary $(TESTELF) $(TESTBIN)
|
||||
|
||||
clean:
|
||||
rm -rf $(COBJ) $(TESTELF) $(TESTBIN)
|
||||
|
||||
all: $(TESTBIN)
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,179 @@
|
|||
import os
|
||||
import sys
|
||||
import xml.etree.ElementTree as ET
|
||||
from sys import argv as arg
|
||||
|
||||
#
|
||||
# the goal is to parse SW4STM32 project configs files to get
|
||||
# list of files to compile
|
||||
# cflags
|
||||
# ldflags
|
||||
|
||||
|
||||
print "start"
|
||||
|
||||
# arg1: path of the project
|
||||
prj=arg[1]
|
||||
# arg2: name of the build configuration
|
||||
buildconfig=arg[2]
|
||||
# arg3: root of the compilation
|
||||
myroot=arg[3]
|
||||
|
||||
confdir=myroot+"/out/"+buildconfig+"/conf"
|
||||
|
||||
print "prj: "+prj
|
||||
print "myroot: "+myroot
|
||||
print "confdir: "+confdir
|
||||
print "buildconfig: "+buildconfig
|
||||
|
||||
os.chdir(prj)
|
||||
|
||||
proj_tree = ET.parse(".project")
|
||||
cproj_tree = ET.parse(".cproject")
|
||||
|
||||
#os.chdir(myroot)
|
||||
|
||||
if os.path.exists(confdir)!=True:
|
||||
os.mkdir(confdir)
|
||||
|
||||
if prj.find("(")!=-1:
|
||||
print "bad prj path"
|
||||
sys.stderr.write("bad prj path: "+prj+"\n")
|
||||
exit(1)
|
||||
|
||||
#
|
||||
# convert path and checks that path is valid
|
||||
#
|
||||
def fullpath(filename):
|
||||
# get absolute path
|
||||
p=os.path.abspath(filename);
|
||||
|
||||
# workaround: there is a mistake in some projects
|
||||
p=p.replace("STM32_USB_HOST_Library","STM32_USB_Host_Library")
|
||||
# some path contain windows style
|
||||
p=p.replace("\\","/")
|
||||
# containts space at the end
|
||||
p=p.replace(" ","")
|
||||
|
||||
# check if path is valid
|
||||
#print "check path: "+p
|
||||
if os.path.exists(p)!=True:
|
||||
print "prj: "+prj
|
||||
print "original path: "+filename
|
||||
sys.stderr.write("error check path: "+p+" fails\n")
|
||||
exit(1);
|
||||
|
||||
return p
|
||||
|
||||
|
||||
#
|
||||
# get the source code file list
|
||||
#
|
||||
print "file list"
|
||||
|
||||
f=open(confdir+"/config.in", 'w')
|
||||
|
||||
root = proj_tree.getroot()
|
||||
|
||||
f.write("CSRC += \\\n")
|
||||
|
||||
|
||||
for i in root.iter('link'):
|
||||
a=i.find('locationURI')
|
||||
if a==None:
|
||||
a=i.find('location')
|
||||
if a==None:
|
||||
print "could not find any file"
|
||||
exit(1)
|
||||
|
||||
if a.text is None:
|
||||
print "no text"
|
||||
else:
|
||||
#print "text:"+a.text
|
||||
temp=a.text
|
||||
|
||||
if ((temp.find(".txt")==-1) & (temp.find(".gdb")==-1) & (temp.find(".launch")==-1) & (temp.find(".sh")==-1) & (temp.find("README")==-1)):
|
||||
temp=temp.replace("PARENT-1-PROJECT_LOC/", "../")
|
||||
temp=temp.replace("PARENT-2-PROJECT_LOC/", "../../")
|
||||
temp=temp.replace("PARENT-3-PROJECT_LOC/", "../../../")
|
||||
temp=temp.replace("PARENT-4-PROJECT_LOC/", "../../../../")
|
||||
temp=temp.replace("PARENT-5-PROJECT_LOC/", "../../../../../")
|
||||
temp=temp.replace("PARENT-6-PROJECT_LOC/", "../../../../../../")
|
||||
temp=temp.replace("PARENT-7-PROJECT_LOC/", "../../../../../../../")
|
||||
temp=temp.replace("PROJECT_LOC/", "../")
|
||||
|
||||
#print temp
|
||||
temp=fullpath(temp)
|
||||
|
||||
f.write(temp+" \\\n")
|
||||
|
||||
f.write("\n")
|
||||
|
||||
|
||||
cflags=""
|
||||
ldlibs=""
|
||||
ldscript=""
|
||||
|
||||
root = cproj_tree.getroot()
|
||||
|
||||
count=0
|
||||
for j in root.iter('configuration'):
|
||||
temp=j.get('name')
|
||||
if temp == buildconfig:
|
||||
for i in j.iter('option'):
|
||||
a=i.get('superClass')
|
||||
if a == 'gnu.c.compiler.option.include.paths':
|
||||
for j in i.iter('listOptionValue'):
|
||||
temp=j.get('value')
|
||||
if temp != "":
|
||||
temp=temp.replace("\\","/")
|
||||
#workaround remove first occurency of "../"
|
||||
temp=temp.replace("../", "",1)
|
||||
temp=fullpath(temp)
|
||||
#print temp
|
||||
cflags=cflags+" -I"+temp+" \\\n"
|
||||
|
||||
if a == 'gnu.c.compiler.option.preprocessor.def.symbols':
|
||||
for j in i.iter('listOptionValue'):
|
||||
temp=j.get('value')
|
||||
if temp != "":
|
||||
#print temp
|
||||
cflags=cflags+" -D"+temp+" \\\n"
|
||||
|
||||
if a == 'fr.ac6.managedbuild.tool.gnu.cross.c.linker.script':
|
||||
temp=i.get('value')
|
||||
temp=temp.replace("../", "",1)
|
||||
temp=fullpath(temp)
|
||||
#print temp
|
||||
ldscript=temp
|
||||
|
||||
if a == 'gnu.c.link.option.paths':
|
||||
for j in i.iter('listOptionValue'):
|
||||
temp=j.get('value')
|
||||
temp=temp.replace("../", "",1)
|
||||
temp=fullpath(temp)
|
||||
ldlibs=ldlibs+" -L"+temp+"/"
|
||||
|
||||
if a == 'gnu.c.link.option.libs':
|
||||
for j in i.iter('listOptionValue'):
|
||||
temp=j.get('value')
|
||||
ldlibs=ldlibs+" -l"+temp
|
||||
|
||||
|
||||
#workaround for STM327x6G_EVAL
|
||||
#cflags=cflags+" -DUSE_IOEXPANDER"
|
||||
|
||||
print "cflags="+cflags
|
||||
f.write("CFLAGS += "+cflags+"\n")
|
||||
f.write("\n")
|
||||
|
||||
print "ldlibs="+ldlibs
|
||||
f.write("LDLIBS += "+ldlibs+"\n")
|
||||
f.write("\n")
|
||||
|
||||
f.write("LDSCRIPT += "+ldscript+"\n")
|
||||
f.write("\n")
|
||||
|
||||
f.close();
|
||||
|
||||
print "exit"
|
||||
|
|
@ -0,0 +1,75 @@
|
|||
#!/bin/sh -
|
||||
|
||||
autodetect_board() {
|
||||
if [ ! -d /proc/device-tree/ ];
|
||||
then
|
||||
echo "Proc Device tree are not available, Could not detect on which board we are" > /dev/kmsg
|
||||
exit 1
|
||||
fi
|
||||
|
||||
#search on device tree compatible entry the board type
|
||||
if $(grep -q "stm32mp157c-ev" /proc/device-tree/compatible) ;
|
||||
then
|
||||
board="STM32MP15_M4_EVAL"
|
||||
else if $(grep -q "stm32mp157c-dk" /proc/device-tree/compatible) ;
|
||||
then
|
||||
board="STM32MP15_M4_DISCO"
|
||||
else
|
||||
echo "Board is not an EVAL or a DISCO BOARD" > /dev/kmsg
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
copy_default_M4_fw() {
|
||||
#Test if ${board}_@default_fw@.elf is existing
|
||||
if [ -z "$(find @userfs_mount_point@/examples/* -name ${board}_@default_fw@.elf)" ]; then
|
||||
echo "The default copro example ${board}_@default_fw@ doesn't exist" > /dev/kmsg
|
||||
exit 1
|
||||
else
|
||||
#copy ${board}_@default_fw@.elf into /lib/firmware/
|
||||
cp $(find @userfs_mount_point@/examples/* -name ${board}_@default_fw@.elf) /lib/firmware/.
|
||||
fi
|
||||
}
|
||||
|
||||
firmware_load_start() {
|
||||
# Change the name of the firmware
|
||||
echo -n ${board}_@default_fw@.elf > /sys/class/remoteproc/remoteproc0/firmware
|
||||
|
||||
# Change path to found firmware
|
||||
#echo -n /home/root >/sys/module/firmware_class/parameters/path
|
||||
|
||||
# Restart firmware
|
||||
echo start >/sys/class/remoteproc/remoteproc0/state
|
||||
|
||||
echo "Booting fw image ${board}_@default_fw@.elf" > /dev/kmsg
|
||||
}
|
||||
|
||||
firmware_load_stop() {
|
||||
# Stop the firmware
|
||||
echo stop >/sys/class/remoteproc/remoteproc0/state
|
||||
echo "Stoping fw image ${board}_@default_fw@.elf" > /dev/kmsg
|
||||
}
|
||||
|
||||
board=""
|
||||
autodetect_board
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
copy_default_M4_fw
|
||||
firmware_load_stop
|
||||
firmware_load_start
|
||||
;;
|
||||
stop)
|
||||
firmware_load_stop
|
||||
;;
|
||||
restart)
|
||||
firmware_load_stop
|
||||
firmware_load_start
|
||||
;;
|
||||
*)
|
||||
echo "HELP: $0 [start|stop|restart]"
|
||||
;;
|
||||
esac
|
||||
|
||||
exit 0
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
[Unit]
|
||||
Description=ST Load M4 firmware via remoteproc
|
||||
After=systemd-modules-load.service
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
RemainAfterExit=yes
|
||||
ExecStart=/sbin/st-m4firmware-load-default.sh start
|
||||
|
||||
[Install]
|
||||
WantedBy=sysinit.target
|
||||
|
|
@ -0,0 +1,55 @@
|
|||
SUMMARY = "STM32MP1 Firmware examples for CM4"
|
||||
LICENSE = "Proprietary"
|
||||
|
||||
PROJECTS_LIST_EV1 = " \
|
||||
'STM32MP157C-EV1/Examples/ADC/ADC_SingleConversion_TriggerTimer_DMA' \
|
||||
'STM32MP157C-EV1/Examples/Cortex/CORTEXM_MPU' \
|
||||
'STM32MP157C-EV1/Examples/CRC/CRC_UserDefinedPolynomial' \
|
||||
'STM32MP157C-EV1/Examples/CRYP/CRYP_AES_DMA' \
|
||||
'STM32MP157C-EV1/Examples/DAC/DAC_SimpleConversion' \
|
||||
'STM32MP157C-EV1/Examples/DMA/DMA_FIFOMode' \
|
||||
'STM32MP157C-EV1/Examples/GPIO/GPIO_EXTI' \
|
||||
'STM32MP157C-EV1/Examples/HASH/HASH_SHA224SHA256_DMA' \
|
||||
'STM32MP157C-EV1/Examples/I2C/I2C_TwoBoards_ComDMA' \
|
||||
'STM32MP157C-EV1/Examples/I2C/I2C_TwoBoards_ComIT' \
|
||||
'STM32MP157C-EV1/Examples/QSPI/QSPI_ReadWrite_IT' \
|
||||
'STM32MP157C-EV1/Examples/SPI/SPI_FullDuplex_ComDMA_Master' \
|
||||
'STM32MP157C-EV1/Examples/SPI/SPI_FullDuplex_ComDMA_Slave' \
|
||||
'STM32MP157C-EV1/Examples/TIM/TIM_DMABurst' \
|
||||
'STM32MP157C-EV1/Examples/UART/UART_TwoBoards_ComIT' \
|
||||
'STM32MP157C-EV1/Examples/WWDG/WWDG_Example' \
|
||||
'STM32MP157C-EV1/Applications/OpenAMP/OpenAMP_raw' \
|
||||
'STM32MP157C-EV1/Applications/OpenAMP/OpenAMP_TTY_echo' \
|
||||
'STM32MP157C-EV1/Applications/OpenAMP/OpenAMP_TTY_echo_wakeup' \
|
||||
'STM32MP157C-EV1/Applications/FreeRTOS/FreeRTOS_ThreadCreation' \
|
||||
'STM32MP157C-EV1/Applications/CoproSync/CoproSync_ShutDown' \
|
||||
'STM32MP157C-EV1/Demonstrations/AI_Character_Recognition' \
|
||||
"
|
||||
PROJECTS_LIST_DK2 = " \
|
||||
'STM32MP157C-DK2/Examples/ADC/ADC_SingleConversion_TriggerTimer_DMA' \
|
||||
'STM32MP157C-DK2/Examples/Cortex/CORTEXM_MPU' \
|
||||
'STM32MP157C-DK2/Examples/CRC/CRC_UserDefinedPolynomial' \
|
||||
'STM32MP157C-DK2/Examples/CRYP/CRYP_AES_DMA' \
|
||||
'STM32MP157C-DK2/Examples/DMA/DMA_FIFOMode' \
|
||||
'STM32MP157C-DK2/Examples/GPIO/GPIO_EXTI' \
|
||||
'STM32MP157C-DK2/Examples/HASH/HASH_SHA224SHA256_DMA' \
|
||||
'STM32MP157C-DK2/Examples/I2C/I2C_TwoBoards_ComIT' \
|
||||
'STM32MP157C-DK2/Examples/LPTIM/LPTIM_PulseCounter' \
|
||||
'STM32MP157C-DK2/Examples/SPI/SPI_FullDuplex_ComDMA_Master' \
|
||||
'STM32MP157C-DK2/Examples/SPI/SPI_FullDuplex_ComDMA_Slave' \
|
||||
'STM32MP157C-DK2/Examples/SPI/SPI_FullDuplex_ComIT_Master' \
|
||||
'STM32MP157C-DK2/Examples/SPI/SPI_FullDuplex_ComIT_Slave' \
|
||||
'STM32MP157C-DK2/Examples/TIM/TIM_DMABurst' \
|
||||
'STM32MP157C-DK2/Examples/UART/UART_TwoBoards_ComDMA' \
|
||||
'STM32MP157C-DK2/Examples/UART/UART_TwoBoards_ComIT' \
|
||||
'STM32MP157C-DK2/Examples/WWDG/WWDG_Example' \
|
||||
'STM32MP157C-DK2/Applications/OpenAMP/OpenAMP_raw' \
|
||||
'STM32MP157C-DK2/Applications/OpenAMP/OpenAMP_TTY_echo' \
|
||||
'STM32MP157C-DK2/Applications/OpenAMP/OpenAMP_TTY_echo_wakeup' \
|
||||
'STM32MP157C-DK2/Applications/FreeRTOS/FreeRTOS_ThreadCreation' \
|
||||
'STM32MP157C-DK2/Demonstrations/AI_Character_Recognition' \
|
||||
"
|
||||
|
||||
PROJECTS_LIST = "${PROJECTS_LIST_EV1} ${PROJECTS_LIST_DK2}"
|
||||
|
||||
require m4projects.inc
|
||||
|
|
@ -0,0 +1,161 @@
|
|||
SUMMARY = "STM32MP1 Firmware examples for CM4"
|
||||
LICENSE = " \
|
||||
Apache-2.0 \
|
||||
& MIT \
|
||||
& BSD-3-Clause \
|
||||
"
|
||||
LIC_FILES_CHKSUM = "file://License.md;md5=6b267c73760fea024ffbc6049db473ba"
|
||||
|
||||
COMPATIBLE_MACHINE = "(stm32mpcommon)"
|
||||
|
||||
PACKAGE_ARCH = "${MACHINE_ARCH}"
|
||||
|
||||
SRC_URI = "git://github.com/STMicroelectronics/STM32CubeMP1;protocol=https;branch=master"
|
||||
SRCREV = "66ec26f6422283fe5cd25a32babf925836df9399"
|
||||
|
||||
PV = "1.0.0"
|
||||
|
||||
S = "${WORKDIR}/git"
|
||||
|
||||
B = "${WORKDIR}/build"
|
||||
# for external source support with devtools
|
||||
EXTERNALSRC_BUILD_pn-${PN} = "${WORKDIR}/build"
|
||||
|
||||
# M4 firwmare build file
|
||||
SRC_URI += "file://Makefile.stm32"
|
||||
SRC_URI += "file://parse_project_config.py"
|
||||
|
||||
# default service for systemd
|
||||
inherit systemd update-rc.d
|
||||
SRC_URI += "file://st-m4firmware-load-default.sh"
|
||||
SRC_URI += "file://st-m4firmware-load.service"
|
||||
|
||||
DEPENDS += " gcc-arm-none-eabi-native "
|
||||
|
||||
# Define default board reference for M4
|
||||
M4_BOARDS ?= "STM32MP157C-EV1 STM32MP157C-DK2"
|
||||
|
||||
# Init default copro example to load/execute
|
||||
DEFAULT_COPRO_FIRMWARE ?= ""
|
||||
|
||||
# Use gcc bare toolchain
|
||||
export CROSS_COMPILE = "${RECIPE_SYSROOT_NATIVE}/${datadir}/gcc-arm-none-eabi/bin/arm-none-eabi-"
|
||||
export CPU_TYPE = "M4"
|
||||
export BUILD_CONFIG = "Debug"
|
||||
|
||||
RDEPENDS_${PN}-userfs += "busybox"
|
||||
PACKAGES += "${PN}-userfs"
|
||||
|
||||
USERFS_ROOTPATH = "/local/Cube-M4-examples"
|
||||
FILES_${PN}-userfs = "${prefix}${USERFS_ROOTPATH}"
|
||||
|
||||
do_compile() {
|
||||
# Compile M4 firmwares listed in bb file. They can be for eval or disco board as specified in bb file
|
||||
for BIN_MACHINE in ${M4_BOARDS}; do
|
||||
bbnote "Compile M4 project for : ${BIN_MACHINE}"
|
||||
for project in ${PROJECTS_LIST} ; do
|
||||
bbnote "Parsing M4 project : ${project}"
|
||||
|
||||
if [ "$(echo ${project} | cut -d'/' -f1)" = "${BIN_MACHINE}" ]; then
|
||||
bbnote "Selected M4 project : ${project}"
|
||||
|
||||
unset LDFLAGS CFLAGS CPPFLAGS CFLAGS_ASM
|
||||
# Export variables as used by Makefile
|
||||
export BIN_NAME=$(basename ${project})
|
||||
export PROJECT_DIR=${B}/${project}
|
||||
export PROJECT_APP="${S}/Projects/${project}/SW4STM32/${BIN_NAME}"
|
||||
|
||||
bbnote "BIN_NAME : ${BIN_NAME}"
|
||||
bbnote "PROJECT_DIR : ${PROJECT_DIR}"
|
||||
bbnote "PROJECT_APP : ${PROJECT_APP}"
|
||||
bbnote "BUILD_CONFIG : ${BUILD_CONFIG}"
|
||||
bbnote "CPU_TYPE : ${CPU_TYPE}"
|
||||
bbnote "SOURCE : ${S}"
|
||||
|
||||
mkdir -p ${PROJECT_DIR}/out/${BUILD_CONFIG}
|
||||
|
||||
# parse project to get file list and build flags
|
||||
python ${WORKDIR}/parse_project_config.py ${PROJECT_APP} ${BUILD_CONFIG} ${PROJECT_DIR}
|
||||
|
||||
# make clean
|
||||
bbnote "Cleaning M4 project : ${project}"
|
||||
oe_runmake -f ${WORKDIR}/Makefile.stm32 clean
|
||||
|
||||
# make build
|
||||
bbnote "Building M4 project : ${project}"
|
||||
oe_runmake -f ${WORKDIR}/Makefile.stm32 all
|
||||
fi
|
||||
done
|
||||
done
|
||||
}
|
||||
|
||||
do_install() {
|
||||
# Install M4 firmwares, scripts and README in userfs:
|
||||
# <userfs>/local/Cube-M4-examples/${project} (ie STM32MP157C-EV1/Applications/OpenAMP/OpenAMP_TTY_echo)
|
||||
# |-- fw_cortex_m4.sh
|
||||
# |-- README
|
||||
# |--lib
|
||||
# |--firmware
|
||||
# |-- ELF file for impacted board (ie OpenAMP_TTY_echo.elf)
|
||||
for BIN_MACHINE in ${M4_BOARDS}; do
|
||||
for project in ${PROJECTS_LIST} ; do
|
||||
if [ "$(echo ${project} | cut -d'/' -f1)" = "${BIN_MACHINE}" ]; then
|
||||
# BIN_NAME=$(echo ${project} | cut -d'/' -f4)
|
||||
BIN_NAME=$(basename ${project})
|
||||
|
||||
# Install M4 firmwares
|
||||
install -d ${D}${prefix}${USERFS_ROOTPATH}/${project}/lib/firmware/
|
||||
install -m 0755 ${B}/${project}/out/${BUILD_CONFIG}/${BIN_NAME}.elf ${D}${prefix}${USERFS_ROOTPATH}/${project}/lib/firmware/
|
||||
|
||||
# Install sh and README files if any for each example
|
||||
if [ -e ${S}/Projects/${project}/Remoteproc/fw_cortex_m4.sh ]; then
|
||||
install -m 0755 ${S}/Projects/${project}/Remoteproc/fw_cortex_m4.sh ${D}${prefix}${USERFS_ROOTPATH}/${project}
|
||||
fi
|
||||
if [ -e ${S}/Projects/${project}/Remoteproc/README ]; then
|
||||
install -m 0755 ${S}/Projects/${project}/Remoteproc/README ${D}${prefix}${USERFS_ROOTPATH}/${project}
|
||||
fi
|
||||
fi
|
||||
done
|
||||
done
|
||||
|
||||
# Install sh script to load/execute DEFAULT_COPRO_FIRMWARE @boot up
|
||||
if [ -n "${DEFAULT_COPRO_FIRMWARE}" ]; then
|
||||
# Install systemd service
|
||||
install -d ${D}${sysconfdir}/init.d/
|
||||
install -d ${D}${base_sbindir}/
|
||||
install -m 0755 ${WORKDIR}/st-m4firmware-load-default.sh ${D}${sysconfdir}/init.d/st-m4firmware-load-default.sh
|
||||
install -m 0755 ${WORKDIR}/st-m4firmware-load-default.sh ${D}${base_sbindir}/st-m4firmware-load-default.sh
|
||||
|
||||
sed -i -e "s:@default_fw@:${DEFAULT_COPRO_FIRMWARE}:" \
|
||||
${D}${sysconfdir}/init.d/st-m4firmware-load-default.sh
|
||||
sed -i -e "s:@default_fw@:${DEFAULT_COPRO_FIRMWARE}:" \
|
||||
${D}${base_sbindir}/st-m4firmware-load-default.sh
|
||||
|
||||
sed -i -e "s:@userfs_mount_point@:${STM32MP_USERFS_MOUNTPOINT_IMAGE}:" \
|
||||
${D}${sysconfdir}/init.d/st-m4firmware-load-default.sh
|
||||
sed -i -e "s:@userfs_mount_point@:${STM32MP_USERFS_MOUNTPOINT_IMAGE}:" \
|
||||
${D}${base_sbindir}/st-m4firmware-load-default.sh
|
||||
fi
|
||||
|
||||
# install systemd service for all machines configurations
|
||||
if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
|
||||
install -d ${D}${systemd_unitdir}/system
|
||||
install -m 644 ${WORKDIR}/st-m4firmware-load.service ${D}/${systemd_unitdir}/system
|
||||
fi
|
||||
}
|
||||
|
||||
# -----------------------------------------------------------
|
||||
# specific for service: start copro m4 firwmare at boot time
|
||||
|
||||
SYSTEMD_PACKAGES += " m4projects-stm32mp1 "
|
||||
SYSTEMD_SERVICE_${PN} = "st-m4firmware-load.service"
|
||||
SYSTEMD_AUTO_ENABLE_${PN} = "disable"
|
||||
|
||||
INITSCRIPT_NAME = "st-m4firmware-load-default.sh"
|
||||
INITSCRIPT_PARAMS = "stop 22 5 3 ."
|
||||
|
||||
INHIBIT_PACKAGE_DEBUG_SPLIT = "1"
|
||||
INHIBIT_PACKAGE_STRIP = "1"
|
||||
INHIBIT_SYSROOT_STRIP = "1"
|
||||
|
||||
FILES_${PN} += "${nonarch_base_libdir}/firmware ${sysconfdir}/init.d ${systemd_unitdir}/system"
|
||||
Loading…
Reference in New Issue