mirror of
				https://github.com/Ysurac/openmptcprouter.git
				synced 2025-03-09 15:40:20 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			72 lines
		
	
	
	
		
			3 KiB
		
	
	
	
		
			Diff
		
	
	
	
	
	
			
		
		
	
	
			72 lines
		
	
	
	
		
			3 KiB
		
	
	
	
		
			Diff
		
	
	
	
	
	
| From 734b9d9e33919efbec63b1bfe48f25ce16dbd59a Mon Sep 17 00:00:00 2001
 | |
| From: Jonas Karlman <jonas@kwiboo.se>
 | |
| Date: Fri, 17 Mar 2023 19:16:45 +0000
 | |
| Subject: [PATCH] clk: scmi: Add Kconfig option for SPL
 | |
| 
 | |
| Building U-Boot SPL with CLK_SCMI and SCMI_FIRMWARE Kconfig options
 | |
| enabled and SPL_FIRMWARE disabled result in the following error.
 | |
| 
 | |
|   drivers/clk/clk_scmi.o: in function `scmi_clk_gate':
 | |
|   drivers/clk/clk_scmi.c:84: undefined reference to `devm_scmi_process_msg'
 | |
|   drivers/clk/clk_scmi.c:88: undefined reference to `scmi_to_linux_errno'
 | |
|   drivers/clk/clk_scmi.o: in function `scmi_clk_get_rate':
 | |
|   drivers/clk/clk_scmi.c:113: undefined reference to `devm_scmi_process_msg'
 | |
|   drivers/clk/clk_scmi.c:117: undefined reference to `scmi_to_linux_errno'
 | |
|   drivers/clk/clk_scmi.o: in function `scmi_clk_set_rate':
 | |
|   drivers/clk/clk_scmi.c:139: undefined reference to `devm_scmi_process_msg'
 | |
|   drivers/clk/clk_scmi.c:143: undefined reference to `scmi_to_linux_errno'
 | |
|   drivers/clk/clk_scmi.o: in function `scmi_clk_probe':
 | |
|   drivers/clk/clk_scmi.c:157: undefined reference to `devm_scmi_of_get_channel'
 | |
|   make[1]: *** [scripts/Makefile.spl:527: spl/u-boot-spl] Error 1
 | |
|   make: *** [Makefile:2043: spl/u-boot-spl] Error 2
 | |
| 
 | |
| Add Kconfig option so that CLK_SCMI can be disabled in SPL to fix this.
 | |
| 
 | |
| Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
 | |
| Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
 | |
| Link: https://patchwork.ozlabs.org/project/uboot/patch/20230317191638.2558279-2-jonas@kwiboo.se/
 | |
| ---
 | |
|  drivers/clk/Kconfig                       | 8 ++++++++
 | |
|  drivers/clk/Makefile                      | 2 +-
 | |
|  drivers/firmware/scmi/scmi_agent-uclass.c | 2 +-
 | |
|  3 files changed, 10 insertions(+), 2 deletions(-)
 | |
| 
 | |
| --- a/drivers/clk/Kconfig
 | |
| +++ b/drivers/clk/Kconfig
 | |
| @@ -166,6 +166,14 @@ config CLK_SCMI
 | |
|  	  by a SCMI agent based on SCMI clock protocol communication
 | |
|  	  with a SCMI server.
 | |
|  
 | |
| +config SPL_CLK_SCMI
 | |
| +	bool "Enable SCMI clock driver in SPL"
 | |
| +	depends on SCMI_FIRMWARE && SPL_FIRMWARE
 | |
| +	help
 | |
| +	  Enable this option if you want to support clock devices exposed
 | |
| +	  by a SCMI agent based on SCMI clock protocol communication
 | |
| +	  with a SCMI server in SPL.
 | |
| +
 | |
|  config CLK_HSDK
 | |
|  	bool "Enable cgu clock driver for HSDK boards"
 | |
|  	depends on CLK && TARGET_HSDK
 | |
| --- a/drivers/clk/Makefile
 | |
| +++ b/drivers/clk/Makefile
 | |
| @@ -39,7 +39,7 @@ obj-$(CONFIG_CLK_MVEBU) += mvebu/
 | |
|  obj-$(CONFIG_CLK_OCTEON) += clk_octeon.o
 | |
|  obj-$(CONFIG_CLK_OWL) += owl/
 | |
|  obj-$(CONFIG_CLK_RENESAS) += renesas/
 | |
| -obj-$(CONFIG_CLK_SCMI) += clk_scmi.o
 | |
| +obj-$(CONFIG_$(SPL_TPL_)CLK_SCMI) += clk_scmi.o
 | |
|  obj-$(CONFIG_CLK_SIFIVE) += sifive/
 | |
|  obj-$(CONFIG_CLK_UNIPHIER) += uniphier/
 | |
|  obj-$(CONFIG_CLK_VERSACLOCK) += clk_versaclock.o
 | |
| --- a/drivers/firmware/scmi/scmi_agent-uclass.c
 | |
| +++ b/drivers/firmware/scmi/scmi_agent-uclass.c
 | |
| @@ -75,7 +75,7 @@ static int scmi_bind_protocols(struct udevice *dev)
 | |
|  		name = ofnode_get_name(node);
 | |
|  		switch (protocol_id) {
 | |
|  		case SCMI_PROTOCOL_ID_CLOCK:
 | |
| -			if (IS_ENABLED(CONFIG_CLK_SCMI))
 | |
| +			if (CONFIG_IS_ENABLED(CLK_SCMI))
 | |
|  				drv = DM_DRIVER_GET(scmi_clock);
 | |
|  			break;
 | |
|  		case SCMI_PROTOCOL_ID_RESET_DOMAIN:
 |