xref: /rk3399_rockchip-uboot/include/fsl-mc/fsl_mc.h (revision fb4a87a73785ad4d6e204978ad727564f9fb58a4)
17b3bd9a7SJ. German Rivera /*
27b3bd9a7SJ. German Rivera  * Copyright (C) 2014 Freescale Semiconductor
37b3bd9a7SJ. German Rivera  *
47b3bd9a7SJ. German Rivera  * SPDX-License-Identifier:	GPL-2.0+
57b3bd9a7SJ. German Rivera  */
67b3bd9a7SJ. German Rivera 
77b3bd9a7SJ. German Rivera #ifndef __FSL_MC_H__
87b3bd9a7SJ. German Rivera #define __FSL_MC_H__
97b3bd9a7SJ. German Rivera 
107b3bd9a7SJ. German Rivera #include <common.h>
117b3bd9a7SJ. German Rivera 
127b3bd9a7SJ. German Rivera #define MC_CCSR_BASE_ADDR \
137b3bd9a7SJ. German Rivera 	((struct mc_ccsr_registers __iomem *)0x8340000)
147b3bd9a7SJ. German Rivera 
157b3bd9a7SJ. German Rivera #define GCR1_P1_STOP		BIT(31)
167b3bd9a7SJ. German Rivera #define GCR1_P2_STOP		BIT(30)
177b3bd9a7SJ. German Rivera #define GCR1_P1_DE_RST		BIT(23)
187b3bd9a7SJ. German Rivera #define GCR1_P2_DE_RST		BIT(22)
197b3bd9a7SJ. German Rivera #define GCR1_M1_DE_RST		BIT(15)
207b3bd9a7SJ. German Rivera #define GCR1_M2_DE_RST		BIT(14)
217b3bd9a7SJ. German Rivera #define GCR1_M_ALL_DE_RST	(GCR1_M1_DE_RST | GCR1_M2_DE_RST)
227b3bd9a7SJ. German Rivera #define GSR_FS_MASK		0x3fffffff
237b3bd9a7SJ. German Rivera 
247b3bd9a7SJ. German Rivera #define SOC_MC_PORTALS_BASE_ADDR    ((void __iomem *)0x00080C000000)
251f1c25c7SPrabhakar Kushwaha #define SOC_QBMAN_PORTALS_BASE_ADDR ((void __iomem *)0x000818000000)
267b3bd9a7SJ. German Rivera #define SOC_MC_PORTAL_STRIDE	    0x10000
277b3bd9a7SJ. German Rivera 
287b3bd9a7SJ. German Rivera #define SOC_MC_PORTAL_ADDR(_portal_id) \
297b3bd9a7SJ. German Rivera 	((void __iomem *)((uintptr_t)SOC_MC_PORTALS_BASE_ADDR + \
307b3bd9a7SJ. German Rivera 	 (_portal_id) * SOC_MC_PORTAL_STRIDE))
317b3bd9a7SJ. German Rivera 
327b3bd9a7SJ. German Rivera struct mc_ccsr_registers {
337b3bd9a7SJ. German Rivera 	u32 reg_gcr1;
347b3bd9a7SJ. German Rivera 	u32 reserved1;
357b3bd9a7SJ. German Rivera 	u32 reg_gsr;
367b3bd9a7SJ. German Rivera 	u32 reserved2;
377b3bd9a7SJ. German Rivera 	u32 reg_sicbalr;
387b3bd9a7SJ. German Rivera 	u32 reg_sicbahr;
397b3bd9a7SJ. German Rivera 	u32 reg_sicapr;
407b3bd9a7SJ. German Rivera 	u32 reserved3;
417b3bd9a7SJ. German Rivera 	u32 reg_mcfbalr;
427b3bd9a7SJ. German Rivera 	u32 reg_mcfbahr;
437b3bd9a7SJ. German Rivera 	u32 reg_mcfapr;
447b3bd9a7SJ. German Rivera 	u32 reserved4[0x2f1];
457b3bd9a7SJ. German Rivera 	u32 reg_psr;
467b3bd9a7SJ. German Rivera 	u32 reserved5;
477b3bd9a7SJ. German Rivera 	u32 reg_brr[2];
487b3bd9a7SJ. German Rivera 	u32 reserved6[0x80];
497b3bd9a7SJ. German Rivera 	u32 reg_error[];
507b3bd9a7SJ. German Rivera };
517b3bd9a7SJ. German Rivera 
527b3bd9a7SJ. German Rivera int get_mc_boot_status(void);
53*fb4a87a7SPrabhakar Kushwaha int get_dpl_apply_status(void);
54*fb4a87a7SPrabhakar Kushwaha #ifdef CONFIG_SYS_LS_MC_DRAM_AIOP_IMG_OFFSET
55*fb4a87a7SPrabhakar Kushwaha int get_aiop_apply_status(void);
56*fb4a87a7SPrabhakar Kushwaha #endif
57*fb4a87a7SPrabhakar Kushwaha u64 mc_get_dram_addr(void);
58422cb08aSBhupesh Sharma unsigned long mc_get_dram_block_size(void);
59a2a55e51SPrabhakar Kushwaha int fsl_mc_ldpaa_init(bd_t *bis);
60a2a55e51SPrabhakar Kushwaha void fsl_mc_ldpaa_exit(bd_t *bis);
617b3bd9a7SJ. German Rivera #endif
62