mirror of
				https://github.com/smaeul/u-boot.git
				synced 2025-10-31 03:58:17 +00:00 
			
		
		
		
	The header file is not necessary in either of those files, remove it as common.h is going away. Include missing asm/arch/rmobile.h in board/renesas/rcar-common/v3-common.c to prevent build failure of r8a77970_eagle r8a779a0_falcon r8a77980_v3hsk and r8a77970_v3msk . Include missing asm/u-boot.h in falcon.c and grpeach.c to fix build failure due to missing definition of struct bd_info . Include errno.h in grpeach.c to fix build error due to missing definition of EINVAL. Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org> Reviewed-by: Paul Barker <paul.barker.ct@bp.renesas.com>
		
			
				
	
	
		
			67 lines
		
	
	
		
			1.2 KiB
		
	
	
	
		
			C
		
	
	
	
	
	
			
		
		
	
	
			67 lines
		
	
	
		
			1.2 KiB
		
	
	
	
		
			C
		
	
	
	
	
	
| // SPDX-License-Identifier: GPL-2.0+
 | |
| /*
 | |
|  * board/renesas/spider/spider.c
 | |
|  *     This file is Spider board support.
 | |
|  *
 | |
|  * Copyright (C) 2021 Renesas Electronics Corp.
 | |
|  */
 | |
| 
 | |
| #include <asm/arch/rmobile.h>
 | |
| #include <asm/arch/sys_proto.h>
 | |
| #include <asm/global_data.h>
 | |
| #include <asm/io.h>
 | |
| #include <asm/mach-types.h>
 | |
| #include <asm/processor.h>
 | |
| #include <asm/system.h>
 | |
| #include <linux/errno.h>
 | |
| 
 | |
| DECLARE_GLOBAL_DATA_PTR;
 | |
| 
 | |
| static void init_generic_timer(void)
 | |
| {
 | |
| 	const u32 freq = CONFIG_SYS_CLK_FREQ;
 | |
| 
 | |
| 	/* Update memory mapped and register based freqency */
 | |
| 	asm volatile ("msr cntfrq_el0, %0" :: "r" (freq));
 | |
| 	writel(freq, CNTFID0);
 | |
| 
 | |
| 	/* Enable counter */
 | |
| 	setbits_le32(CNTCR_BASE, CNTCR_EN);
 | |
| }
 | |
| 
 | |
| static void init_gic_v3(void)
 | |
| {
 | |
| 	 /* GIC v3 power on */
 | |
| 	writel(BIT(1), GICR_LPI_PWRR);
 | |
| 
 | |
| 	/* Wait till the WAKER_CA_BIT changes to 0 */
 | |
| 	clrbits_le32(GICR_LPI_WAKER, BIT(1));
 | |
| 	while (readl(GICR_LPI_WAKER) & BIT(2))
 | |
| 		;
 | |
| 
 | |
| 	writel(0xffffffff, GICR_SGI_BASE + GICR_IGROUPR0);
 | |
| }
 | |
| 
 | |
| void s_init(void)
 | |
| {
 | |
| 	if (current_el() == 3)
 | |
| 		init_generic_timer();
 | |
| }
 | |
| 
 | |
| int board_early_init_f(void)
 | |
| {
 | |
| 	/* Unlock CPG access */
 | |
| 	writel(0x5A5AFFFF, CPGWPR);
 | |
| 	writel(0xA5A50000, CPGWPCR);
 | |
| 
 | |
| 	return 0;
 | |
| }
 | |
| 
 | |
| int board_init(void)
 | |
| {
 | |
| 	if (current_el() == 3)
 | |
| 		init_gic_v3();
 | |
| 
 | |
| 	return 0;
 | |
| }
 |