2018-05-06 21:58:06 +00:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0+ */
|
2014-06-23 22:15:55 +00:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2014 Freescale Semiconductor
|
2021-10-07 10:07:44 +00:00
|
|
|
* Copyright 2021 NXP
|
2014-06-23 22:15:55 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __FSL_MC_H__
|
|
|
|
#define __FSL_MC_H__
|
|
|
|
|
|
|
|
#include <common.h>
|
2020-05-10 17:40:13 +00:00
|
|
|
#include <linux/bitops.h>
|
2014-06-23 22:15:55 +00:00
|
|
|
|
|
|
|
#define MC_CCSR_BASE_ADDR \
|
|
|
|
((struct mc_ccsr_registers __iomem *)0x8340000)
|
|
|
|
|
|
|
|
#define GCR1_P1_STOP BIT(31)
|
|
|
|
#define GCR1_P2_STOP BIT(30)
|
|
|
|
#define GCR1_P1_DE_RST BIT(23)
|
|
|
|
#define GCR1_P2_DE_RST BIT(22)
|
|
|
|
#define GCR1_M1_DE_RST BIT(15)
|
|
|
|
#define GCR1_M2_DE_RST BIT(14)
|
|
|
|
#define GCR1_M_ALL_DE_RST (GCR1_M1_DE_RST | GCR1_M2_DE_RST)
|
|
|
|
#define GSR_FS_MASK 0x3fffffff
|
|
|
|
|
|
|
|
#define SOC_MC_PORTALS_BASE_ADDR ((void __iomem *)0x00080C000000)
|
2015-07-02 05:58:59 +00:00
|
|
|
#define SOC_QBMAN_PORTALS_BASE_ADDR ((void __iomem *)0x000818000000)
|
2014-06-23 22:15:55 +00:00
|
|
|
#define SOC_MC_PORTAL_STRIDE 0x10000
|
|
|
|
|
|
|
|
#define SOC_MC_PORTAL_ADDR(_portal_id) \
|
|
|
|
((void __iomem *)((uintptr_t)SOC_MC_PORTALS_BASE_ADDR + \
|
|
|
|
(_portal_id) * SOC_MC_PORTAL_STRIDE))
|
|
|
|
|
2015-11-04 06:55:59 +00:00
|
|
|
#define MC_PORTAL_OFFSET_TO_PORTAL_ID(_portal_offset) \
|
|
|
|
((_portal_offset) / SOC_MC_PORTAL_STRIDE)
|
|
|
|
|
2014-06-23 22:15:55 +00:00
|
|
|
struct mc_ccsr_registers {
|
|
|
|
u32 reg_gcr1;
|
|
|
|
u32 reserved1;
|
|
|
|
u32 reg_gsr;
|
|
|
|
u32 reserved2;
|
|
|
|
u32 reg_sicbalr;
|
|
|
|
u32 reg_sicbahr;
|
|
|
|
u32 reg_sicapr;
|
|
|
|
u32 reserved3;
|
|
|
|
u32 reg_mcfbalr;
|
|
|
|
u32 reg_mcfbahr;
|
|
|
|
u32 reg_mcfapr;
|
|
|
|
u32 reserved4[0x2f1];
|
|
|
|
u32 reg_psr;
|
|
|
|
u32 reserved5;
|
|
|
|
u32 reg_brr[2];
|
|
|
|
u32 reserved6[0x80];
|
|
|
|
u32 reg_error[];
|
|
|
|
};
|
|
|
|
|
2021-10-07 10:07:44 +00:00
|
|
|
struct log_header {
|
|
|
|
u32 magic_word;
|
|
|
|
char reserved[4];
|
|
|
|
u32 buf_start;
|
|
|
|
u32 buf_length;
|
|
|
|
u32 last_byte;
|
|
|
|
};
|
|
|
|
|
2018-08-20 10:31:14 +00:00
|
|
|
void fdt_fsl_mc_fixup_iommu_map_entry(void *blob);
|
2014-06-23 22:15:55 +00:00
|
|
|
int get_mc_boot_status(void);
|
2015-11-04 06:55:58 +00:00
|
|
|
int get_dpl_apply_status(void);
|
2018-12-18 13:01:17 +00:00
|
|
|
int is_lazy_dpl_addr_valid(void);
|
2019-05-23 09:43:43 +00:00
|
|
|
void fdt_fixup_mc_ddr(u64 *base, u64 *size);
|
2023-09-27 15:30:47 +00:00
|
|
|
void fdt_reserve_mc_mem(void *blob, u32 mc_icid);
|
2022-11-16 18:10:41 +00:00
|
|
|
#ifdef CFG_SYS_LS_MC_DRAM_AIOP_IMG_OFFSET
|
2015-11-04 06:55:58 +00:00
|
|
|
int get_aiop_apply_status(void);
|
|
|
|
#endif
|
|
|
|
u64 mc_get_dram_addr(void);
|
2015-03-19 16:20:43 +00:00
|
|
|
unsigned long mc_get_dram_block_size(void);
|
2020-06-26 06:13:33 +00:00
|
|
|
int fsl_mc_ldpaa_init(struct bd_info *bis);
|
|
|
|
int fsl_mc_ldpaa_exit(struct bd_info *bd);
|
2017-05-24 16:40:21 +00:00
|
|
|
void mc_env_boot(void);
|
2014-06-23 22:15:55 +00:00
|
|
|
#endif
|