1 /* SPDX-License-Identifier: GPL-2.0+ */
3 * Copyright (C) 2014 Freescale Semiconductor
10 #include <linux/bitops.h>
12 #define MC_CCSR_BASE_ADDR \
13 ((struct mc_ccsr_registers __iomem *)0x8340000)
15 #define GCR1_P1_STOP BIT(31)
16 #define GCR1_P2_STOP BIT(30)
17 #define GCR1_P1_DE_RST BIT(23)
18 #define GCR1_P2_DE_RST BIT(22)
19 #define GCR1_M1_DE_RST BIT(15)
20 #define GCR1_M2_DE_RST BIT(14)
21 #define GCR1_M_ALL_DE_RST (GCR1_M1_DE_RST | GCR1_M2_DE_RST)
22 #define GSR_FS_MASK 0x3fffffff
24 #define SOC_MC_PORTALS_BASE_ADDR ((void __iomem *)0x00080C000000)
25 #define SOC_QBMAN_PORTALS_BASE_ADDR ((void __iomem *)0x000818000000)
26 #define SOC_MC_PORTAL_STRIDE 0x10000
28 #define SOC_MC_PORTAL_ADDR(_portal_id) \
29 ((void __iomem *)((uintptr_t)SOC_MC_PORTALS_BASE_ADDR + \
30 (_portal_id) * SOC_MC_PORTAL_STRIDE))
32 #define MC_PORTAL_OFFSET_TO_PORTAL_ID(_portal_offset) \
33 ((_portal_offset) / SOC_MC_PORTAL_STRIDE)
35 struct mc_ccsr_registers {
55 void fdt_fsl_mc_fixup_iommu_map_entry(void *blob);
56 int get_mc_boot_status(void);
57 int get_dpl_apply_status(void);
58 int is_lazy_dpl_addr_valid(void);
59 void fdt_fixup_mc_ddr(u64 *base, u64 *size);
60 #ifdef CONFIG_SYS_LS_MC_DRAM_AIOP_IMG_OFFSET
61 int get_aiop_apply_status(void);
63 u64 mc_get_dram_addr(void);
64 unsigned long mc_get_dram_block_size(void);
65 int fsl_mc_ldpaa_init(struct bd_info *bis);
66 int fsl_mc_ldpaa_exit(struct bd_info *bd);
67 void mc_env_boot(void);