From af1a266670d040d2f4083ff309d732d648afba2a Mon Sep 17 00:00:00 2001 From: Angelos Mouzakitis <a.mouzakitis@virtualopensystems.com> Date: Tue, 10 Oct 2023 14:33:42 +0000 Subject: Add submodule dependency files Change-Id: Iaf8d18082d3991dec7c0ebbea540f092188eb4ec --- .../arch/mips/mach-mtmips/include/mach/ddr.h | 56 ++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 roms/u-boot/arch/mips/mach-mtmips/include/mach/ddr.h (limited to 'roms/u-boot/arch/mips/mach-mtmips/include/mach/ddr.h') diff --git a/roms/u-boot/arch/mips/mach-mtmips/include/mach/ddr.h b/roms/u-boot/arch/mips/mach-mtmips/include/mach/ddr.h new file mode 100644 index 000000000..15ff66ace --- /dev/null +++ b/roms/u-boot/arch/mips/mach-mtmips/include/mach/ddr.h @@ -0,0 +1,56 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* + * Copyright (C) 2020 MediaTek Inc. + * + * Author: Weijie Gao <weijie.gao@mediatek.com> + */ + +#ifndef _MTMIPS_DDR_H_ +#define _MTMIPS_DDR_H_ + +#include <linux/io.h> +#include <linux/types.h> + +enum mc_dram_size { + DRAM_8MB, + DRAM_16MB, + DRAM_32MB, + DRAM_64MB, + DRAM_128MB, + DRAM_256MB, + + __DRAM_SZ_MAX +}; + +struct mc_ddr_cfg { + u32 cfg0; + u32 cfg1; + u32 cfg2; + u32 cfg3; + u32 cfg4; +}; + +typedef void (*mc_reset_t)(int assert); + +struct mc_ddr_init_param { + void __iomem *memc; + + u32 sdr_cfg0; + u32 sdr_cfg1; + + u32 dq_dly; + u32 dqs_dly; + + const struct mc_ddr_cfg *cfgs; + mc_reset_t mc_reset; + + u32 memsize; + u32 bus_width; +}; + +void sdr_init(struct mc_ddr_init_param *param); +void ddr1_init(struct mc_ddr_init_param *param); +void ddr2_init(struct mc_ddr_init_param *param); +void ddr_calibrate(void __iomem *memc, u32 memsize, u32 bw); + +#endif /* _MTMIPS_DDR_H_ */ -- cgit