stm32mp1_trusted_defconfig rely on SCMI support
Subsystems (3)
cover stm32mp1_trusted_defconfig rely on SCMI support
This Serie is a preliminary step to allow support of secured clocks provided by SCMI server running in secure world (TF-A or OP-TEE).
This serie only activate the needed drivers in the trusted defconfig before alignment with device tree including SCMI support [1] and upstream of SCMI server in TF-A/OP-TEE.
[1] current patch for SCMI clock support in device tree
"ARM: dts: stm32: move clocks/resets to SCMI resources for stm32mp15"
https://patchwork.kernel.org/project/linux-arm-kernel/patch/20210126090120.19900-13-gabriel.fernandez at foss.st.com/
Etienne Carriere (2):
ARM: dts: stm32mp1: explicit clock reference needed by RCC clock
driver
clk: stm32mp1: gets root clocks from fdt
Patrick Delaunay (4):
scmi: Include device_compat.h
scmi: define LOG_CATEGORY
scmi: cosmetic: reorder include files
configs: stm32mp1_trusted_defconfig rely on SCMI support
arch/arm/dts/stm32mp151.dtsi | 4 ++ configs/stm32mp15_trusted_defconfig | 2 + drivers/clk/clk_stm32mp1.c | 62 ++++++++------------ drivers/firmware/scmi/mailbox_agent.c | 4 +- drivers/firmware/scmi/sandbox-scmi_agent.c | 2 + drivers/firmware/scmi/sandbox-scmi_devices.c | 2 + drivers/firmware/scmi/scmi_agent-uclass.c | 5 +- drivers/firmware/scmi/smccc_agent.c | 3 + drivers/firmware/scmi/smt.c | 2 + 9 files changed, 44 insertions(+), 42 deletions(-)
Signature · 1 line
2.17.1
PATCH 1/6 ARM: dts: stm32mp1: explicit clock reference needed by RCC clock driver
From: Etienne Carriere <[email protected]>
Define in the RCC clock provider node which root clocks the driver depends on. These are root oscillators, which may be present or not, upon FDT content.
This update binding is introduced in Linux kernel device tree by patch "ARM: dts: stm32: move clocks/resets to SCMI resources for stm32mp15"
This patch is a preliminary step for SCMI support of stm32mp15 boards with trusted boot chain, based on TF-A or OP-TEE.
---
Reference:
https://patchwork.kernel.org/project/linux-arm-kernel/patch/20210126090120.19900-13-gabriel.fernandez at foss.st.com/
arch/arm/dts/stm32mp151.dtsi | 4 ++++ 1 file changed, 4 insertions(+)
arch/arm/dts/stm32mp151.dtsi +4 -0
@@ -1136,6 +1136,10 @@ reg = <0x50000000 0x1000>; #clock-cells = <1>; #reset-cells = <1>; + + clock-names = "hse", "hsi", "csi", "lse", "lsi"; + clocks = <&clk_hse>, <&clk_hsi>, <&clk_csi>, + <&clk_lse>, <&clk_lsi>; }; pwr_regulators: pwr at 50001000 {
Signature · 1 line
2.17.1
PATCH 1/6 ARM: dts: stm32mp1: explicit clock reference needed by RCC clock driver
Hi Patrick
Quoted 30 lines · Patrick Delaunay
From: Etienne Carriere <[email protected]>
Define in the RCC clock provider node which root clocks the driver depends on. These are root oscillators, which may be present or not, upon FDT content.
This update binding is introduced in Linux kernel device tree by patch "ARM: dts: stm32: move clocks/resets to SCMI resources for stm32mp15"
This patch is a preliminary step for SCMI support of stm32mp15 boards with trusted boot chain, based on TF-A or OP-TEE.
Signed-off-by Etienne Carriere <[email protected]>Signed-off-by Patrick Delaunay <[email protected]>---
Reference:
https://patchwork.kernel.org/project/linux-arm-kernel/patch/20210126090120.19900-13-gabriel.fernandez at foss.st.com/
arch/arm/dts/stm32mp151.dtsi | 4 ++++ 1 file changed, 4 insertions(+)arch/arm/dts/stm32mp151.dtsi +0
-0
arch/arm/dts/stm32mp151.dtsi line 1145
Quoted 10 lines
arch/arm/dts/stm32mp151.dtsi +4
-0@@ -1136,6 +1136,10 @@ reg = <0x50000000 0x1000>; #clock-cells = <1>; #reset-cells = <1>; + + clock-names = "hse", "hsi", "csi", "lse", "lsi"; + clocks = <&clk_hse>, <&clk_hsi>, <&clk_csi>, + <&clk_lse>, <&clk_lsi>; }; pwr_regulators: pwr at 50001000 {
PATCH 1/6 ARM: dts: stm32mp1: explicit clock reference needed by RCC clock driver
HI
Quoted 41 lines · Patrice CHOTARD
Hi Patrick
Quoted 38 lines · Patrick Delaunay
From: Etienne Carriere <[email protected]>
Define in the RCC clock provider node which root clocks the driver depends on. These are root oscillators, which may be present or not, upon FDT content.
This update binding is introduced in Linux kernel device tree by patch "ARM: dts: stm32: move clocks/resets to SCMI resources for stm32mp15"
This patch is a preliminary step for SCMI support of stm32mp15 boards with trusted boot chain, based on TF-A or OP-TEE.
Signed-off-by Etienne Carriere <[email protected]>Signed-off-by Patrick Delaunay <[email protected]>---
Reference:
https://patchwork.kernel.org/project/linux-arm-kernel/patch/20210126090120.19900-13-gabriel.fernandez at foss.st.com/
arch/arm/dts/stm32mp151.dtsi | 4 ++++ 1 file changed, 4 insertions(+)arch/arm/dts/stm32mp151.dtsi +4
-0@@ -1136,6 +1136,10 @@ reg = <0x50000000 0x1000>; #clock-cells = <1>; #reset-cells = <1>; + + clock-names = "hse", "hsi", "csi", "lse", "lsi"; + clocks = <&clk_hse>, <&clk_hsi>, <&clk_csi>, + <&clk_lse>, <&clk_lsi>; };
Quoted 5 lines
arch/arm/dts/stm32mp151.dtsi line 1145
Quoted 2 lines
arch/arm/dts/stm32mp151.dtsi +0
-0pwr_regulators: pwr at 50001000 {Reviewed-by Patrice Chotard <[email protected]>
Applied to u-boot-stm/next
Thanks
Patrice
PATCH 1/6 ARM: dts: stm32mp1: explicit clock reference needed by RCC clock driver
In reply to Patrice CHOTARDHI
Quoted 41 lines · Patrice CHOTARD
Hi Patrick
Quoted 38 lines · Patrick Delaunay
From: Etienne Carriere <[email protected]>
Define in the RCC clock provider node which root clocks the driver depends on. These are root oscillators, which may be present or not, upon FDT content.
This update binding is introduced in Linux kernel device tree by patch "ARM: dts: stm32: move clocks/resets to SCMI resources for stm32mp15"
This patch is a preliminary step for SCMI support of stm32mp15 boards with trusted boot chain, based on TF-A or OP-TEE.
Signed-off-by Etienne Carriere <[email protected]>Signed-off-by Patrick Delaunay <[email protected]>---
Reference:
https://patchwork.kernel.org/project/linux-arm-kernel/patch/20210126090120.19900-13-gabriel.fernandez at foss.st.com/
arch/arm/dts/stm32mp151.dtsi | 4 ++++ 1 file changed, 4 insertions(+)arch/arm/dts/stm32mp151.dtsi +4
-0@@ -1136,6 +1136,10 @@ reg = <0x50000000 0x1000>; #clock-cells = <1>; #reset-cells = <1>; + + clock-names = "hse", "hsi", "csi", "lse", "lsi"; + clocks = <&clk_hse>, <&clk_hsi>, <&clk_csi>, + <&clk_lse>, <&clk_lsi>; };
Quoted 5 lines
arch/arm/dts/stm32mp151.dtsi line 1145
Quoted 2 lines
arch/arm/dts/stm32mp151.dtsi +0
-0pwr_regulators: pwr at 50001000 {Reviewed-by Patrice Chotard <[email protected]>
Applied to u-boot-stm/next
Thanks
Patrice
PATCH 2/6 clk: stm32mp1: gets root clocks from fdt
In reply to Patrick DelaunayFrom: Etienne Carriere <[email protected]>
This change makes stm32mp1 clock driver to get the root clocks reference from the device node in the FDT rather than fetching straight these clocks by their name. Driver now stores the clock reference and use it to know if a root clock is present, get its rate or gets its related udevice reference.
---
drivers/clk/clk_stm32mp1.c | 62 ++++++++++++++------------------------ 1 file changed, 23 insertions(+), 39 deletions(-)
drivers/clk/clk_stm32mp1.c +23 -39
@@ -250,7 +250,7 @@ DECLARE_GLOBAL_DATA_PTR;enum stm32mp1_parent_id {/* * _HSI, _HSE, _CSI, _LSI, _LSE should not be moved -* they are used as index in osc[] as entry point +* they are used as index in osc_clk[] as clock reference */ _HSI, _HSE,
@@ -430,8 +430,7 @@ struct stm32mp1_clk_data {struct stm32mp1_clk_priv {fdt_addr_t base;const struct stm32mp1_clk_data *data; -ulong osc[NB_OSC ]; -struct udevice *osc_dev[NB_OSC ]; +struct clk osc_clk[NB_OSC ]; };#define STM32MP1_CLK (off, b, idx, s) \
@@ -790,7 +789,7 @@ static ulong stm32mp1_clk_get_fixed(struct stm32mp1_clk_priv *priv, int idx)return 0 ; } -return priv->osc[idx]; +return clk_get_rate (&priv->osc_clk[idx]); }static int stm32mp1_clk_get_id (struct stm32mp1_clk_priv *priv,unsigned long id)
@@ -1545,7 +1544,7 @@ static int stm32mp1_hsidiv(fdt_addr_t rcc, ulong hsifreq)break ;if (hsidiv ==4 ) { -log_err ("clk-hsi frequency invalid" ); +log_err ("hsi frequency invalid" );return -1 ; }
@@ -1952,13 +1951,13 @@ static int stm32mp1_clktree(struct udevice *dev)* switch ON oscillator found in device-tree, * HSI already ON after bootrom */ -if (priv->osc[_LSI]) +if (clk_valid (&priv->osc_clk[_LSI]))stm32mp1_lsi_set (rcc,1 ); -if (priv->osc[_LSE]) { +if (clk_valid (&priv->osc_clk[_LSE])) {int bypass, digbyp;u32 lsedrv; -struct udevice *dev = priv->osc_dev[_LSE]; +struct udevice *dev = priv->osc_clk[_LSE].dev; bypass =dev_read_bool (dev,"st,bypass" ); digbyp =dev_read_bool (dev,"st,digbypass" );
@@ -1969,9 +1968,9 @@ static int stm32mp1_clktree(struct udevice *dev)stm32mp1_lse_enable (rcc, bypass, digbyp, lsedrv); } -if (priv->osc[_HSE]) { +if (clk_valid (&priv->osc_clk[_HSE])) {int bypass, digbyp, css; -struct udevice *dev = priv->osc_dev[_HSE]; +struct udevice *dev = priv->osc_clk[_HSE].dev; bypass =dev_read_bool (dev,"st,bypass" ); digbyp =dev_read_bool (dev,"st,digbypass" );
@@ -1996,8 +1995,8 @@ static int stm32mp1_clktree(struct udevice *dev)/* configure HSIDIV */ dev_dbg (dev,"configure HSIDIV\n" ); -if (priv->osc[_HSI]) { -stm32mp1_hsidiv (rcc, priv->osc[_HSI]); +if (clk_valid (&priv->osc_clk[_HSI])) { +stm32mp1_hsidiv (rcc,clk_get_rate (&priv->osc_clk[_HSI]));stgen_config (priv); }
@@ -2043,7 +2042,7 @@ static int stm32mp1_clktree(struct udevice *dev) }/* wait LSE ready before to use it */ -if (priv->osc[_LSE]) +if (clk_valid (&priv->osc_clk[_LSE]))stm32mp1_lse_wait (rcc);/* configure with expected clock source */
@@ -2082,7 +2081,7 @@ static int stm32mp1_clktree(struct udevice *dev)dev_dbg (dev,"oscillator off\n" );/* switch OFF HSI if not found in device-tree */ -if (!priv->osc[_HSI]) +if (!clk_valid (&priv->osc_clk[_HSI]))stm32mp1_hsi_set (rcc,0 );/* Software Self-Refresh mode (SSR) during DDR initilialization */
@@ -2178,40 +2177,25 @@ static ulong stm32mp1_clk_set_rate(struct clk *clk, unsigned long clk_rate)return -EINVAL ; } -static void stm32mp1_osc_clk_init (const char *name, -struct stm32mp1_clk_priv *priv, -int index) -{ -struct clk clk; -struct udevice *dev =NULL ; - - priv->osc[index] =0 ; - clk.id =0 ; -if (!uclass_get_device_by_name (UCLASS_CLK , name, &dev)) { -if (clk_request (dev, &clk)) -log_err ("%s request" , name); -else - priv->osc[index] =clk_get_rate (&clk); - } - priv->osc_dev[index] = dev; -} -static void stm32mp1_osc_init (struct udevice *dev) {struct stm32mp1_clk_priv *priv =dev_get_priv (dev);int i;const char *name[NB_OSC ] = { - [_LSI] ="clk-lsi" , - [_LSE] ="clk-lse" , - [_HSI] ="clk-hsi" , - [_HSE] ="clk-hse" , - [_CSI] ="clk-csi" , + [_LSI] ="lsi" , + [_LSE] ="lse" , + [_HSI] ="hsi" , + [_HSE] ="hse" , + [_CSI] ="csi" , [_I2S_CKIN] ="i2s_ckin" , };for (i =0 ; i <NB_OSC ; i++) { -stm32mp1_osc_clk_init (name[i], priv, i); -dev_dbg (dev,"%d: %s => %x\n" , i, name[i], (u32 )priv->osc[i]); +if (clk_get_by_name (dev, name[i], &priv->osc_clk[i])) +dev_dbg (dev,"No source clock \"%s\"" , name[i]); +else +dev_dbg (dev,"%s clock rate: %luHz\n" , + name[i],clk_get_rate (&priv->osc_clk[i])); } }
Signature · 1 line
2.17.1
PATCH 2/6 clk: stm32mp1: gets root clocks from fdt
Hi Patrick
Quoted 156 lines · Patrick Delaunay
From: Etienne Carriere <[email protected]>
This change makes stm32mp1 clock driver to get the root clocks reference from the device node in the FDT rather than fetching straight these clocks by their name. Driver now stores the clock reference and use it to know if a root clock is present, get its rate or gets its related udevice reference.
Signed-off-by Etienne Carriere <[email protected]>Signed-off-by Patrick Delaunay <[email protected]>---
drivers/clk/clk_stm32mp1.c | 62 ++++++++++++++------------------------ 1 file changed, 23 insertions(+), 39 deletions(-)drivers/clk/clk_stm32mp1.c +18
-37@@ -250,7 +250,7 @@ DECLARE_GLOBAL_DATA_PTR;enum stm32mp1_parent_id {/* * _HSI, _HSE, _CSI, _LSI, _LSE should not be moved -* they are used as index in osc[] as entry point +* they are used as index in osc_clk[] as clock reference */ _HSI, _HSE,@@ -430,8 +430,7 @@ struct stm32mp1_clk_data {struct stm32mp1_clk_priv {fdt_addr_t base;const struct stm32mp1_clk_data *data; -ulong osc[NB_OSC ]; -struct udevice *osc_dev[NB_OSC ]; +struct clk osc_clk[NB_OSC ]; };#define STM32MP1_CLK (off, b, idx, s) \@@ -790,7 +789,7 @@ static ulong stm32mp1_clk_get_fixed(struct stm32mp1_clk_priv *priv, int idx)return 0 ; } -return priv->osc[idx]; +return clk_get_rate (&priv->osc_clk[idx]); }static int stm32mp1_clk_get_id (struct stm32mp1_clk_priv *priv,unsigned long id)@@ -1545,7 +1544,7 @@ static int stm32mp1_hsidiv(fdt_addr_t rcc, ulong hsifreq)break ;if (hsidiv ==4 ) { -log_err ("clk-hsi frequency invalid" ); +log_err ("hsi frequency invalid" );return -1 ; }@@ -1952,13 +1951,13 @@ static int stm32mp1_clktree(struct udevice *dev)* switch ON oscillator found in device-tree, * HSI already ON after bootrom */ -if (priv->osc[_LSI]) +if (clk_valid (&priv->osc_clk[_LSI]))stm32mp1_lsi_set (rcc,1 ); -if (priv->osc[_LSE]) { +if (clk_valid (&priv->osc_clk[_LSE])) {int bypass, digbyp;u32 lsedrv; -struct udevice *dev = priv->osc_dev[_LSE]; +struct udevice *dev = priv->osc_clk[_LSE].dev; bypass =dev_read_bool (dev,"st,bypass" ); digbyp =dev_read_bool (dev,"st,digbypass" );@@ -1969,9 +1968,9 @@ static int stm32mp1_clktree(struct udevice *dev)stm32mp1_lse_enable (rcc, bypass, digbyp, lsedrv); } -if (priv->osc[_HSE]) { +if (clk_valid (&priv->osc_clk[_HSE])) {int bypass, digbyp, css; -struct udevice *dev = priv->osc_dev[_HSE]; +struct udevice *dev = priv->osc_clk[_HSE].dev; bypass =dev_read_bool (dev,"st,bypass" ); digbyp =dev_read_bool (dev,"st,digbypass" );@@ -1996,8 +1995,8 @@ static int stm32mp1_clktree(struct udevice *dev)/* configure HSIDIV */ dev_dbg (dev,"configure HSIDIV\n" ); -if (priv->osc[_HSI]) { -stm32mp1_hsidiv (rcc, priv->osc[_HSI]); +if (clk_valid (&priv->osc_clk[_HSI])) { +stm32mp1_hsidiv (rcc,clk_get_rate (&priv->osc_clk[_HSI]));stgen_config (priv); }@@ -2043,7 +2042,7 @@ static int stm32mp1_clktree(struct udevice *dev) }/* wait LSE ready before to use it */ -if (priv->osc[_LSE]) +if (clk_valid (&priv->osc_clk[_LSE]))stm32mp1_lse_wait (rcc);/* configure with expected clock source */ @@ -2082,7 +2081,7 @@ static int stm32mp1_clktree(struct udevice *dev)dev_dbg (dev,"oscillator off\n" );/* switch OFF HSI if not found in device-tree */ -if (!priv->osc[_HSI]) +if (!clk_valid (&priv->osc_clk[_HSI]))stm32mp1_hsi_set (rcc,0 );/* Software Self-Refresh mode (SSR) during DDR initilialization */ @@ -2178,40 +2177,25 @@ static ulong stm32mp1_clk_set_rate(struct clk *clk, unsigned long clk_rate)return -EINVAL ; } -static void stm32mp1_osc_clk_init (const char *name, -struct stm32mp1_clk_priv *priv, -int index) -{ -struct clk clk; -struct udevice *dev =NULL ; - - priv->osc[index] =0 ; - clk.id =0 ; -if (!uclass_get_device_by_name (UCLASS_CLK , name, &dev)) { -if (clk_request (dev, &clk)) -log_err ("%s request" , name); -else - priv->osc[index] =clk_get_rate (&clk); - } - priv->osc_dev[index] = dev; -} -static void stm32mp1_osc_init (struct udevice *dev) {struct stm32mp1_clk_priv *priv =dev_get_priv (dev);int i;const char *name[NB_OSC ] = { - [_LSI] ="clk-lsi" , - [_LSE] ="clk-lse" , - [_HSI] ="clk-hsi" , - [_HSE] ="clk-hse" , - [_CSI] ="clk-csi" , + [_LSI] ="lsi" , + [_LSE] ="lse" , + [_HSI] ="hsi" , + [_HSE] ="hse" , + [_CSI] ="csi" , [_I2S_CKIN] ="i2s_ckin" , };for (i =0 ; i <NB_OSC ; i++) {
drivers/clk/clk_stm32mp1.c static ulong stm32mp1_clk_set_rate(struct clk *clk, unsigned long clk_rate) · line 2201
Quoted 10 lines
drivers/clk/clk_stm32mp1.c +5
-2-stm32mp1_osc_clk_init (name[i], priv, i); -dev_dbg (dev,"%d: %s => %x\n" , i, name[i], (u32 )priv->osc[i]); +if (clk_get_by_name (dev, name[i], &priv->osc_clk[i])) +dev_dbg (dev,"No source clock \"%s\"" , name[i]); +else +dev_dbg (dev,"%s clock rate: %luHz\n" , + name[i],clk_get_rate (&priv->osc_clk[i])); } }
Thanks
Patrice
PATCH 2/6 clk: stm32mp1: gets root clocks from fdt
Hi
Quoted 172 lines · Patrice CHOTARD
Hi Patrick
Quoted 156 lines · Patrick Delaunay
From: Etienne Carriere <[email protected]>
This change makes stm32mp1 clock driver to get the root clocks reference from the device node in the FDT rather than fetching straight these clocks by their name. Driver now stores the clock reference and use it to know if a root clock is present, get its rate or gets its related udevice reference.
Signed-off-by Etienne Carriere <[email protected]>Signed-off-by Patrick Delaunay <[email protected]>---
drivers/clk/clk_stm32mp1.c | 62 ++++++++++++++------------------------ 1 file changed, 23 insertions(+), 39 deletions(-)drivers/clk/clk_stm32mp1.c +18
-37@@ -250,7 +250,7 @@ DECLARE_GLOBAL_DATA_PTR;enum stm32mp1_parent_id {/* * _HSI, _HSE, _CSI, _LSI, _LSE should not be moved -* they are used as index in osc[] as entry point +* they are used as index in osc_clk[] as clock reference */ _HSI, _HSE,@@ -430,8 +430,7 @@ struct stm32mp1_clk_data {struct stm32mp1_clk_priv {fdt_addr_t base;const struct stm32mp1_clk_data *data; -ulong osc[NB_OSC ]; -struct udevice *osc_dev[NB_OSC ]; +struct clk osc_clk[NB_OSC ]; };#define STM32MP1_CLK (off, b, idx, s) \@@ -790,7 +789,7 @@ static ulong stm32mp1_clk_get_fixed(struct stm32mp1_clk_priv *priv, int idx)return 0 ; } -return priv->osc[idx]; +return clk_get_rate (&priv->osc_clk[idx]); }static int stm32mp1_clk_get_id (struct stm32mp1_clk_priv *priv,unsigned long id)@@ -1545,7 +1544,7 @@ static int stm32mp1_hsidiv(fdt_addr_t rcc, ulong hsifreq)break ;if (hsidiv ==4 ) { -log_err ("clk-hsi frequency invalid" ); +log_err ("hsi frequency invalid" );return -1 ; }@@ -1952,13 +1951,13 @@ static int stm32mp1_clktree(struct udevice *dev)* switch ON oscillator found in device-tree, * HSI already ON after bootrom */ -if (priv->osc[_LSI]) +if (clk_valid (&priv->osc_clk[_LSI]))stm32mp1_lsi_set (rcc,1 ); -if (priv->osc[_LSE]) { +if (clk_valid (&priv->osc_clk[_LSE])) {int bypass, digbyp;u32 lsedrv; -struct udevice *dev = priv->osc_dev[_LSE]; +struct udevice *dev = priv->osc_clk[_LSE].dev; bypass =dev_read_bool (dev,"st,bypass" ); digbyp =dev_read_bool (dev,"st,digbypass" );@@ -1969,9 +1968,9 @@ static int stm32mp1_clktree(struct udevice *dev)stm32mp1_lse_enable (rcc, bypass, digbyp, lsedrv); } -if (priv->osc[_HSE]) { +if (clk_valid (&priv->osc_clk[_HSE])) {int bypass, digbyp, css; -struct udevice *dev = priv->osc_dev[_HSE]; +struct udevice *dev = priv->osc_clk[_HSE].dev; bypass =dev_read_bool (dev,"st,bypass" ); digbyp =dev_read_bool (dev,"st,digbypass" );@@ -1996,8 +1995,8 @@ static int stm32mp1_clktree(struct udevice *dev)/* configure HSIDIV */ dev_dbg (dev,"configure HSIDIV\n" ); -if (priv->osc[_HSI]) { -stm32mp1_hsidiv (rcc, priv->osc[_HSI]); +if (clk_valid (&priv->osc_clk[_HSI])) { +stm32mp1_hsidiv (rcc,clk_get_rate (&priv->osc_clk[_HSI]));stgen_config (priv); }@@ -2043,7 +2042,7 @@ static int stm32mp1_clktree(struct udevice *dev) }/* wait LSE ready before to use it */ -if (priv->osc[_LSE]) +if (clk_valid (&priv->osc_clk[_LSE]))stm32mp1_lse_wait (rcc);/* configure with expected clock source */ @@ -2082,7 +2081,7 @@ static int stm32mp1_clktree(struct udevice *dev)dev_dbg (dev,"oscillator off\n" );/* switch OFF HSI if not found in device-tree */ -if (!priv->osc[_HSI]) +if (!clk_valid (&priv->osc_clk[_HSI]))stm32mp1_hsi_set (rcc,0 );/* Software Self-Refresh mode (SSR) during DDR initilialization */ @@ -2178,40 +2177,25 @@ static ulong stm32mp1_clk_set_rate(struct clk *clk, unsigned long clk_rate)return -EINVAL ; } -static void stm32mp1_osc_clk_init (const char *name, -struct stm32mp1_clk_priv *priv, -int index) -{ -struct clk clk; -struct udevice *dev =NULL ; - - priv->osc[index] =0 ; - clk.id =0 ; -if (!uclass_get_device_by_name (UCLASS_CLK , name, &dev)) { -if (clk_request (dev, &clk)) -log_err ("%s request" , name); -else - priv->osc[index] =clk_get_rate (&clk); - } - priv->osc_dev[index] = dev; -} -static void stm32mp1_osc_init (struct udevice *dev) {struct stm32mp1_clk_priv *priv =dev_get_priv (dev);int i;const char *name[NB_OSC ] = { - [_LSI] ="clk-lsi" , - [_LSE] ="clk-lse" , - [_HSI] ="clk-hsi" , - [_HSE] ="clk-hse" , - [_CSI] ="clk-csi" , + [_LSI] ="lsi" , + [_LSE] ="lse" , + [_HSI] ="hsi" , + [_HSE] ="hse" , + [_CSI] ="csi" , [_I2S_CKIN] ="i2s_ckin" , };for (i =0 ; i <NB_OSC ; i++) {drivers/clk/clk_stm32mp1.c static ulong stm32mp1_clk_set_rate(struct clk *clk, unsigned long clk_rate) · line 2201
Quoted 10 lines
drivers/clk/clk_stm32mp1.c +5
-2-stm32mp1_osc_clk_init (name[i], priv, i); -dev_dbg (dev,"%d: %s => %x\n" , i, name[i], (u32 )priv->osc[i]); +if (clk_get_by_name (dev, name[i], &priv->osc_clk[i])) +dev_dbg (dev,"No source clock \"%s\"" , name[i]); +else +dev_dbg (dev,"%s clock rate: %luHz\n" , + name[i],clk_get_rate (&priv->osc_clk[i])); } }Reviewed-by Patrice Chotard <[email protected]>
Quoted 7 lines
Thanks
Patrice
_______________________________________________
Uboot-stm32 mailing list
Uboot-stm32 at st-md-mailman.stormreply.com
https://st-md-mailman.stormreply.com/mailman/listinfo/uboot-stm32
Applied to u-boot-stm/next
Thanks
Patrice
PATCH 3/6 scmi: Include device_compat.h
In reply to Patrick DelaunayInclude the file needed for log function prototype, this patch solves the compilation issue for undefined reference to `dev_err'.
---
drivers/firmware/scmi/smccc_agent.c | 1 + 1 file changed, 1 insertion(+)
drivers/firmware/scmi/smccc_agent.c +1 -0
@@ -9,6 +9,7 @@#include <scmi_agent.h> #include <scmi_agent-uclass.h> #include <dm/devres.h> +#include <dm/device_compat.h> #include <dm/device-internal.h> #include <linux/arm-smccc.h> #include <linux/compat.h>
Signature · 1 line
2.17.1
PATCH 3/6 scmi: Include device_compat.h
Hi Patrick
Quoted 15 lines · Patrick Delaunay
Include the file needed for log function prototype, this patch solves the compilation issue for undefined reference to `dev_err'.
Signed-off-by Patrick Delaunay <[email protected]>---
drivers/firmware/scmi/smccc_agent.c | 1 + 1 file changed, 1 insertion(+)drivers/firmware/scmi/smccc_agent.c +0
-0
drivers/firmware/scmi/smccc_agent.c line 15
Quoted 7 lines
drivers/firmware/scmi/smccc_agent.c +1
-0@@ -9,6 +9,7 @@#include <scmi_agent.h> #include <scmi_agent-uclass.h> #include <dm/devres.h> +#include <dm/device_compat.h> #include <dm/device-internal.h> #include <linux/arm-smccc.h> #include <linux/compat.h>
Thanks
Patrice
PATCH 3/6 scmi: Include device_compat.h
HI
Quoted 28 lines · Patrice CHOTARD
Hi Patrick
Quoted 15 lines · Patrick Delaunay
Include the file needed for log function prototype, this patch solves the compilation issue for undefined reference to `dev_err'.
Signed-off-by Patrick Delaunay <[email protected]>---
drivers/firmware/scmi/smccc_agent.c | 1 + 1 file changed, 1 insertion(+)drivers/firmware/scmi/smccc_agent.c +0
-0drivers/firmware/scmi/smccc_agent.c line 15
Quoted 7 lines
drivers/firmware/scmi/smccc_agent.c +1
-0@@ -9,6 +9,7 @@#include <scmi_agent.h> #include <scmi_agent-uclass.h> #include <dm/devres.h> +#include <dm/device_compat.h> #include <dm/device-internal.h> #include <linux/arm-smccc.h> #include <linux/compat.h> Reviewed-by Patrice Chotard <[email protected]>
Quoted 3 lines
Thanks
Patrice
Applied to u-boot-stm/next
Thanks
Patrice
PATCH 3/6 scmi: Include device_compat.h
In reply to Patrick DelaunayHi Patrick
Quoted 15 lines · Patrick Delaunay
Include the file needed for log function prototype, this patch solves the compilation issue for undefined reference to `dev_err'.
Signed-off-by Patrick Delaunay <[email protected]>---
drivers/firmware/scmi/smccc_agent.c | 1 + 1 file changed, 1 insertion(+)drivers/firmware/scmi/smccc_agent.c +0
-0
drivers/firmware/scmi/smccc_agent.c line 15
Quoted 7 lines
drivers/firmware/scmi/smccc_agent.c +1
-0@@ -9,6 +9,7 @@#include <scmi_agent.h> #include <scmi_agent-uclass.h> #include <dm/devres.h> +#include <dm/device_compat.h> #include <dm/device-internal.h> #include <linux/arm-smccc.h> #include <linux/compat.h>
Thanks
Patrice
PATCH 4/6 scmi: define LOG_CATEGORY
In reply to Patrick DelaunayDefine LOG_CATEGORY to allow filtering with log command.
---
drivers/firmware/scmi/mailbox_agent.c | 2 ++ drivers/firmware/scmi/sandbox-scmi_agent.c | 2 ++ drivers/firmware/scmi/sandbox-scmi_devices.c | 2 ++ drivers/firmware/scmi/scmi_agent-uclass.c | 2 ++ drivers/firmware/scmi/smccc_agent.c | 2 ++ drivers/firmware/scmi/smt.c | 2 ++ 6 files changed, 12 insertions(+)
drivers/firmware/scmi/mailbox_agent.c +2 -0
@@ -3,6 +3,8 @@* Copyright (C) 2020 Linaro Limited. */ +#define LOG_CATEGORY UCLASS_SCMI_AGENT +#include <common.h> #include <dm.h> #include <dm/device_compat.h>
drivers/firmware/scmi/sandbox-scmi_agent.c +2 -0
@@ -3,6 +3,8 @@* Copyright (C) 2020, Linaro Limited */ +#define LOG_CATEGORY UCLASS_SCMI_AGENT +#include <common.h> #include <dm.h> #include <malloc.h>
drivers/firmware/scmi/sandbox-scmi_devices.c +2 -0
@@ -3,6 +3,8 @@* Copyright (C) 2020, Linaro Limited */ +#define LOG_CATEGORY UCLASS_MISC +#include <common.h> #include <clk.h> #include <dm.h>
drivers/firmware/scmi/scmi_agent-uclass.c +2 -0
@@ -3,6 +3,8 @@* Copyright (C) 2020 Linaro Limited. */ +#define LOG_CATEGORY UCLASS_SCMI_AGENT +#include <common.h> #include <dm.h> #include <dm/device_compat.h>
drivers/firmware/scmi/smccc_agent.c +2 -0
@@ -3,6 +3,8 @@* Copyright (C) 2020 Linaro Limited. */ +#define LOG_CATEGORY UCLASS_SCMI_AGENT +#include <common.h> #include <dm.h> #include <errno.h>
drivers/firmware/scmi/smt.c +2 -0
@@ -4,6 +4,8 @@* Copyright (C) 2019-2020 Linaro Limited. */ +#define LOG_CATEGORY UCLASS_SCMI_AGENT +#include <common.h> #include <cpu_func.h> #include <dm.h>
Signature · 1 line
2.17.1
PATCH 4/6 scmi: define LOG_CATEGORY
Quoted 6 lines · Patrick Delaunay
Define
LOG_CATEGORYto allow filtering with log command.Signed-off-by Patrick Delaunay <[email protected]>---
Quoted 7 lines
drivers/firmware/scmi/mailbox_agent.c | 2 ++ drivers/firmware/scmi/sandbox-scmi_agent.c | 2 ++ drivers/firmware/scmi/sandbox-scmi_devices.c | 2 ++ drivers/firmware/scmi/scmi_agent-uclass.c | 2 ++ drivers/firmware/scmi/smccc_agent.c | 2 ++ drivers/firmware/scmi/smt.c | 2 ++ 6 files changed, 12 insertions(+)
PATCH 4/6 scmi: define LOG_CATEGORY
In reply to Patrick DelaunayHi Patrick
Quoted 84 lines · Patrick Delaunay
Define
LOG_CATEGORYto allow filtering with log command.Signed-off-by Patrick Delaunay <[email protected]>---
drivers/firmware/scmi/mailbox_agent.c | 2 ++ drivers/firmware/scmi/sandbox-scmi_agent.c | 2 ++ drivers/firmware/scmi/sandbox-scmi_devices.c | 2 ++ drivers/firmware/scmi/scmi_agent-uclass.c | 2 ++ drivers/firmware/scmi/smccc_agent.c | 2 ++ drivers/firmware/scmi/smt.c | 2 ++ 6 files changed, 12 insertions(+)drivers/firmware/scmi/mailbox_agent.c +2
-0@@ -3,6 +3,8 @@* Copyright (C) 2020 Linaro Limited. */ +#define LOG_CATEGORY UCLASS_SCMI_AGENT +#include <common.h> #include <dm.h> #include <dm/device_compat.h> drivers/firmware/scmi/sandbox-scmi_agent.c +2
-0@@ -3,6 +3,8 @@* Copyright (C) 2020, Linaro Limited */ +#define LOG_CATEGORY UCLASS_SCMI_AGENT +#include <common.h> #include <dm.h> #include <malloc.h> drivers/firmware/scmi/sandbox-scmi_devices.c +2
-0@@ -3,6 +3,8 @@* Copyright (C) 2020, Linaro Limited */ +#define LOG_CATEGORY UCLASS_MISC +#include <common.h> #include <clk.h> #include <dm.h> drivers/firmware/scmi/scmi_agent-uclass.c +2
-0@@ -3,6 +3,8 @@* Copyright (C) 2020 Linaro Limited. */ +#define LOG_CATEGORY UCLASS_SCMI_AGENT +#include <common.h> #include <dm.h> #include <dm/device_compat.h> drivers/firmware/scmi/smccc_agent.c +2
-0@@ -3,6 +3,8 @@* Copyright (C) 2020 Linaro Limited. */ +#define LOG_CATEGORY UCLASS_SCMI_AGENT +#include <common.h> #include <dm.h> #include <errno.h> drivers/firmware/scmi/smt.c +0
-0
drivers/firmware/scmi/smt.c line 11
Quoted 8 lines
drivers/firmware/scmi/smt.c +2
-0@@ -4,6 +4,8 @@* Copyright (C) 2019-2020 Linaro Limited. */ +#define LOG_CATEGORY UCLASS_SCMI_AGENT +#include <common.h> #include <cpu_func.h> #include <dm.h>
Thanks
Patrice
PATCH 4/6 scmi: define LOG_CATEGORY
Hi
Quoted 98 lines · Patrice CHOTARD
Hi Patrick
Quoted 84 lines · Patrick Delaunay
Define
LOG_CATEGORYto allow filtering with log command.Signed-off-by Patrick Delaunay <[email protected]>---
drivers/firmware/scmi/mailbox_agent.c | 2 ++ drivers/firmware/scmi/sandbox-scmi_agent.c | 2 ++ drivers/firmware/scmi/sandbox-scmi_devices.c | 2 ++ drivers/firmware/scmi/scmi_agent-uclass.c | 2 ++ drivers/firmware/scmi/smccc_agent.c | 2 ++ drivers/firmware/scmi/smt.c | 2 ++ 6 files changed, 12 insertions(+)drivers/firmware/scmi/mailbox_agent.c +2
-0@@ -3,6 +3,8 @@* Copyright (C) 2020 Linaro Limited. */ +#define LOG_CATEGORY UCLASS_SCMI_AGENT +#include <common.h> #include <dm.h> #include <dm/device_compat.h> drivers/firmware/scmi/sandbox-scmi_agent.c +2
-0@@ -3,6 +3,8 @@* Copyright (C) 2020, Linaro Limited */ +#define LOG_CATEGORY UCLASS_SCMI_AGENT +#include <common.h> #include <dm.h> #include <malloc.h> drivers/firmware/scmi/sandbox-scmi_devices.c +2
-0@@ -3,6 +3,8 @@* Copyright (C) 2020, Linaro Limited */ +#define LOG_CATEGORY UCLASS_MISC +#include <common.h> #include <clk.h> #include <dm.h> drivers/firmware/scmi/scmi_agent-uclass.c +2
-0@@ -3,6 +3,8 @@* Copyright (C) 2020 Linaro Limited. */ +#define LOG_CATEGORY UCLASS_SCMI_AGENT +#include <common.h> #include <dm.h> #include <dm/device_compat.h> drivers/firmware/scmi/smccc_agent.c +2
-0@@ -3,6 +3,8 @@* Copyright (C) 2020 Linaro Limited. */ +#define LOG_CATEGORY UCLASS_SCMI_AGENT +#include <common.h> #include <dm.h> #include <errno.h> drivers/firmware/scmi/smt.c +0
-0drivers/firmware/scmi/smt.c line 11
Quoted 8 lines
drivers/firmware/scmi/smt.c +2
-0@@ -4,6 +4,8 @@* Copyright (C) 2019-2020 Linaro Limited. */ +#define LOG_CATEGORY UCLASS_SCMI_AGENT +#include <common.h> #include <cpu_func.h> #include <dm.h> Reviewed-by Patrice Chotard <[email protected]>
Quoted 7 lines
Thanks
Patrice
_______________________________________________
Uboot-stm32 mailing list
Uboot-stm32 at st-md-mailman.stormreply.com
https://st-md-mailman.stormreply.com/mailman/listinfo/uboot-stm32
Applied to u-boot-stm/next
Thanks
Patrice
PATCH 5/6 scmi: cosmetic: reorder include files
In reply to Patrick DelaunayReorder include files in expected order.
---
drivers/firmware/scmi/mailbox_agent.c | 2 +- drivers/firmware/scmi/scmi_agent-uclass.c | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-)
drivers/firmware/scmi/mailbox_agent.c +1 -1
@@ -7,11 +7,11 @@#include <common.h> #include <dm.h> -#include <dm/device_compat.h> #include <errno.h> #include <mailbox.h> #include <scmi_agent.h> #include <scmi_agent-uclass.h> +#include <dm/device_compat.h> #include <dm/devres.h> #include <linux/compat.h>
drivers/firmware/scmi/scmi_agent-uclass.c +1 -2
@@ -7,11 +7,10 @@#include <common.h> #include <dm.h> -#include <dm/device_compat.h> #include <errno.h> #include <scmi_agent-uclass.h> #include <scmi_protocols.h> - +#include <dm/device_compat.h> #include <dm/device-internal.h> #include <linux/compat.h>
Signature · 1 line
2.17.1
PATCH 5/6 scmi: cosmetic: reorder include files
Hi Patrick
Quoted 34 lines · Patrick Delaunay
Reorder include files in expected order.
Signed-off-by Patrick Delaunay <[email protected]>---
drivers/firmware/scmi/mailbox_agent.c | 2 +- drivers/firmware/scmi/scmi_agent-uclass.c | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-)drivers/firmware/scmi/mailbox_agent.c +1
-1@@ -7,11 +7,11 @@#include <common.h> #include <dm.h> -#include <dm/device_compat.h> #include <errno.h> #include <mailbox.h> #include <scmi_agent.h> #include <scmi_agent-uclass.h> +#include <dm/device_compat.h> #include <dm/devres.h> #include <linux/compat.h> drivers/firmware/scmi/scmi_agent-uclass.c +0
-0@@ -7,11 +7,10 @@#include <common.h>
drivers/firmware/scmi/scmi_agent-uclass.c line 16
Quoted 10 lines
drivers/firmware/scmi/scmi_agent-uclass.c +1
-2#include <dm.h> -#include <dm/device_compat.h> #include <errno.h> #include <scmi_agent-uclass.h> #include <scmi_protocols.h> - +#include <dm/device_compat.h> #include <dm/device-internal.h> #include <linux/compat.h>
Thanks
Patrice
PATCH 5/6 scmi: cosmetic: reorder include files
Quoted 51 lines · Patrice CHOTARD
Hi Patrick
Quoted 34 lines · Patrick Delaunay
Reorder include files in expected order.
Signed-off-by Patrick Delaunay <[email protected]>---
drivers/firmware/scmi/mailbox_agent.c | 2 +- drivers/firmware/scmi/scmi_agent-uclass.c | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-)drivers/firmware/scmi/mailbox_agent.c +1
-1@@ -7,11 +7,11 @@#include <common.h> #include <dm.h> -#include <dm/device_compat.h> #include <errno.h> #include <mailbox.h> #include <scmi_agent.h> #include <scmi_agent-uclass.h> +#include <dm/device_compat.h> #include <dm/devres.h> #include <linux/compat.h> drivers/firmware/scmi/scmi_agent-uclass.c +0
-0@@ -7,11 +7,10 @@#include <common.h> drivers/firmware/scmi/scmi_agent-uclass.c line 16
Quoted 10 lines
drivers/firmware/scmi/scmi_agent-uclass.c +1
-2#include <dm.h> -#include <dm/device_compat.h> #include <errno.h> #include <scmi_agent-uclass.h> #include <scmi_protocols.h> - +#include <dm/device_compat.h> #include <dm/device-internal.h> #include <linux/compat.h> Reviewed-by Patrice Chotard <[email protected]>
Quoted 3 lines
Thanks
Patrice
Applied to u-boot-stm/next
Thanks
Patrice
PATCH 5/6 scmi: cosmetic: reorder include files
Hi
Quoted 54 lines · Patrice CHOTARD
Quoted 51 lines · Patrice CHOTARD
Hi Patrick
Quoted 34 lines · Patrick Delaunay
Reorder include files in expected order.
Signed-off-by Patrick Delaunay <[email protected]>---
drivers/firmware/scmi/mailbox_agent.c | 2 +- drivers/firmware/scmi/scmi_agent-uclass.c | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-)drivers/firmware/scmi/mailbox_agent.c +1
-1@@ -7,11 +7,11 @@#include <common.h> #include <dm.h> -#include <dm/device_compat.h> #include <errno.h> #include <mailbox.h> #include <scmi_agent.h> #include <scmi_agent-uclass.h> +#include <dm/device_compat.h> #include <dm/devres.h> #include <linux/compat.h> drivers/firmware/scmi/scmi_agent-uclass.c +0
-0@@ -7,11 +7,10 @@#include <common.h> drivers/firmware/scmi/scmi_agent-uclass.c line 16
Quoted 10 lines
drivers/firmware/scmi/scmi_agent-uclass.c +1
-2#include <dm.h> -#include <dm/device_compat.h> #include <errno.h> #include <scmi_agent-uclass.h> #include <scmi_protocols.h> - +#include <dm/device_compat.h> #include <dm/device-internal.h> #include <linux/compat.h> Reviewed-by Patrice Chotard <[email protected]>
Quoted 9 lines
Quoted 3 lines
Thanks
PatriceApplied to u-boot-stm/next
Thanks
Patrice
Applied to u-boot-stm/next
Thanks
Patrice
PATCH 6/6 configs: stm32mp1_trusted_defconfig rely on SCMI support
In reply to Patrick DelaunayEnable SCMI clock and reset domain support for stm32mp1 platform and ARM SMC mailbox driver used as communication channel for SCMI messages between non-secure world and secure SCMI server.
---
configs/stm32mp15_trusted_defconfig | 2 ++ 1 file changed, 2 insertions(+)
configs/stm32mp15_trusted_defconfig +2 -0
@@ -51,6 +51,7 @@ CONFIG_ENV_UBI_VOLUME="uboot_config" CONFIG_ENV_UBI_VOLUME_REDUND="uboot_config_r" CONFIG_SYS_RELOC_GD_ENV_ADDR=y CONFIG_STM32_ADC=y +CONFIG_CLK_SCMI=y CONFIG_SET_DFU_ALT_INFO=y CONFIG_USB_FUNCTION_FASTBOOT=y CONFIG_FASTBOOT_BUF_ADDR=0xC0000000
@@ -107,6 +108,7 @@ CONFIG_DM_REGULATOR_GPIO=y CONFIG_DM_REGULATOR_STM32_VREFBUF=y CONFIG_DM_REGULATOR_STPMIC1=y CONFIG_REMOTEPROC_STM32_COPRO=y +CONFIG_RESET_SCMI=y CONFIG_DM_RNG=y CONFIG_RNG_STM32MP1=y CONFIG_DM_RTC=y
Signature · 1 line
2.17.1
PATCH 6/6 configs: stm32mp1_trusted_defconfig rely on SCMI support
Hi Patrick
Quoted 24 lines · Patrick Delaunay
Enable SCMI clock and reset domain support for stm32mp1 platform and ARM SMC mailbox driver used as communication channel for SCMI messages between non-secure world and secure SCMI server.
Signed-off-by Patrick Delaunay <[email protected]>---
configs/stm32mp15_trusted_defconfig | 2 ++ 1 file changed, 2 insertions(+)configs/stm32mp15_trusted_defconfig +1
-0@@ -51,6 +51,7 @@ CONFIG_ENV_UBI_VOLUME="uboot_config" CONFIG_ENV_UBI_VOLUME_REDUND="uboot_config_r" CONFIG_SYS_RELOC_GD_ENV_ADDR=y CONFIG_STM32_ADC=y +CONFIG_CLK_SCMI=y CONFIG_SET_DFU_ALT_INFO=y CONFIG_USB_FUNCTION_FASTBOOT=y CONFIG_FASTBOOT_BUF_ADDR=0xC0000000
configs/stm32mp15_trusted_defconfig CONFIG_DM_REGULATOR_GPIO=y · line 114
Quoted 7 lines
configs/stm32mp15_trusted_defconfig +1
-0@@ -107,6 +108,7 @@ CONFIG_DM_REGULATOR_GPIO=y CONFIG_DM_REGULATOR_STM32_VREFBUF=y CONFIG_DM_REGULATOR_STPMIC1=y CONFIG_REMOTEPROC_STM32_COPRO=y +CONFIG_RESET_SCMI=y CONFIG_DM_RNG=y CONFIG_RNG_STM32MP1=y CONFIG_DM_RTC=y
Thanks
Patrice