imx8m: soc: probe clock device in arch_cpu_init_dm
Because we need to get cpu freq in print_cpuinfo at very early stage, so we need to make sure the ccm be probed. Signed-off-by: Peng Fan <peng.fan@nxp.com>
This commit is contained in:
		
							parent
							
								
									e89d211f30
								
							
						
					
					
						commit
						e663c703b1
					
				| 
						 | 
					@ -14,6 +14,7 @@
 | 
				
			||||||
#include <asm/mach-imx/boot_mode.h>
 | 
					#include <asm/mach-imx/boot_mode.h>
 | 
				
			||||||
#include <asm/mach-imx/syscounter.h>
 | 
					#include <asm/mach-imx/syscounter.h>
 | 
				
			||||||
#include <asm/armv8/mmu.h>
 | 
					#include <asm/armv8/mmu.h>
 | 
				
			||||||
 | 
					#include <dm/uclass.h>
 | 
				
			||||||
#include <errno.h>
 | 
					#include <errno.h>
 | 
				
			||||||
#include <fdt_support.h>
 | 
					#include <fdt_support.h>
 | 
				
			||||||
#include <fsl_wdog.h>
 | 
					#include <fsl_wdog.h>
 | 
				
			||||||
| 
						 | 
					@ -228,6 +229,22 @@ static void imx_set_wdog_powerdown(bool enable)
 | 
				
			||||||
	writew(enable, &wdog3->wmcr);
 | 
						writew(enable, &wdog3->wmcr);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					int arch_cpu_init_dm(void)
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
						struct udevice *dev;
 | 
				
			||||||
 | 
						int ret;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						ret = uclass_get_device_by_name(UCLASS_CLK,
 | 
				
			||||||
 | 
										"clock-controller@30380000",
 | 
				
			||||||
 | 
										&dev);
 | 
				
			||||||
 | 
						if (ret < 0) {
 | 
				
			||||||
 | 
							printf("Failed to find clock node. Check device tree\n");
 | 
				
			||||||
 | 
							return ret;
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						return 0;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
int arch_cpu_init(void)
 | 
					int arch_cpu_init(void)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	struct ocotp_regs *ocotp = (struct ocotp_regs *)OCOTP_BASE_ADDR;
 | 
						struct ocotp_regs *ocotp = (struct ocotp_regs *)OCOTP_BASE_ADDR;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue