GK SDK 源码库: XMIPCLinuxV100R005C00SPC030 (kernel/tools/open_source excluded)
This commit is contained in:
@@ -0,0 +1,50 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0+ */
|
||||
/*
|
||||
* Copyright (C) 2014-2017 Altera Corporation <www.altera.com>
|
||||
*/
|
||||
|
||||
#ifndef _SOCFPGA_A10_BASE_HARDWARE_H_
|
||||
#define _SOCFPGA_A10_BASE_HARDWARE_H_
|
||||
|
||||
#define SOCFPGA_EMAC0_ADDRESS 0xff800000
|
||||
#define SOCFPGA_EMAC1_ADDRESS 0xff802000
|
||||
#define SOCFPGA_EMAC2_ADDRESS 0xff804000
|
||||
#define SOCFPGA_SDMMC_ADDRESS 0xff808000
|
||||
#define SOCFPGA_QSPIREGS_ADDRESS 0xff809000
|
||||
#define SOCFPGA_QSPIDATA_ADDRESS 0xffa00000
|
||||
#define SOCFPGA_UART1_ADDRESS 0xffc02100
|
||||
#define SOCFPGA_HMC_MMR_IO48_ADDRESS 0xffcfa000
|
||||
#define SOCFPGA_FPGAMGRDATA_ADDRESS 0xffcfe400
|
||||
#define SOCFPGA_FPGAMGRREGS_ADDRESS 0xffd03000
|
||||
#define SOCFPGA_L4WD0_ADDRESS 0xffd00200
|
||||
#define SOCFPGA_SYSMGR_ADDRESS 0xffd06000
|
||||
#define SOCFPGA_PINMUX_SHARED_3V_IO_ADDRESS 0xffd07000
|
||||
#define SOCFPGA_PINMUX_DEDICATED_IO_ADDRESS 0xffd07200
|
||||
#define SOCFPGA_PINMUX_DEDICATED_IO_CFG_ADDRESS 0xffd07300
|
||||
#define SOCFPGA_PINMUX_FPGA_INTERFACE_ADDRESS 0xffd07400
|
||||
#define SOCFPGA_DMANONSECURE_ADDRESS 0xffda0000
|
||||
#define SOCFPGA_DMASECURE_ADDRESS 0xffda1000
|
||||
#define SOCFPGA_MPUSCU_ADDRESS 0xffffc000
|
||||
#define SOCFPGA_MPUL2_ADDRESS 0xfffff000
|
||||
#define SOCFPGA_I2C0_ADDRESS 0xffc02200
|
||||
#define SOCFPGA_I2C1_ADDRESS 0xffc02300
|
||||
#define SOCFPGA_I2C2_ADDRESS 0xffc02400
|
||||
#define SOCFPGA_I2C3_ADDRESS 0xffc02500
|
||||
#define SOCFPGA_I2C4_ADDRESS 0xffc02600
|
||||
|
||||
#define SOCFPGA_ECC_OCRAM_ADDRESS 0xff8c3000
|
||||
#define SOCFPGA_UART0_ADDRESS 0xffc02000
|
||||
#define SOCFPGA_OSC1TIMER0_ADDRESS 0xffd00000
|
||||
#define SOCFPGA_OSC1TIMER1_ADDRESS 0xffd00100
|
||||
#define SOCFPGA_CLKMGR_ADDRESS 0xffd04000
|
||||
#define SOCFPGA_RSTMGR_ADDRESS 0xffd05000
|
||||
|
||||
#define SOCFPGA_SDR_ADDRESS 0xffcfb000
|
||||
#define SOCFPGA_NOC_L4_PRIV_FLT_OFST 0xffd11000
|
||||
#define SOCFPGA_SDR_SCHEDULER_ADDRESS 0xffd12400
|
||||
#define SOCFPGA_SDR_FIREWALL_OCRAM_ADDRESS 0xffd13200
|
||||
#define SOCFPGA_SDR_FIREWALL_MPU_FPGA_ADDRESS 0xffd13300
|
||||
#define SOCFPGA_SDR_FIREWALL_L3_ADDRESS 0xffd13400
|
||||
#define SOCFPGA_NOC_FW_H2F_SCR_OFST 0xffd13500
|
||||
|
||||
#endif /* _SOCFPGA_A10_BASE_HARDWARE_H_ */
|
||||
@@ -0,0 +1,62 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0+ */
|
||||
/*
|
||||
* Copyright (C) 2012 Altera Corporation <www.altera.com>
|
||||
*/
|
||||
|
||||
#ifndef _SOCFPGA_BASE_ADDRS_H_
|
||||
#define _SOCFPGA_BASE_ADDRS_H_
|
||||
|
||||
#define SOCFPGA_FPGA_SLAVES_ADDRESS 0xc0000000
|
||||
#define SOCFPGA_STM_ADDRESS 0xfc000000
|
||||
#define SOCFPGA_DAP_ADDRESS 0xff000000
|
||||
#define SOCFPGA_EMAC0_ADDRESS 0xff700000
|
||||
#define SOCFPGA_EMAC1_ADDRESS 0xff702000
|
||||
#define SOCFPGA_SDMMC_ADDRESS 0xff704000
|
||||
#define SOCFPGA_QSPI_ADDRESS 0xff705000
|
||||
#define SOCFPGA_GPIO0_ADDRESS 0xff708000
|
||||
#define SOCFPGA_GPIO1_ADDRESS 0xff709000
|
||||
#define SOCFPGA_GPIO2_ADDRESS 0xff70a000
|
||||
#define SOCFPGA_L3REGS_ADDRESS 0xff800000
|
||||
#define SOCFPGA_USB0_ADDRESS 0xffb00000
|
||||
#define SOCFPGA_USB1_ADDRESS 0xffb40000
|
||||
#define SOCFPGA_CAN0_ADDRESS 0xffc00000
|
||||
#define SOCFPGA_CAN1_ADDRESS 0xffc01000
|
||||
#define SOCFPGA_UART0_ADDRESS 0xffc02000
|
||||
#define SOCFPGA_UART1_ADDRESS 0xffc03000
|
||||
#define SOCFPGA_I2C0_ADDRESS 0xffc04000
|
||||
#define SOCFPGA_I2C1_ADDRESS 0xffc05000
|
||||
#define SOCFPGA_I2C2_ADDRESS 0xffc06000
|
||||
#define SOCFPGA_I2C3_ADDRESS 0xffc07000
|
||||
#define SOCFPGA_SDR_ADDRESS 0xffc20000
|
||||
#define SOCFPGA_L4WD0_ADDRESS 0xffd02000
|
||||
#define SOCFPGA_L4WD1_ADDRESS 0xffd03000
|
||||
#define SOCFPGA_CLKMGR_ADDRESS 0xffd04000
|
||||
#define SOCFPGA_RSTMGR_ADDRESS 0xffd05000
|
||||
#define SOCFPGA_SYSMGR_ADDRESS 0xffd08000
|
||||
#define SOCFPGA_SPIS0_ADDRESS 0xffe02000
|
||||
#define SOCFPGA_SPIS1_ADDRESS 0xffe03000
|
||||
#define SOCFPGA_SPIM0_ADDRESS 0xfff00000
|
||||
#define SOCFPGA_SPIM1_ADDRESS 0xfff01000
|
||||
#define SOCFPGA_SCANMGR_ADDRESS 0xfff02000
|
||||
#define SOCFPGA_ROM_ADDRESS 0xfffd0000
|
||||
#define SOCFPGA_MPUSCU_ADDRESS 0xfffec000
|
||||
#define SOCFPGA_MPUL2_ADDRESS 0xfffef000
|
||||
#define SOCFPGA_OCRAM_ADDRESS 0xffff0000
|
||||
#define SOCFPGA_LWFPGASLAVES_ADDRESS 0xff200000
|
||||
#define SOCFPGA_LWHPS2FPGAREGS_ADDRESS 0xff400000
|
||||
#define SOCFPGA_HPS2FPGAREGS_ADDRESS 0xff500000
|
||||
#define SOCFPGA_FPGA2HPSREGS_ADDRESS 0xff600000
|
||||
#define SOCFPGA_FPGAMGRREGS_ADDRESS 0xff706000
|
||||
#define SOCFPGA_ACPIDMAP_ADDRESS 0xff707000
|
||||
#define SOCFPGA_NANDDATA_ADDRESS 0xff900000
|
||||
#define SOCFPGA_QSPIDATA_ADDRESS 0xffa00000
|
||||
#define SOCFPGA_NANDREGS_ADDRESS 0xffb80000
|
||||
#define SOCFPGA_FPGAMGRDATA_ADDRESS 0xffb90000
|
||||
#define SOCFPGA_SPTIMER0_ADDRESS 0xffc08000
|
||||
#define SOCFPGA_SPTIMER1_ADDRESS 0xffc09000
|
||||
#define SOCFPGA_OSC1TIMER0_ADDRESS 0xffd00000
|
||||
#define SOCFPGA_OSC1TIMER1_ADDRESS 0xffd01000
|
||||
#define SOCFPGA_DMANONSECURE_ADDRESS 0xffe00000
|
||||
#define SOCFPGA_DMASECURE_ADDRESS 0xffe01000
|
||||
|
||||
#endif /* _SOCFPGA_BASE_ADDRS_H_ */
|
||||
@@ -0,0 +1,43 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0 */
|
||||
/*
|
||||
* Copyright (C) 2016-2017 Intel Corporation <www.intel.com>
|
||||
*/
|
||||
|
||||
#ifndef _SOCFPGA_S10_BASE_HARDWARE_H_
|
||||
#define _SOCFPGA_S10_BASE_HARDWARE_H_
|
||||
|
||||
#define SOCFPGA_CCU_ADDRESS 0xf7000000
|
||||
#define SOCFPGA_SDR_SCHEDULER_ADDRESS 0xf8000400
|
||||
#define SOCFPGA_HMC_MMR_IO48_ADDRESS 0xf8010000
|
||||
#define SOCFPGA_SDR_ADDRESS 0xf8011000
|
||||
#define SOCFPGA_FW_MPU_DDR_SCR_ADDRESS 0xf8020100
|
||||
#define SOCFPGA_SMMU_ADDRESS 0xfa000000
|
||||
#define SOCFPGA_MAILBOX_ADDRESS 0xffa30000
|
||||
#define SOCFPGA_UART0_ADDRESS 0xffc02000
|
||||
#define SOCFPGA_UART1_ADDRESS 0xffc02100
|
||||
#define SOCFPGA_SPTIMER0_ADDRESS 0xffc03000
|
||||
#define SOCFPGA_SPTIMER1_ADDRESS 0xffc03100
|
||||
#define SOCFPGA_SYSTIMER0_ADDRESS 0xffd00000
|
||||
#define SOCFPGA_SYSTIMER1_ADDRESS 0xffd00100
|
||||
#define SOCFPGA_L4WD0_ADDRESS 0xffd00200
|
||||
#define SOCFPGA_L4WD1_ADDRESS 0xffd00300
|
||||
#define SOCFPGA_L4WD2_ADDRESS 0xffd00400
|
||||
#define SOCFPGA_L4WD3_ADDRESS 0xffd00500
|
||||
#define SOCFPGA_GTIMER_SEC_ADDRESS 0xffd01000
|
||||
#define SOCFPGA_GTIMER_NSEC_ADDRESS 0xffd02000
|
||||
#define SOCFPGA_CLKMGR_ADDRESS 0xffd10000
|
||||
#define SOCFPGA_RSTMGR_ADDRESS 0xffd11000
|
||||
#define SOCFPGA_SYSMGR_ADDRESS 0xffd12000
|
||||
#define SOCFPGA_PINMUX_DEDICATED_IO_ADDRESS 0xffd13000
|
||||
#define SOCFPGA_FIREWALL_L4_PER 0xffd21000
|
||||
#define SOCFPGA_FIREWALL_L4_SYS 0xffd21100
|
||||
#define SOCFPGA_FIREWALL_SOC2FPGA 0xffd21200
|
||||
#define SOCFPGA_FIREWALL_LWSOC2FPGA 0xffd21300
|
||||
#define SOCFPGA_FIREWALL_TCU 0xffd21400
|
||||
#define SOCFPGA_DMANONSECURE_ADDRESS 0xffda0000
|
||||
#define SOCFPGA_DMASECURE_ADDRESS 0xffda1000
|
||||
#define SOCFPGA_OCRAM_ADDRESS 0xffe00000
|
||||
#define GICD_BASE 0xfffc1000
|
||||
#define GICC_BASE 0xfffc2000
|
||||
|
||||
#endif /* _SOCFPGA_S10_BASE_HARDWARE_H_ */
|
||||
@@ -0,0 +1,26 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0+ */
|
||||
/*
|
||||
* Specialty padding for the Altera SoCFPGA preloader image
|
||||
*/
|
||||
|
||||
#ifndef __BOOT0_H
|
||||
#define __BOOT0_H
|
||||
|
||||
_start:
|
||||
ARM_VECTORS
|
||||
|
||||
#ifdef CONFIG_SPL_BUILD
|
||||
.balignl 64,0xf33db33f;
|
||||
|
||||
.word 0x1337c0d3; /* SoCFPGA preloader validation word */
|
||||
.word 0xc01df00d; /* Version, flags, length */
|
||||
.word 0xcafec0d3; /* Checksum, zero-pad */
|
||||
nop;
|
||||
|
||||
b reset; /* SoCFPGA Gen5 jumps here */
|
||||
b reset; /* SoCFPGA Gen10 trampoline */
|
||||
nop;
|
||||
nop;
|
||||
#endif
|
||||
|
||||
#endif /* __BOOT0_H */
|
||||
@@ -0,0 +1,23 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0+ */
|
||||
/*
|
||||
* Copyright (C) 2013-2017 Altera Corporation <www.altera.com>
|
||||
*/
|
||||
|
||||
#ifndef _CLOCK_MANAGER_H_
|
||||
#define _CLOCK_MANAGER_H_
|
||||
|
||||
#ifndef __ASSEMBLER__
|
||||
void cm_wait_for_lock(u32 mask);
|
||||
int cm_wait_for_fsm(void);
|
||||
void cm_print_clock_quick_summary(void);
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_TARGET_SOCFPGA_GEN5)
|
||||
#include <asm/arch/clock_manager_gen5.h>
|
||||
#elif defined(CONFIG_TARGET_SOCFPGA_ARRIA10)
|
||||
#include <asm/arch/clock_manager_arria10.h>
|
||||
#elif defined(CONFIG_TARGET_SOCFPGA_STRATIX10)
|
||||
#include <asm/arch/clock_manager_s10.h>
|
||||
#endif
|
||||
|
||||
#endif /* _CLOCK_MANAGER_H_ */
|
||||
+218
@@ -0,0 +1,218 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0 */
|
||||
/*
|
||||
* Copyright (C) 2016-2017 Intel Corporation
|
||||
*/
|
||||
|
||||
#ifndef CLOCK_MANAGER_ARRIA10
|
||||
#define CLOCK_MANAGER_ARRIA10
|
||||
|
||||
#ifndef __ASSEMBLER__
|
||||
|
||||
struct socfpga_clock_manager_main_pll {
|
||||
u32 vco0;
|
||||
u32 vco1;
|
||||
u32 en;
|
||||
u32 ens;
|
||||
u32 enr;
|
||||
u32 bypass;
|
||||
u32 bypasss;
|
||||
u32 bypassr;
|
||||
u32 mpuclk;
|
||||
u32 nocclk;
|
||||
u32 cntr2clk;
|
||||
u32 cntr3clk;
|
||||
u32 cntr4clk;
|
||||
u32 cntr5clk;
|
||||
u32 cntr6clk;
|
||||
u32 cntr7clk;
|
||||
u32 cntr8clk;
|
||||
u32 cntr9clk;
|
||||
u32 pad_0x48_0x5b[5];
|
||||
u32 cntr15clk;
|
||||
u32 outrst;
|
||||
u32 outrststat;
|
||||
u32 nocdiv;
|
||||
u32 pad_0x6c_0x80[5];
|
||||
};
|
||||
|
||||
struct socfpga_clock_manager_per_pll {
|
||||
u32 vco0;
|
||||
u32 vco1;
|
||||
u32 en;
|
||||
u32 ens;
|
||||
u32 enr;
|
||||
u32 bypass;
|
||||
u32 bypasss;
|
||||
u32 bypassr;
|
||||
u32 pad_0x20_0x27[2];
|
||||
u32 cntr2clk;
|
||||
u32 cntr3clk;
|
||||
u32 cntr4clk;
|
||||
u32 cntr5clk;
|
||||
u32 cntr6clk;
|
||||
u32 cntr7clk;
|
||||
u32 cntr8clk;
|
||||
u32 cntr9clk;
|
||||
u32 pad_0x48_0x5f[6];
|
||||
u32 outrst;
|
||||
u32 outrststat;
|
||||
u32 emacctl;
|
||||
u32 gpiodiv;
|
||||
u32 pad_0x70_0x80[4];
|
||||
};
|
||||
|
||||
struct socfpga_clock_manager_altera {
|
||||
u32 mpuclk;
|
||||
u32 nocclk;
|
||||
u32 mainmisc0;
|
||||
u32 mainmisc1;
|
||||
u32 perimisc0;
|
||||
u32 perimisc1;
|
||||
};
|
||||
|
||||
struct socfpga_clock_manager {
|
||||
/* clkmgr */
|
||||
u32 ctrl;
|
||||
u32 intr;
|
||||
u32 intrs;
|
||||
u32 intrr;
|
||||
u32 intren;
|
||||
u32 intrens;
|
||||
u32 intrenr;
|
||||
u32 stat;
|
||||
u32 testioctrl;
|
||||
u32 _pad_0x24_0x40[7];
|
||||
/* mainpllgrp */
|
||||
struct socfpga_clock_manager_main_pll main_pll;
|
||||
/* perpllgrp */
|
||||
struct socfpga_clock_manager_per_pll per_pll;
|
||||
struct socfpga_clock_manager_altera altera;
|
||||
};
|
||||
|
||||
#ifdef CONFIG_SPL_BUILD
|
||||
int cm_basic_init(const void *blob);
|
||||
#endif
|
||||
|
||||
unsigned int cm_get_l4_sp_clk_hz(void);
|
||||
unsigned long cm_get_mpu_clk_hz(void);
|
||||
|
||||
unsigned int cm_get_qspi_controller_clk_hz(void);
|
||||
|
||||
#endif /* __ASSEMBLER__ */
|
||||
|
||||
#define CLKMGR_ALTERAGRP_MPU_CLK_OFFSET 0x140
|
||||
#define CLKMGR_MAINPLL_NOC_CLK_OFFSET 0x144
|
||||
#define LOCKED_MASK (CLKMGR_CLKMGR_STAT_MAINPLLLOCKED_SET_MSK | \
|
||||
CLKMGR_CLKMGR_STAT_PERPLLLOCKED_SET_MSK)
|
||||
|
||||
/* value */
|
||||
#define CLKMGR_MAINPLL_BYPASS_RESET 0x0000003f
|
||||
#define CLKMGR_PERPLL_BYPASS_RESET 0x000000ff
|
||||
#define CLKMGR_MAINPLL_VCO0_RESET 0x00010053
|
||||
#define CLKMGR_MAINPLL_VCO1_RESET 0x00010001
|
||||
#define CLKMGR_PERPLL_VCO0_RESET 0x00010053
|
||||
#define CLKMGR_PERPLL_VCO1_RESET 0x00010001
|
||||
#define CLKMGR_MAINPLL_VCO0_PSRC_EOSC 0x0
|
||||
#define CLKMGR_MAINPLL_VCO0_PSRC_E_INTOSC 0x1
|
||||
#define CLKMGR_MAINPLL_VCO0_PSRC_F2S 0x2
|
||||
#define CLKMGR_PERPLL_VCO0_PSRC_EOSC 0x0
|
||||
#define CLKMGR_PERPLL_VCO0_PSRC_E_INTOSC 0x1
|
||||
#define CLKMGR_PERPLL_VCO0_PSRC_F2S 0x2
|
||||
#define CLKMGR_PERPLL_VCO0_PSRC_MAIN 0x3
|
||||
|
||||
/* mask */
|
||||
#define CLKMGR_MAINPLL_EN_S2FUSER0CLKEN_SET_MSK BIT(6)
|
||||
#define CLKMGR_MAINPLL_EN_HMCPLLREFCLKEN_SET_MSK BIT(7)
|
||||
#define CLKMGR_CLKMGR_STAT_MAINPLLLOCKED_SET_MSK BIT(8)
|
||||
#define CLKMGR_CLKMGR_STAT_PERPLLLOCKED_SET_MSK BIT(9)
|
||||
#define CLKMGR_CLKMGR_STAT_BOOTCLKSRC_SET_MSK BIT(17)
|
||||
#define CLKMGR_MAINPLL_VCO0_BGPWRDN_SET_MSK BIT(0)
|
||||
#define CLKMGR_MAINPLL_VCO0_PWRDN_SET_MSK BIT(1)
|
||||
#define CLKMGR_MAINPLL_VCO0_EN_SET_MSK BIT(2)
|
||||
#define CLKMGR_MAINPLL_VCO0_OUTRSTALL_SET_MSK BIT(3)
|
||||
#define CLKMGR_MAINPLL_VCO0_REGEXTSEL_SET_MSK BIT(4)
|
||||
#define CLKMGR_PERPLL_VCO0_BGPWRDN_SET_MSK BIT(0)
|
||||
#define CLKMGR_PERPLL_VCO0_PWRDN_SET_MSK BIT(1)
|
||||
#define CLKMGR_PERPLL_VCO0_EN_SET_MSK BIT(2)
|
||||
#define CLKMGR_PERPLL_VCO0_OUTRSTALL_SET_MSK BIT(3)
|
||||
#define CLKMGR_PERPLL_VCO0_REGEXTSEL_SET_MSK BIT(4)
|
||||
#define CLKMGR_CLKMGR_INTR_MAINPLLACHIEVED_SET_MSK BIT(0)
|
||||
#define CLKMGR_CLKMGR_INTR_PERPLLACHIEVED_SET_MSK BIT(1)
|
||||
#define CLKMGR_CLKMGR_INTR_MAINPLLLOST_SET_MSK BIT(2)
|
||||
#define CLKMGR_CLKMGR_INTR_PERPLLLOST_SET_MSK BIT(3)
|
||||
#define CLKMGR_CLKMGR_INTR_MAINPLLRFSLIP_SET_MSK BIT(8)
|
||||
#define CLKMGR_CLKMGR_INTR_PERPLLRFSLIP_SET_MSK BIT(9)
|
||||
#define CLKMGR_CLKMGR_INTR_MAINPLLFBSLIP_SET_MSK BIT(10)
|
||||
#define CLKMGR_CLKMGR_INTR_PERPLLFBSLIP_SET_MSK BIT(11)
|
||||
#define CLKMGR_CLKMGR_CTL_BOOTMOD_SET_MSK BIT(0)
|
||||
#define CLKMGR_CLKMGR_CTL_BOOTCLK_INTOSC_SET_MSK 0x00000300
|
||||
#define CLKMGR_PERPLL_EN_RESET 0x00000f7f
|
||||
#define CLKMGR_PERPLLGRP_EN_SDMMCCLK_MASK BIT(5)
|
||||
#define CLKMGR_MAINPLL_VCO0_PSRC_MSK 0x00000003
|
||||
#define CLKMGR_MAINPLL_VCO1_NUMER_MSK 0x00001fff
|
||||
#define CLKMGR_MAINPLL_VCO1_DENOM_MSK 0x0000003f
|
||||
#define CLKMGR_MAINPLL_CNTRCLK_MSK 0x000003ff
|
||||
#define CLKMGR_PERPLL_VCO0_PSRC_MSK 0x00000003
|
||||
#define CLKMGR_PERPLL_VCO1_NUMER_MSK 0x00001fff
|
||||
#define CLKMGR_PERPLL_VCO1_DENOM_MSK 0x0000003f
|
||||
#define CLKMGR_PERPLL_CNTRCLK_MSK 0x000003ff
|
||||
#define CLKMGR_MAINPLL_MPUCLK_SRC_MSK 0x00000007
|
||||
#define CLKMGR_MAINPLL_MPUCLK_CNT_MSK 0x000003ff
|
||||
#define CLKMGR_MAINPLL_MPUCLK_SRC_MAIN 0
|
||||
#define CLKMGR_MAINPLL_MPUCLK_SRC_PERI 1
|
||||
#define CLKMGR_MAINPLL_MPUCLK_SRC_OSC1 2
|
||||
#define CLKMGR_MAINPLL_MPUCLK_SRC_INTOSC 3
|
||||
#define CLKMGR_MAINPLL_MPUCLK_SRC_FPGA 4
|
||||
#define CLKMGR_MAINPLL_NOCDIV_MSK 0x00000003
|
||||
#define CLKMGR_MAINPLL_NOCCLK_CNT_MSK 0x000003ff
|
||||
#define CLKMGR_MAINPLL_NOCCLK_SRC_MSK 0x00000007
|
||||
#define CLKMGR_MAINPLL_NOCCLK_SRC_MAIN 0
|
||||
#define CLKMGR_MAINPLL_NOCCLK_SRC_PERI 1
|
||||
#define CLKMGR_MAINPLL_NOCCLK_SRC_OSC1 2
|
||||
#define CLKMGR_MAINPLL_NOCCLK_SRC_INTOSC 3
|
||||
#define CLKMGR_MAINPLL_NOCCLK_SRC_FPGA 4
|
||||
|
||||
#define CLKMGR_PERPLLGRP_SRC_MSK 0x00000007
|
||||
#define CLKMGR_PERPLLGRP_SRC_MAIN 0
|
||||
#define CLKMGR_PERPLLGRP_SRC_PERI 1
|
||||
#define CLKMGR_PERPLLGRP_SRC_OSC1 2
|
||||
#define CLKMGR_PERPLLGRP_SRC_INTOSC 3
|
||||
#define CLKMGR_PERPLLGRP_SRC_FPGA 4
|
||||
|
||||
/* bit shifting macro */
|
||||
#define CLKMGR_MAINPLL_VCO0_PSRC_LSB 8
|
||||
#define CLKMGR_PERPLL_VCO0_PSRC_LSB 8
|
||||
#define CLKMGR_MAINPLL_VCO1_DENOM_LSB 16
|
||||
#define CLKMGR_PERPLL_VCO1_DENOM_LSB 16
|
||||
#define CLKMGR_MAINPLL_NOCCLK_PERICNT_LSB 16
|
||||
#define CLKMGR_MAINPLL_NOCCLK_SRC_LSB 16
|
||||
#define CLKMGR_MAINPLL_NOCDIV_L4MAINCLK_LSB 0
|
||||
#define CLKMGR_MAINPLL_NOCDIV_L4MPCLK_LSB 8
|
||||
#define CLKMGR_MAINPLL_NOCDIV_L4SPCLK_LSB 16
|
||||
#define CLKMGR_MAINPLL_NOCDIV_CSATCLK_LSB 24
|
||||
#define CLKMGR_MAINPLL_NOCDIV_CSTRACECLK_LSB 26
|
||||
#define CLKMGR_MAINPLL_NOCDIV_CSPDBGCLK_LSB 28
|
||||
#define CLKMGR_MAINPLL_MPUCLK_SRC_LSB 16
|
||||
#define CLKMGR_MAINPLL_MPUCLK_PERICNT_LSB 16
|
||||
#define CLKMGR_MAINPLL_NOCCLK_SRC_LSB 16
|
||||
#define CLKMGR_MAINPLL_CNTR7CLK_SRC_LSB 16
|
||||
#define CLKMGR_MAINPLL_CNTR9CLK_SRC_LSB 16
|
||||
#define CLKMGR_PERPLL_CNTR2CLK_SRC_LSB 16
|
||||
#define CLKMGR_PERPLL_CNTR3CLK_SRC_LSB 16
|
||||
#define CLKMGR_PERPLL_CNTR4CLK_SRC_LSB 16
|
||||
#define CLKMGR_PERPLL_CNTR5CLK_SRC_LSB 16
|
||||
#define CLKMGR_PERPLL_CNTR6CLK_SRC_LSB 16
|
||||
#define CLKMGR_PERPLL_CNTR8CLK_SRC_LSB 16
|
||||
#define CLKMGR_PERPLL_EMACCTL_EMAC0SEL_LSB 26
|
||||
#define CLKMGR_PERPLL_EMACCTL_EMAC1SEL_LSB 27
|
||||
#define CLKMGR_PERPLL_EMACCTL_EMAC2SEL_LSB 28
|
||||
|
||||
/* PLL ramping work around */
|
||||
#define CLKMGR_PLL_RAMP_MPUCLK_THRESHOLD_HZ 900000000
|
||||
#define CLKMGR_PLL_RAMP_NOCCLK_THRESHOLD_HZ 300000000
|
||||
#define CLKMGR_PLL_RAMP_MPUCLK_INCREMENT_HZ 100000000
|
||||
#define CLKMGR_PLL_RAMP_NOCCLK_INCREMENT_HZ 33000000
|
||||
|
||||
#define CLKMGR_STAT_BUSY BIT(0)
|
||||
|
||||
#endif /* CLOCK_MANAGER_ARRIA10 */
|
||||
+321
@@ -0,0 +1,321 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0+ */
|
||||
/*
|
||||
* Copyright (C) 2013-2017 Altera Corporation <www.altera.com>
|
||||
*/
|
||||
|
||||
#ifndef _CLOCK_MANAGER_GEN5_H_
|
||||
#define _CLOCK_MANAGER_GEN5_H_
|
||||
|
||||
#ifndef __ASSEMBLER__
|
||||
|
||||
struct cm_config {
|
||||
/* main group */
|
||||
u32 main_vco_base;
|
||||
u32 mpuclk;
|
||||
u32 mainclk;
|
||||
u32 dbgatclk;
|
||||
u32 mainqspiclk;
|
||||
u32 mainnandsdmmcclk;
|
||||
u32 cfg2fuser0clk;
|
||||
u32 maindiv;
|
||||
u32 dbgdiv;
|
||||
u32 tracediv;
|
||||
u32 l4src;
|
||||
|
||||
/* peripheral group */
|
||||
u32 peri_vco_base;
|
||||
u32 emac0clk;
|
||||
u32 emac1clk;
|
||||
u32 perqspiclk;
|
||||
u32 pernandsdmmcclk;
|
||||
u32 perbaseclk;
|
||||
u32 s2fuser1clk;
|
||||
u32 perdiv;
|
||||
u32 gpiodiv;
|
||||
u32 persrc;
|
||||
|
||||
/* sdram pll group */
|
||||
u32 sdram_vco_base;
|
||||
u32 ddrdqsclk;
|
||||
u32 ddr2xdqsclk;
|
||||
u32 ddrdqclk;
|
||||
u32 s2fuser2clk;
|
||||
|
||||
/* altera group */
|
||||
u32 altera_grp_mpuclk;
|
||||
};
|
||||
|
||||
struct socfpga_clock_manager_main_pll {
|
||||
u32 vco;
|
||||
u32 misc;
|
||||
u32 mpuclk;
|
||||
u32 mainclk;
|
||||
u32 dbgatclk;
|
||||
u32 mainqspiclk;
|
||||
u32 mainnandsdmmcclk;
|
||||
u32 cfgs2fuser0clk;
|
||||
u32 en;
|
||||
u32 maindiv;
|
||||
u32 dbgdiv;
|
||||
u32 tracediv;
|
||||
u32 l4src;
|
||||
u32 stat;
|
||||
u32 _pad_0x38_0x40[2];
|
||||
};
|
||||
|
||||
struct socfpga_clock_manager_per_pll {
|
||||
u32 vco;
|
||||
u32 misc;
|
||||
u32 emac0clk;
|
||||
u32 emac1clk;
|
||||
u32 perqspiclk;
|
||||
u32 pernandsdmmcclk;
|
||||
u32 perbaseclk;
|
||||
u32 s2fuser1clk;
|
||||
u32 en;
|
||||
u32 div;
|
||||
u32 gpiodiv;
|
||||
u32 src;
|
||||
u32 stat;
|
||||
u32 _pad_0x34_0x40[3];
|
||||
};
|
||||
|
||||
struct socfpga_clock_manager_sdr_pll {
|
||||
u32 vco;
|
||||
u32 ctrl;
|
||||
u32 ddrdqsclk;
|
||||
u32 ddr2xdqsclk;
|
||||
u32 ddrdqclk;
|
||||
u32 s2fuser2clk;
|
||||
u32 en;
|
||||
u32 stat;
|
||||
};
|
||||
|
||||
struct socfpga_clock_manager_altera {
|
||||
u32 mpuclk;
|
||||
u32 mainclk;
|
||||
};
|
||||
|
||||
struct socfpga_clock_manager {
|
||||
u32 ctrl;
|
||||
u32 bypass;
|
||||
u32 inter;
|
||||
u32 intren;
|
||||
u32 dbctrl;
|
||||
u32 stat;
|
||||
u32 _pad_0x18_0x3f[10];
|
||||
struct socfpga_clock_manager_main_pll main_pll;
|
||||
struct socfpga_clock_manager_per_pll per_pll;
|
||||
struct socfpga_clock_manager_sdr_pll sdr_pll;
|
||||
struct socfpga_clock_manager_altera altera;
|
||||
u32 _pad_0xe8_0x200[70];
|
||||
};
|
||||
|
||||
/* Clock speed accessors */
|
||||
unsigned long cm_get_mpu_clk_hz(void);
|
||||
unsigned long cm_get_sdram_clk_hz(void);
|
||||
unsigned int cm_get_l4_sp_clk_hz(void);
|
||||
unsigned int cm_get_mmc_controller_clk_hz(void);
|
||||
unsigned int cm_get_qspi_controller_clk_hz(void);
|
||||
unsigned int cm_get_spi_controller_clk_hz(void);
|
||||
const unsigned int cm_get_osc_clk_hz(const int osc);
|
||||
const unsigned int cm_get_f2s_per_ref_clk_hz(void);
|
||||
const unsigned int cm_get_f2s_sdr_ref_clk_hz(void);
|
||||
|
||||
/* Clock configuration accessors */
|
||||
int cm_basic_init(const struct cm_config * const cfg);
|
||||
const struct cm_config * const cm_get_default_config(void);
|
||||
#endif /* __ASSEMBLER__ */
|
||||
|
||||
#define LOCKED_MASK \
|
||||
(CLKMGR_INTER_SDRPLLLOCKED_MASK | \
|
||||
CLKMGR_INTER_PERPLLLOCKED_MASK | \
|
||||
CLKMGR_INTER_MAINPLLLOCKED_MASK)
|
||||
|
||||
#define CLKMGR_CTRL_SAFEMODE BIT(0)
|
||||
#define CLKMGR_CTRL_SAFEMODE_OFFSET 0
|
||||
|
||||
#define CLKMGR_BYPASS_PERPLLSRC BIT(4)
|
||||
#define CLKMGR_BYPASS_PERPLLSRC_OFFSET 4
|
||||
#define CLKMGR_BYPASS_PERPLL BIT(3)
|
||||
#define CLKMGR_BYPASS_PERPLL_OFFSET 3
|
||||
#define CLKMGR_BYPASS_SDRPLLSRC BIT(2)
|
||||
#define CLKMGR_BYPASS_SDRPLLSRC_OFFSET 2
|
||||
#define CLKMGR_BYPASS_SDRPLL BIT(1)
|
||||
#define CLKMGR_BYPASS_SDRPLL_OFFSET 1
|
||||
#define CLKMGR_BYPASS_MAINPLL BIT(0)
|
||||
#define CLKMGR_BYPASS_MAINPLL_OFFSET 0
|
||||
|
||||
#define CLKMGR_INTER_MAINPLLLOST_MASK BIT(3)
|
||||
#define CLKMGR_INTER_PERPLLLOST_MASK BIT(4)
|
||||
#define CLKMGR_INTER_SDRPLLLOST_MASK BIT(5)
|
||||
#define CLKMGR_INTER_MAINPLLLOCKED_MASK BIT(6)
|
||||
#define CLKMGR_INTER_PERPLLLOCKED_MASK BIT(7)
|
||||
#define CLKMGR_INTER_SDRPLLLOCKED_MASK BIT(8)
|
||||
|
||||
#define CLKMGR_STAT_BUSY BIT(0)
|
||||
|
||||
/* Main PLL */
|
||||
#define CLKMGR_MAINPLLGRP_VCO_BGPWRDN BIT(0)
|
||||
#define CLKMGR_MAINPLLGRP_VCO_BGPWRDN_OFFSET 0
|
||||
#define CLKMGR_MAINPLLGRP_VCO_DENOM_OFFSET 16
|
||||
#define CLKMGR_MAINPLLGRP_VCO_DENOM_MASK 0x003f0000
|
||||
#define CLKMGR_MAINPLLGRP_VCO_EN BIT(1)
|
||||
#define CLKMGR_MAINPLLGRP_VCO_EN_OFFSET 1
|
||||
#define CLKMGR_MAINPLLGRP_VCO_NUMER_OFFSET 3
|
||||
#define CLKMGR_MAINPLLGRP_VCO_NUMER_MASK 0x0000fff8
|
||||
#define CLKMGR_MAINPLLGRP_VCO_OUTRESETALL_MASK 0x01000000
|
||||
#define CLKMGR_MAINPLLGRP_VCO_PWRDN BIT(2)
|
||||
#define CLKMGR_MAINPLLGRP_VCO_PWRDN_OFFSET 2
|
||||
#define CLKMGR_MAINPLLGRP_VCO_REGEXTSEL_MASK 0x80000000
|
||||
#define CLKMGR_MAINPLLGRP_VCO_RESET_VALUE 0x8001000d
|
||||
|
||||
#define CLKMGR_MAINPLLGRP_MPUCLK_CNT_OFFSET 0
|
||||
#define CLKMGR_MAINPLLGRP_MPUCLK_CNT_MASK 0x000001ff
|
||||
|
||||
#define CLKMGR_MAINPLLGRP_MAINCLK_CNT_OFFSET 0
|
||||
#define CLKMGR_MAINPLLGRP_MAINCLK_CNT_MASK 0x000001ff
|
||||
|
||||
#define CLKMGR_MAINPLLGRP_DBGATCLK_CNT_OFFSET 0
|
||||
#define CLKMGR_MAINPLLGRP_DBGATCLK_CNT_MASK 0x000001ff
|
||||
|
||||
#define CLKMGR_MAINPLLGRP_MAINQSPICLK_CNT_OFFSET 0
|
||||
#define CLKMGR_MAINPLLGRP_MAINQSPICLK_CNT_MASK 0x000001ff
|
||||
|
||||
#define CLKMGR_MAINPLLGRP_MAINNANDSDMMCCLK_CNT_OFFSET 0
|
||||
#define CLKMGR_MAINPLLGRP_MAINNANDSDMMCCLK_CNT_MASK 0x000001ff
|
||||
|
||||
#define CLKMGR_MAINPLLGRP_CFGS2FUSER0CLK_CNT_OFFSET 0
|
||||
#define CLKMGR_MAINPLLGRP_CFGS2FUSER0CLK_CNT_MASK 0x000001ff
|
||||
|
||||
#define CLKMGR_MAINPLLGRP_EN_L4MPCLK_MASK BIT(2)
|
||||
#define CLKMGR_MAINPLLGRP_EN_DBGATCLK_MASK BIT(4)
|
||||
#define CLKMGR_MAINPLLGRP_EN_DBGCLK_MASK BIT(5)
|
||||
#define CLKMGR_MAINPLLGRP_EN_DBGTRACECLK_MASK BIT(6)
|
||||
#define CLKMGR_MAINPLLGRP_EN_DBGTIMERCLK_MASK BIT(7)
|
||||
#define CLKMGR_MAINPLLGRP_EN_S2FUSER0CLK_MASK BIT(9)
|
||||
|
||||
#define CLKMGR_MAINPLLGRP_MAINDIV_L3MPCLK_OFFSET 0
|
||||
#define CLKMGR_MAINPLLGRP_MAINDIV_L3MPCLK_MASK 0x00000003
|
||||
#define CLKMGR_MAINPLLGRP_MAINDIV_L3SPCLK_OFFSET 2
|
||||
#define CLKMGR_MAINPLLGRP_MAINDIV_L3SPCLK_MASK 0x0000000c
|
||||
#define CLKMGR_MAINPLLGRP_MAINDIV_L4MPCLK_OFFSET 4
|
||||
#define CLKMGR_MAINPLLGRP_MAINDIV_L4MPCLK_MASK 0x00000070
|
||||
#define CLKMGR_MAINPLLGRP_MAINDIV_L4SPCLK_OFFSET 7
|
||||
#define CLKMGR_MAINPLLGRP_MAINDIV_L4SPCLK_MASK 0x00000380
|
||||
|
||||
#define CLKMGR_MAINPLLGRP_DBGDIV_DBGATCLK_OFFSET 0
|
||||
#define CLKMGR_MAINPLLGRP_DBGDIV_DBGATCLK_MASK 0x00000003
|
||||
#define CLKMGR_MAINPLLGRP_DBGDIV_DBGCLK_OFFSET 2
|
||||
#define CLKMGR_MAINPLLGRP_DBGDIV_DBGCLK_MASK 0x0000000c
|
||||
|
||||
#define CLKMGR_MAINPLLGRP_TRACEDIV_TRACECLK_OFFSET 0
|
||||
#define CLKMGR_MAINPLLGRP_TRACEDIV_TRACECLK_MASK 0x00000007
|
||||
|
||||
#define CLKMGR_MAINPLLGRP_L4SRC_L4MP BIT(0)
|
||||
#define CLKMGR_MAINPLLGRP_L4SRC_L4MP_OFFSET 0
|
||||
#define CLKMGR_MAINPLLGRP_L4SRC_L4SP BIT(1)
|
||||
#define CLKMGR_MAINPLLGRP_L4SRC_L4SP_OFFSET 1
|
||||
#define CLKMGR_MAINPLLGRP_L4SRC_RESET_VALUE 0x00000000
|
||||
#define CLKMGR_L4_SP_CLK_SRC_MAINPLL 0x0
|
||||
#define CLKMGR_L4_SP_CLK_SRC_PERPLL 0x1
|
||||
|
||||
/* Per PLL */
|
||||
#define CLKMGR_PERPLLGRP_VCO_DENOM_OFFSET 16
|
||||
#define CLKMGR_PERPLLGRP_VCO_DENOM_MASK 0x003f0000
|
||||
#define CLKMGR_PERPLLGRP_VCO_NUMER_OFFSET 3
|
||||
#define CLKMGR_PERPLLGRP_VCO_NUMER_MASK 0x0000fff8
|
||||
#define CLKMGR_PERPLLGRP_VCO_OUTRESETALL_MASK 0x01000000
|
||||
#define CLKMGR_PERPLLGRP_VCO_PSRC_OFFSET 22
|
||||
#define CLKMGR_PERPLLGRP_VCO_PSRC_MASK 0x00c00000
|
||||
#define CLKMGR_PERPLLGRP_VCO_REGEXTSEL_MASK 0x80000000
|
||||
#define CLKMGR_PERPLLGRP_VCO_RESET_VALUE 0x8001000d
|
||||
#define CLKMGR_PERPLLGRP_VCO_SSRC_OFFSET 22
|
||||
#define CLKMGR_PERPLLGRP_VCO_SSRC_MASK 0x00c00000
|
||||
|
||||
#define CLKMGR_VCO_SSRC_EOSC1 0x0
|
||||
#define CLKMGR_VCO_SSRC_EOSC2 0x1
|
||||
#define CLKMGR_VCO_SSRC_F2S 0x2
|
||||
|
||||
#define CLKMGR_PERPLLGRP_EMAC0CLK_CNT_OFFSET 0
|
||||
#define CLKMGR_PERPLLGRP_EMAC0CLK_CNT_MASK 0x000001ff
|
||||
|
||||
#define CLKMGR_PERPLLGRP_EMAC1CLK_CNT_OFFSET 0
|
||||
#define CLKMGR_PERPLLGRP_EMAC1CLK_CNT_MASK 0x000001ff
|
||||
|
||||
#define CLKMGR_PERPLLGRP_PERQSPICLK_CNT_OFFSET 0
|
||||
#define CLKMGR_PERPLLGRP_PERQSPICLK_CNT_MASK 0x000001ff
|
||||
|
||||
#define CLKMGR_PERPLLGRP_PERNANDSDMMCCLK_CNT_OFFSET 0
|
||||
#define CLKMGR_PERPLLGRP_PERNANDSDMMCCLK_CNT_MASK 0x000001ff
|
||||
|
||||
#define CLKMGR_PERPLLGRP_PERBASECLK_CNT_OFFSET 0
|
||||
#define CLKMGR_PERPLLGRP_PERBASECLK_CNT_MASK 0x000001ff
|
||||
|
||||
#define CLKMGR_PERPLLGRP_S2FUSER1CLK_CNT_OFFSET 0
|
||||
#define CLKMGR_PERPLLGRP_S2FUSER1CLK_CNT_MASK 0x000001ff
|
||||
|
||||
#define CLKMGR_PERPLLGRP_EN_NANDCLK_MASK 0x00000400
|
||||
#define CLKMGR_PERPLLGRP_EN_SDMMCCLK_MASK 0x00000100
|
||||
|
||||
#define CLKMGR_PERPLLGRP_DIV_CAN0CLK_OFFSET 6
|
||||
#define CLKMGR_PERPLLGRP_DIV_CAN0CLK_MASK 0x000001c0
|
||||
#define CLKMGR_PERPLLGRP_DIV_CAN1CLK_OFFSET 9
|
||||
#define CLKMGR_PERPLLGRP_DIV_CAN1CLK_MASK 0x00000e00
|
||||
#define CLKMGR_PERPLLGRP_DIV_SPIMCLK_OFFSET 3
|
||||
#define CLKMGR_PERPLLGRP_DIV_SPIMCLK_OFFSET 3
|
||||
#define CLKMGR_PERPLLGRP_DIV_USBCLK_OFFSET 0
|
||||
#define CLKMGR_PERPLLGRP_DIV_USBCLK_MASK 0x00000007
|
||||
|
||||
#define CLKMGR_PERPLLGRP_GPIODIV_GPIODBCLK_OFFSET 0
|
||||
#define CLKMGR_PERPLLGRP_GPIODIV_GPIODBCLK_MASK 0x00ffffff
|
||||
|
||||
#define CLKMGR_PERPLLGRP_SRC_NAND_OFFSET 2
|
||||
#define CLKMGR_PERPLLGRP_SRC_NAND_MASK 0x0000000c
|
||||
#define CLKMGR_PERPLLGRP_SRC_QSPI_OFFSET 4
|
||||
#define CLKMGR_PERPLLGRP_SRC_QSPI_MASK 0x00000030
|
||||
#define CLKMGR_PERPLLGRP_SRC_RESET_VALUE 0x00000015
|
||||
#define CLKMGR_PERPLLGRP_SRC_SDMMC_OFFSET 0
|
||||
#define CLKMGR_PERPLLGRP_SRC_SDMMC_MASK 0x00000003
|
||||
#define CLKMGR_SDMMC_CLK_SRC_F2S 0x0
|
||||
#define CLKMGR_SDMMC_CLK_SRC_MAIN 0x1
|
||||
#define CLKMGR_SDMMC_CLK_SRC_PER 0x2
|
||||
#define CLKMGR_QSPI_CLK_SRC_F2S 0x0
|
||||
#define CLKMGR_QSPI_CLK_SRC_MAIN 0x1
|
||||
#define CLKMGR_QSPI_CLK_SRC_PER 0x2
|
||||
|
||||
/* SDR PLL */
|
||||
#define CLKMGR_SDRPLLGRP_VCO_DENOM_OFFSET 16
|
||||
#define CLKMGR_SDRPLLGRP_VCO_DENOM_MASK 0x003f0000
|
||||
#define CLKMGR_SDRPLLGRP_VCO_NUMER_OFFSET 3
|
||||
#define CLKMGR_SDRPLLGRP_VCO_NUMER_MASK 0x0000fff8
|
||||
#define CLKMGR_SDRPLLGRP_VCO_OUTRESETALL BIT(24)
|
||||
#define CLKMGR_SDRPLLGRP_VCO_OUTRESETALL_OFFSET 24
|
||||
#define CLKMGR_SDRPLLGRP_VCO_OUTRESET_OFFSET 25
|
||||
#define CLKMGR_SDRPLLGRP_VCO_OUTRESET_MASK 0x7e000000
|
||||
#define CLKMGR_SDRPLLGRP_VCO_REGEXTSEL_MASK BIT(31)
|
||||
#define CLKMGR_SDRPLLGRP_VCO_RESET_VALUE 0x8001000d
|
||||
#define CLKMGR_SDRPLLGRP_VCO_SSRC_OFFSET 22
|
||||
#define CLKMGR_SDRPLLGRP_VCO_SSRC_MASK 0x00c00000
|
||||
|
||||
#define CLKMGR_SDRPLLGRP_DDRDQSCLK_CNT_OFFSET 0
|
||||
#define CLKMGR_SDRPLLGRP_DDRDQSCLK_CNT_MASK 0x000001ff
|
||||
#define CLKMGR_SDRPLLGRP_DDRDQSCLK_PHASE_OFFSET 9
|
||||
#define CLKMGR_SDRPLLGRP_DDRDQSCLK_PHASE_MASK 0x00000e00
|
||||
|
||||
#define CLKMGR_SDRPLLGRP_DDR2XDQSCLK_CNT_OFFSET 0
|
||||
#define CLKMGR_SDRPLLGRP_DDR2XDQSCLK_CNT_MASK 0x000001ff
|
||||
#define CLKMGR_SDRPLLGRP_DDR2XDQSCLK_PHASE_OFFSET 9
|
||||
#define CLKMGR_SDRPLLGRP_DDR2XDQSCLK_PHASE_MASK 0x00000e00
|
||||
|
||||
#define CLKMGR_SDRPLLGRP_DDRDQCLK_CNT_OFFSET 0
|
||||
#define CLKMGR_SDRPLLGRP_DDRDQCLK_CNT_MASK 0x000001ff
|
||||
#define CLKMGR_SDRPLLGRP_DDRDQCLK_PHASE_OFFSET 9
|
||||
#define CLKMGR_SDRPLLGRP_DDRDQCLK_PHASE_MASK 0x00000e00
|
||||
|
||||
#define CLKMGR_SDRPLLGRP_S2FUSER2CLK_CNT_OFFSET 0
|
||||
#define CLKMGR_SDRPLLGRP_S2FUSER2CLK_CNT_MASK 0x000001ff
|
||||
#define CLKMGR_SDRPLLGRP_S2FUSER2CLK_PHASE_OFFSET 9
|
||||
#define CLKMGR_SDRPLLGRP_S2FUSER2CLK_PHASE_MASK 0x00000e00
|
||||
|
||||
#endif /* _CLOCK_MANAGER_GEN5_H_ */
|
||||
+210
@@ -0,0 +1,210 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0
|
||||
*
|
||||
* Copyright (C) 2016-2018 Intel Corporation <www.intel.com>
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _CLOCK_MANAGER_S10_
|
||||
#define _CLOCK_MANAGER_S10_
|
||||
|
||||
/* Clock speed accessors */
|
||||
unsigned long cm_get_mpu_clk_hz(void);
|
||||
unsigned long cm_get_sdram_clk_hz(void);
|
||||
unsigned int cm_get_l4_sp_clk_hz(void);
|
||||
unsigned int cm_get_mmc_controller_clk_hz(void);
|
||||
unsigned int cm_get_qspi_controller_clk_hz(void);
|
||||
unsigned int cm_get_spi_controller_clk_hz(void);
|
||||
const unsigned int cm_get_osc_clk_hz(void);
|
||||
const unsigned int cm_get_f2s_per_ref_clk_hz(void);
|
||||
const unsigned int cm_get_f2s_sdr_ref_clk_hz(void);
|
||||
const unsigned int cm_get_intosc_clk_hz(void);
|
||||
const unsigned int cm_get_fpga_clk_hz(void);
|
||||
|
||||
#define CLKMGR_EOSC1_HZ 25000000
|
||||
#define CLKMGR_INTOSC_HZ 460000000
|
||||
#define CLKMGR_FPGA_CLK_HZ 50000000
|
||||
|
||||
/* Clock configuration accessors */
|
||||
const struct cm_config * const cm_get_default_config(void);
|
||||
|
||||
struct cm_config {
|
||||
/* main group */
|
||||
u32 main_pll_mpuclk;
|
||||
u32 main_pll_nocclk;
|
||||
u32 main_pll_cntr2clk;
|
||||
u32 main_pll_cntr3clk;
|
||||
u32 main_pll_cntr4clk;
|
||||
u32 main_pll_cntr5clk;
|
||||
u32 main_pll_cntr6clk;
|
||||
u32 main_pll_cntr7clk;
|
||||
u32 main_pll_cntr8clk;
|
||||
u32 main_pll_cntr9clk;
|
||||
u32 main_pll_nocdiv;
|
||||
u32 main_pll_pllglob;
|
||||
u32 main_pll_fdbck;
|
||||
u32 main_pll_pllc0;
|
||||
u32 main_pll_pllc1;
|
||||
u32 spare;
|
||||
|
||||
/* peripheral group */
|
||||
u32 per_pll_cntr2clk;
|
||||
u32 per_pll_cntr3clk;
|
||||
u32 per_pll_cntr4clk;
|
||||
u32 per_pll_cntr5clk;
|
||||
u32 per_pll_cntr6clk;
|
||||
u32 per_pll_cntr7clk;
|
||||
u32 per_pll_cntr8clk;
|
||||
u32 per_pll_cntr9clk;
|
||||
u32 per_pll_emacctl;
|
||||
u32 per_pll_gpiodiv;
|
||||
u32 per_pll_pllglob;
|
||||
u32 per_pll_fdbck;
|
||||
u32 per_pll_pllc0;
|
||||
u32 per_pll_pllc1;
|
||||
|
||||
/* incoming clock */
|
||||
u32 hps_osc_clk_hz;
|
||||
u32 fpga_clk_hz;
|
||||
};
|
||||
|
||||
void cm_basic_init(const struct cm_config * const cfg);
|
||||
|
||||
struct socfpga_clock_manager_main_pll {
|
||||
u32 en;
|
||||
u32 ens;
|
||||
u32 enr;
|
||||
u32 bypass;
|
||||
u32 bypasss;
|
||||
u32 bypassr;
|
||||
u32 mpuclk;
|
||||
u32 nocclk;
|
||||
u32 cntr2clk;
|
||||
u32 cntr3clk;
|
||||
u32 cntr4clk;
|
||||
u32 cntr5clk;
|
||||
u32 cntr6clk;
|
||||
u32 cntr7clk;
|
||||
u32 cntr8clk;
|
||||
u32 cntr9clk;
|
||||
u32 nocdiv;
|
||||
u32 pllglob;
|
||||
u32 fdbck;
|
||||
u32 mem;
|
||||
u32 memstat;
|
||||
u32 pllc0;
|
||||
u32 pllc1;
|
||||
u32 vcocalib;
|
||||
u32 _pad_0x90_0xA0[5];
|
||||
};
|
||||
|
||||
struct socfpga_clock_manager_per_pll {
|
||||
u32 en;
|
||||
u32 ens;
|
||||
u32 enr;
|
||||
u32 bypass;
|
||||
u32 bypasss;
|
||||
u32 bypassr;
|
||||
u32 cntr2clk;
|
||||
u32 cntr3clk;
|
||||
u32 cntr4clk;
|
||||
u32 cntr5clk;
|
||||
u32 cntr6clk;
|
||||
u32 cntr7clk;
|
||||
u32 cntr8clk;
|
||||
u32 cntr9clk;
|
||||
u32 emacctl;
|
||||
u32 gpiodiv;
|
||||
u32 pllglob;
|
||||
u32 fdbck;
|
||||
u32 mem;
|
||||
u32 memstat;
|
||||
u32 pllc0;
|
||||
u32 pllc1;
|
||||
u32 vcocalib;
|
||||
u32 _pad_0x100_0x124[10];
|
||||
};
|
||||
|
||||
struct socfpga_clock_manager {
|
||||
u32 ctrl;
|
||||
u32 stat;
|
||||
u32 testioctrl;
|
||||
u32 intrgen;
|
||||
u32 intrmsk;
|
||||
u32 intrclr;
|
||||
u32 intrsts;
|
||||
u32 intrstk;
|
||||
u32 intrraw;
|
||||
u32 _pad_0x24_0x2c[3];
|
||||
struct socfpga_clock_manager_main_pll main_pll;
|
||||
struct socfpga_clock_manager_per_pll per_pll;
|
||||
};
|
||||
|
||||
#define CLKMGR_CTRL_SAFEMODE BIT(0)
|
||||
#define CLKMGR_BYPASS_MAINPLL_ALL 0x00000007
|
||||
#define CLKMGR_BYPASS_PERPLL_ALL 0x0000007f
|
||||
|
||||
#define CLKMGR_INTER_MAINPLLLOCKED_MASK 0x00000001
|
||||
#define CLKMGR_INTER_PERPLLLOCKED_MASK 0x00000002
|
||||
#define CLKMGR_INTER_MAINPLLLOST_MASK 0x00000004
|
||||
#define CLKMGR_INTER_PERPLLLOST_MASK 0x00000008
|
||||
#define CLKMGR_STAT_BUSY BIT(0)
|
||||
#define CLKMGR_STAT_MAINPLL_LOCKED BIT(8)
|
||||
#define CLKMGR_STAT_PERPLL_LOCKED BIT(9)
|
||||
|
||||
#define CLKMGR_PLLGLOB_PD_MASK 0x00000001
|
||||
#define CLKMGR_PLLGLOB_RST_MASK 0x00000002
|
||||
#define CLKMGR_PLLGLOB_VCO_PSRC_MASK 0X3
|
||||
#define CLKMGR_PLLGLOB_VCO_PSRC_OFFSET 16
|
||||
#define CLKMGR_VCO_PSRC_EOSC1 0
|
||||
#define CLKMGR_VCO_PSRC_INTOSC 1
|
||||
#define CLKMGR_VCO_PSRC_F2S 2
|
||||
#define CLKMGR_PLLGLOB_REFCLKDIV_MASK 0X3f
|
||||
#define CLKMGR_PLLGLOB_REFCLKDIV_OFFSET 8
|
||||
|
||||
#define CLKMGR_CLKSRC_MASK 0x7
|
||||
#define CLKMGR_CLKSRC_OFFSET 16
|
||||
#define CLKMGR_CLKSRC_MAIN 0
|
||||
#define CLKMGR_CLKSRC_PER 1
|
||||
#define CLKMGR_CLKSRC_OSC1 2
|
||||
#define CLKMGR_CLKSRC_INTOSC 3
|
||||
#define CLKMGR_CLKSRC_FPGA 4
|
||||
#define CLKMGR_CLKCNT_MSK 0x7ff
|
||||
|
||||
#define CLKMGR_FDBCK_MDIV_MASK 0xff
|
||||
#define CLKMGR_FDBCK_MDIV_OFFSET 24
|
||||
|
||||
#define CLKMGR_PLLC0_DIV_MASK 0xff
|
||||
#define CLKMGR_PLLC1_DIV_MASK 0xff
|
||||
#define CLKMGR_PLLC0_EN_OFFSET 27
|
||||
#define CLKMGR_PLLC1_EN_OFFSET 24
|
||||
|
||||
#define CLKMGR_NOCDIV_L4MAIN_OFFSET 0
|
||||
#define CLKMGR_NOCDIV_L4MPCLK_OFFSET 8
|
||||
#define CLKMGR_NOCDIV_L4SPCLK_OFFSET 16
|
||||
#define CLKMGR_NOCDIV_CSATCLK_OFFSET 24
|
||||
#define CLKMGR_NOCDIV_CSTRACECLK_OFFSET 26
|
||||
#define CLKMGR_NOCDIV_CSPDBGCLK_OFFSET 28
|
||||
|
||||
#define CLKMGR_NOCDIV_L4SPCLK_MASK 0X3
|
||||
#define CLKMGR_NOCDIV_DIV1 0
|
||||
#define CLKMGR_NOCDIV_DIV2 1
|
||||
#define CLKMGR_NOCDIV_DIV4 2
|
||||
#define CLKMGR_NOCDIV_DIV8 3
|
||||
#define CLKMGR_CSPDBGCLK_DIV1 0
|
||||
#define CLKMGR_CSPDBGCLK_DIV4 1
|
||||
|
||||
#define CLKMGR_MSCNT_CONST 200
|
||||
#define CLKMGR_MDIV_CONST 6
|
||||
#define CLKMGR_HSCNT_CONST 9
|
||||
|
||||
#define CLKMGR_VCOCALIB_MSCNT_MASK 0xff
|
||||
#define CLKMGR_VCOCALIB_MSCNT_OFFSET 9
|
||||
#define CLKMGR_VCOCALIB_HSCNT_MASK 0xff
|
||||
|
||||
#define CLKMGR_EMACCTL_EMAC0SEL_OFFSET 26
|
||||
#define CLKMGR_EMACCTL_EMAC1SEL_OFFSET 27
|
||||
#define CLKMGR_EMACCTL_EMAC2SEL_OFFSET 28
|
||||
|
||||
#define CLKMGR_PERPLLGRP_EN_SDMMCCLK_MASK 0x00000020
|
||||
|
||||
#endif /* _CLOCK_MANAGER_S10_ */
|
||||
@@ -0,0 +1,120 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0
|
||||
*
|
||||
* Copyright (C) 2017-2018 Intel Corporation <www.intel.com>
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _FIREWALL_S10_
|
||||
#define _FIREWALL_S10_
|
||||
|
||||
struct socfpga_firwall_l4_per {
|
||||
u32 nand; /* 0x00 */
|
||||
u32 nand_data;
|
||||
u32 _pad_0x8;
|
||||
u32 usb0;
|
||||
u32 usb1; /* 0x10 */
|
||||
u32 _pad_0x14;
|
||||
u32 _pad_0x18;
|
||||
u32 spim0;
|
||||
u32 spim1; /* 0x20 */
|
||||
u32 spis0;
|
||||
u32 spis1;
|
||||
u32 emac0;
|
||||
u32 emac1; /* 0x30 */
|
||||
u32 emac2;
|
||||
u32 _pad_0x38;
|
||||
u32 _pad_0x3c;
|
||||
u32 sdmmc; /* 0x40 */
|
||||
u32 gpio0;
|
||||
u32 gpio1;
|
||||
u32 _pad_0x4c;
|
||||
u32 i2c0; /* 0x50 */
|
||||
u32 i2c1;
|
||||
u32 i2c2;
|
||||
u32 i2c3;
|
||||
u32 i2c4; /* 0x60 */
|
||||
u32 timer0;
|
||||
u32 timer1;
|
||||
u32 uart0;
|
||||
u32 uart1; /* 0x70 */
|
||||
};
|
||||
|
||||
struct socfpga_firwall_l4_sys {
|
||||
u32 _pad_0x00; /* 0x00 */
|
||||
u32 _pad_0x04;
|
||||
u32 dma_ecc;
|
||||
u32 emac0rx_ecc;
|
||||
u32 emac0tx_ecc; /* 0x10 */
|
||||
u32 emac1rx_ecc;
|
||||
u32 emac1tx_ecc;
|
||||
u32 emac2rx_ecc;
|
||||
u32 emac2tx_ecc; /* 0x20 */
|
||||
u32 _pad_0x24;
|
||||
u32 _pad_0x28;
|
||||
u32 nand_ecc;
|
||||
u32 nand_read_ecc; /* 0x30 */
|
||||
u32 nand_write_ecc;
|
||||
u32 ocram_ecc;
|
||||
u32 _pad_0x3c;
|
||||
u32 sdmmc_ecc; /* 0x40 */
|
||||
u32 usb0_ecc;
|
||||
u32 usb1_ecc;
|
||||
u32 clock_manager;
|
||||
u32 _pad_0x50; /* 0x50 */
|
||||
u32 io_manager;
|
||||
u32 reset_manager;
|
||||
u32 system_manager;
|
||||
u32 osc0_timer; /* 0x60 */
|
||||
u32 osc1_timer;
|
||||
u32 watchdog0;
|
||||
u32 watchdog1;
|
||||
u32 watchdog2; /* 0x70 */
|
||||
u32 watchdog3;
|
||||
};
|
||||
|
||||
#define FIREWALL_L4_DISABLE_ALL (BIT(0) | BIT(24) | BIT(16))
|
||||
#define FIREWALL_BRIDGE_DISABLE_ALL (~0)
|
||||
|
||||
/* Cache coherency unit (CCU) registers */
|
||||
#define CCU_CPU0_MPRT_ADBASE_DDRREG 0x4400
|
||||
#define CCU_CPU0_MPRT_ADBASE_MEMSPACE0 0x45c0
|
||||
#define CCU_CPU0_MPRT_ADBASE_MEMSPACE1A 0x45e0
|
||||
#define CCU_CPU0_MPRT_ADBASE_MEMSPACE1B 0x4600
|
||||
#define CCU_CPU0_MPRT_ADBASE_MEMSPACE1C 0x4620
|
||||
#define CCU_CPU0_MPRT_ADBASE_MEMSPACE1D 0x4640
|
||||
#define CCU_CPU0_MPRT_ADBASE_MEMSPACE1E 0x4660
|
||||
|
||||
#define CCU_CPU0_MPRT_ADMASK_MEM_RAM0 0x4688
|
||||
|
||||
#define CCU_IOM_MPRT_ADBASE_MEMSPACE0 0x18560
|
||||
#define CCU_IOM_MPRT_ADBASE_MEMSPACE1A 0x18580
|
||||
#define CCU_IOM_MPRT_ADBASE_MEMSPACE1B 0x185a0
|
||||
#define CCU_IOM_MPRT_ADBASE_MEMSPACE1C 0x185c0
|
||||
#define CCU_IOM_MPRT_ADBASE_MEMSPACE1D 0x185e0
|
||||
#define CCU_IOM_MPRT_ADBASE_MEMSPACE1E 0x18600
|
||||
|
||||
#define CCU_IOM_MPRT_ADMASK_MEM_RAM0 0x18628
|
||||
|
||||
#define CCU_ADMASK_P_MASK BIT(0)
|
||||
#define CCU_ADMASK_NS_MASK BIT(1)
|
||||
|
||||
#define CCU_ADBASE_DI_MASK BIT(4)
|
||||
|
||||
#define CCU_REG_ADDR(reg) \
|
||||
(SOCFPGA_CCU_ADDRESS + (reg))
|
||||
|
||||
/* Firewall MPU DDR SCR registers */
|
||||
#define FW_MPU_DDR_SCR_EN 0x00
|
||||
#define FW_MPU_DDR_SCR_EN_SET 0x04
|
||||
#define FW_MPU_DDR_SCR_MPUREGION0ADDR_LIMIT 0x18
|
||||
#define FW_MPU_DDR_SCR_MPUREGION0ADDR_LIMITEXT 0x1c
|
||||
#define FW_MPU_DDR_SCR_NONMPUREGION0ADDR_LIMIT 0x98
|
||||
#define FW_MPU_DDR_SCR_NONMPUREGION0ADDR_LIMITEXT 0x9c
|
||||
|
||||
#define MPUREGION0_ENABLE BIT(0)
|
||||
#define NONMPUREGION0_ENABLE BIT(8)
|
||||
|
||||
#define FW_MPU_DDR_SCR_WRITEL(data, reg) \
|
||||
writel(data, SOCFPGA_FW_MPU_DDR_SCR_ADDRESS + (reg))
|
||||
|
||||
#endif /* _FIREWALL_S10_ */
|
||||
@@ -0,0 +1,34 @@
|
||||
/* SPDX-License-Identifier: BSD-3-Clause */
|
||||
/*
|
||||
* Copyright (C) 2012-2017 Altera Corporation <www.altera.com>
|
||||
* All rights reserved.
|
||||
*/
|
||||
|
||||
#ifndef _FPGA_MANAGER_H_
|
||||
#define _FPGA_MANAGER_H_
|
||||
|
||||
#include <altera.h>
|
||||
|
||||
#if defined(CONFIG_TARGET_SOCFPGA_GEN5)
|
||||
#include <asm/arch/fpga_manager_gen5.h>
|
||||
#elif defined(CONFIG_TARGET_SOCFPGA_ARRIA10)
|
||||
#include <asm/arch/fpga_manager_arria10.h>
|
||||
#endif
|
||||
|
||||
/* FPGA CD Ratio Value */
|
||||
#define CDRATIO_x1 0x0
|
||||
#define CDRATIO_x2 0x1
|
||||
#define CDRATIO_x4 0x2
|
||||
#define CDRATIO_x8 0x3
|
||||
|
||||
#ifndef __ASSEMBLY__
|
||||
|
||||
/* Common prototypes */
|
||||
int fpgamgr_get_mode(void);
|
||||
int fpgamgr_poll_fpga_ready(void);
|
||||
void fpgamgr_program_write(const void *rbf_data, size_t rbf_size);
|
||||
int fpgamgr_test_fpga_ready(void);
|
||||
int fpgamgr_dclkcnt_set(unsigned long cnt);
|
||||
|
||||
#endif /* __ASSEMBLY__ */
|
||||
#endif /* _FPGA_MANAGER_H_ */
|
||||
+135
@@ -0,0 +1,135 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0 */
|
||||
/*
|
||||
* Copyright (C) 2017-2019 Intel Corporation <www.intel.com>
|
||||
* All rights reserved.
|
||||
*/
|
||||
|
||||
#include <asm/cache.h>
|
||||
#include <altera.h>
|
||||
#include <image.h>
|
||||
|
||||
#ifndef _FPGA_MANAGER_ARRIA10_H_
|
||||
#define _FPGA_MANAGER_ARRIA10_H_
|
||||
|
||||
#define ALT_FPGAMGR_IMGCFG_STAT_F2S_CRC_ERROR_SET_MSK BIT(0)
|
||||
#define ALT_FPGAMGR_IMGCFG_STAT_F2S_EARLY_USERMODE_SET_MSK BIT(1)
|
||||
#define ALT_FPGAMGR_IMGCFG_STAT_F2S_USERMODE_SET_MSK BIT(2)
|
||||
#define ALT_FPGAMGR_IMGCFG_STAT_F2S_INITDONE_OE_SET_MSK BIT(3)
|
||||
#define ALT_FPGAMGR_IMGCFG_STAT_F2S_NSTATUS_PIN_SET_MSK BIT(4)
|
||||
#define ALT_FPGAMGR_IMGCFG_STAT_F2S_NSTATUS_OE_SET_MSK BIT(5)
|
||||
#define ALT_FPGAMGR_IMGCFG_STAT_F2S_CONDONE_PIN_SET_MSK BIT(6)
|
||||
#define ALT_FPGAMGR_IMGCFG_STAT_F2S_CONDONE_OE_SET_MSK BIT(7)
|
||||
#define ALT_FPGAMGR_IMGCFG_STAT_F2S_CVP_CONF_DONE_SET_MSK BIT(8)
|
||||
#define ALT_FPGAMGR_IMGCFG_STAT_F2S_PR_READY_SET_MSK BIT(9)
|
||||
#define ALT_FPGAMGR_IMGCFG_STAT_F2S_PR_DONE_SET_MSK BIT(10)
|
||||
#define ALT_FPGAMGR_IMGCFG_STAT_F2S_PR_ERROR_SET_MSK BIT(11)
|
||||
#define ALT_FPGAMGR_IMGCFG_STAT_F2S_NCONFIG_PIN_SET_MSK BIT(12)
|
||||
#define ALT_FPGAMGR_IMGCFG_STAT_F2S_NCEO_OE_SET_MSK BIT(13)
|
||||
#define ALT_FPGAMGR_IMGCFG_STAT_F2S_MSEL0_SET_MSK BIT(16)
|
||||
#define ALT_FPGAMGR_IMGCFG_STAT_F2S_MSEL1_SET_MSK BIT(17)
|
||||
#define ALT_FPGAMGR_IMGCFG_STAT_F2S_MSEL2_SET_MSK BIT(18)
|
||||
#define ALT_FPGAMGR_IMGCFG_STAT_F2S_MSEL_SET_MSD (\
|
||||
ALT_FPGAMGR_IMGCFG_STAT_F2S_MSEL0_SET_MSK |\
|
||||
ALT_FPGAMGR_IMGCFG_STAT_F2S_MSEL1_SET_MSK |\
|
||||
ALT_FPGAMGR_IMGCFG_STAT_F2S_MSEL2_SET_MSK)
|
||||
#define ALT_FPGAMGR_IMGCFG_STAT_F2S_IMGCFG_FIFOEMPTY_SET_MSK BIT(24)
|
||||
#define ALT_FPGAMGR_IMGCFG_STAT_F2S_IMGCFG_FIFOFULL_SET_MSK BIT(25)
|
||||
#define ALT_FPGAMGR_IMGCFG_STAT_F2S_JTAGM_SET_MSK BIT(28)
|
||||
#define ALT_FPGAMGR_IMGCFG_STAT_F2S_EMR_SET_MSK BIT(29)
|
||||
#define ALT_FPGAMGR_IMGCFG_STAT_F2S_MSEL0_LSB 16
|
||||
|
||||
#define ALT_FPGAMGR_IMGCFG_CTL_00_S2F_NENABLE_NCONFIG_SET_MSK BIT(0)
|
||||
#define ALT_FPGAMGR_IMGCFG_CTL_00_S2F_NENABLE_NSTATUS_SET_MSK BIT(1)
|
||||
#define ALT_FPGAMGR_IMGCFG_CTL_00_S2F_NENABLE_CONDONE_SET_MSK BIT(2)
|
||||
#define ALT_FPGAMGR_IMGCFG_CTL_00_S2F_NCONFIG_SET_MSK BIT(8)
|
||||
#define ALT_FPGAMGR_IMGCFG_CTL_00_S2F_NSTATUS_OE_SET_MSK BIT(16)
|
||||
#define ALT_FPGAMGR_IMGCFG_CTL_00_S2F_CONDONE_OE_SET_MSK BIT(24)
|
||||
|
||||
#define ALT_FPGAMGR_IMGCFG_CTL_01_S2F_NENABLE_CONFIG_SET_MSK BIT(0)
|
||||
#define ALT_FPGAMGR_IMGCFG_CTL_01_S2F_PR_REQUEST_SET_MSK BIT(16)
|
||||
#define ALT_FPGAMGR_IMGCFG_CTL_01_S2F_NCE_SET_MSK BIT(24)
|
||||
|
||||
#define ALT_FPGAMGR_IMGCFG_CTL_02_EN_CFG_CTRL_SET_MSK BIT(0)
|
||||
#define ALT_FPGAMGR_IMGCFG_CTL_02_EN_CFG_DATA_SET_MSK BIT(8)
|
||||
#define ALT_FPGAMGR_IMGCFG_CTL_02_CDRATIO_SET_MSK 0x00030000
|
||||
#define ALT_FPGAMGR_IMGCFG_CTL_02_CFGWIDTH_SET_MSK BIT(24)
|
||||
#define ALT_FPGAMGR_IMGCFG_CTL_02_CDRATIO_LSB 16
|
||||
|
||||
#define FPGA_SOCFPGA_A10_RBF_UNENCRYPTED 0xa65c
|
||||
#define FPGA_SOCFPGA_A10_RBF_ENCRYPTED 0xa65d
|
||||
#define FPGA_SOCFPGA_A10_RBF_PERIPH 0x0001
|
||||
#define FPGA_SOCFPGA_A10_RBF_CORE 0x8001
|
||||
#ifndef __ASSEMBLY__
|
||||
|
||||
struct socfpga_fpga_manager {
|
||||
u32 _pad_0x0_0x7[2];
|
||||
u32 dclkcnt;
|
||||
u32 dclkstat;
|
||||
u32 gpo;
|
||||
u32 gpi;
|
||||
u32 misci;
|
||||
u32 _pad_0x1c_0x2f[5];
|
||||
u32 emr_data0;
|
||||
u32 emr_data1;
|
||||
u32 emr_data2;
|
||||
u32 emr_data3;
|
||||
u32 emr_data4;
|
||||
u32 emr_data5;
|
||||
u32 emr_valid;
|
||||
u32 emr_en;
|
||||
u32 jtag_config;
|
||||
u32 jtag_status;
|
||||
u32 jtag_kick;
|
||||
u32 _pad_0x5c_0x5f;
|
||||
u32 jtag_data_w;
|
||||
u32 jtag_data_r;
|
||||
u32 _pad_0x68_0x6f[2];
|
||||
u32 imgcfg_ctrl_00;
|
||||
u32 imgcfg_ctrl_01;
|
||||
u32 imgcfg_ctrl_02;
|
||||
u32 _pad_0x7c_0x7f;
|
||||
u32 imgcfg_stat;
|
||||
u32 intr_masked_status;
|
||||
u32 intr_mask;
|
||||
u32 intr_polarity;
|
||||
u32 dma_config;
|
||||
u32 imgcfg_fifo_status;
|
||||
};
|
||||
|
||||
enum rbf_type {
|
||||
unknown,
|
||||
periph_section,
|
||||
core_section
|
||||
};
|
||||
|
||||
enum rbf_security {
|
||||
invalid,
|
||||
unencrypted,
|
||||
encrypted
|
||||
};
|
||||
|
||||
struct rbf_info {
|
||||
enum rbf_type section;
|
||||
enum rbf_security security;
|
||||
};
|
||||
|
||||
struct fpga_loadfs_info {
|
||||
fpga_fs_info *fpga_fsinfo;
|
||||
u32 remaining;
|
||||
u32 offset;
|
||||
struct rbf_info rbfinfo;
|
||||
};
|
||||
|
||||
/* Functions */
|
||||
int fpgamgr_program_init(u32 * rbf_data, size_t rbf_size);
|
||||
int fpgamgr_program_finish(void);
|
||||
int is_fpgamgr_user_mode(void);
|
||||
int fpgamgr_wait_early_user_mode(void);
|
||||
const char *get_fpga_filename(void);
|
||||
int is_fpgamgr_early_user_mode(void);
|
||||
int socfpga_loadfs(fpga_fs_info *fpga_fsinfo, const void *buf, size_t bsize,
|
||||
u32 offset);
|
||||
void fpgamgr_program(const void *buf, size_t bsize, u32 offset);
|
||||
#endif /* __ASSEMBLY__ */
|
||||
|
||||
#endif /* _FPGA_MANAGER_ARRIA10_H_ */
|
||||
+67
@@ -0,0 +1,67 @@
|
||||
/* SPDX-License-Identifier: BSD-3-Clause */
|
||||
/*
|
||||
* Copyright (C) 2012-2017 Altera Corporation <www.altera.com>
|
||||
* All rights reserved.
|
||||
*/
|
||||
|
||||
#ifndef _FPGA_MANAGER_GEN5_H_
|
||||
#define _FPGA_MANAGER_GEN5_H_
|
||||
|
||||
#define FPGAMGRREGS_STAT_MODE_MASK 0x7
|
||||
#define FPGAMGRREGS_STAT_MSEL_MASK 0xf8
|
||||
#define FPGAMGRREGS_STAT_MSEL_LSB 3
|
||||
|
||||
#define FPGAMGRREGS_CTRL_CFGWDTH_MASK BIT(9)
|
||||
#define FPGAMGRREGS_CTRL_AXICFGEN_MASK BIT(8)
|
||||
#define FPGAMGRREGS_CTRL_NCONFIGPULL_MASK BIT(2)
|
||||
#define FPGAMGRREGS_CTRL_NCE_MASK BIT(1)
|
||||
#define FPGAMGRREGS_CTRL_EN_MASK BIT(0)
|
||||
#define FPGAMGRREGS_CTRL_CDRATIO_LSB 6
|
||||
|
||||
#define FPGAMGRREGS_MON_GPIO_EXT_PORTA_CRC_MASK BIT(3)
|
||||
#define FPGAMGRREGS_MON_GPIO_EXT_PORTA_ID_MASK BIT(2)
|
||||
#define FPGAMGRREGS_MON_GPIO_EXT_PORTA_CD_MASK BIT(1)
|
||||
#define FPGAMGRREGS_MON_GPIO_EXT_PORTA_NS_MASK BIT(0)
|
||||
|
||||
/* FPGA Mode */
|
||||
#define FPGAMGRREGS_MODE_FPGAOFF 0x0
|
||||
#define FPGAMGRREGS_MODE_RESETPHASE 0x1
|
||||
#define FPGAMGRREGS_MODE_CFGPHASE 0x2
|
||||
#define FPGAMGRREGS_MODE_INITPHASE 0x3
|
||||
#define FPGAMGRREGS_MODE_USERMODE 0x4
|
||||
#define FPGAMGRREGS_MODE_UNKNOWN 0x5
|
||||
|
||||
#ifndef __ASSEMBLY__
|
||||
|
||||
struct socfpga_fpga_manager {
|
||||
/* FPGA Manager Module */
|
||||
u32 stat; /* 0x00 */
|
||||
u32 ctrl;
|
||||
u32 dclkcnt;
|
||||
u32 dclkstat;
|
||||
u32 gpo; /* 0x10 */
|
||||
u32 gpi;
|
||||
u32 misci; /* 0x18 */
|
||||
u32 _pad_0x1c_0x82c[517];
|
||||
|
||||
/* Configuration Monitor (MON) Registers */
|
||||
u32 gpio_inten; /* 0x830 */
|
||||
u32 gpio_intmask;
|
||||
u32 gpio_inttype_level;
|
||||
u32 gpio_int_polarity;
|
||||
u32 gpio_intstatus; /* 0x840 */
|
||||
u32 gpio_raw_intstatus;
|
||||
u32 _pad_0x848;
|
||||
u32 gpio_porta_eoi;
|
||||
u32 gpio_ext_porta; /* 0x850 */
|
||||
u32 _pad_0x854_0x85c[3];
|
||||
u32 gpio_1s_sync; /* 0x860 */
|
||||
u32 _pad_0x864_0x868[2];
|
||||
u32 gpio_ver_id_code;
|
||||
u32 gpio_config_reg2; /* 0x870 */
|
||||
u32 gpio_config_reg1;
|
||||
};
|
||||
|
||||
#endif /* __ASSEMBLY__ */
|
||||
|
||||
#endif /* _FPGA_MANAGER_GEN5_H_ */
|
||||
+48
@@ -0,0 +1,48 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0+ */
|
||||
/*
|
||||
* Copyright (C) 2013 Altera Corporation <www.altera.com>
|
||||
*/
|
||||
|
||||
#ifndef _FREEZE_CONTROLLER_H_
|
||||
#define _FREEZE_CONTROLLER_H_
|
||||
|
||||
struct socfpga_freeze_controller {
|
||||
u32 vioctrl;
|
||||
u32 padding[3];
|
||||
u32 hioctrl;
|
||||
u32 src;
|
||||
u32 hwctrl;
|
||||
};
|
||||
|
||||
#define FREEZE_CHANNEL_NUM (4)
|
||||
|
||||
typedef enum {
|
||||
FREEZE_CTRL_FROZEN = 0,
|
||||
FREEZE_CTRL_THAWED = 1
|
||||
} FREEZE_CTRL_CHAN_STATE;
|
||||
|
||||
#define SYSMGR_FRZCTRL_ADDRESS 0x40
|
||||
#define SYSMGR_FRZCTRL_SRC_VIO1_ENUM_SW 0x0
|
||||
#define SYSMGR_FRZCTRL_SRC_VIO1_ENUM_HW 0x1
|
||||
#define SYSMGR_FRZCTRL_VIOCTRL_SLEW_MASK 0x00000010
|
||||
#define SYSMGR_FRZCTRL_VIOCTRL_WKPULLUP_MASK 0x00000008
|
||||
#define SYSMGR_FRZCTRL_VIOCTRL_TRISTATE_MASK 0x00000004
|
||||
#define SYSMGR_FRZCTRL_VIOCTRL_BUSHOLD_MASK 0x00000002
|
||||
#define SYSMGR_FRZCTRL_VIOCTRL_CFG_MASK 0x00000001
|
||||
#define SYSMGR_FRZCTRL_HIOCTRL_SLEW_MASK 0x00000010
|
||||
#define SYSMGR_FRZCTRL_HIOCTRL_WKPULLUP_MASK 0x00000008
|
||||
#define SYSMGR_FRZCTRL_HIOCTRL_TRISTATE_MASK 0x00000004
|
||||
#define SYSMGR_FRZCTRL_HIOCTRL_BUSHOLD_MASK 0x00000002
|
||||
#define SYSMGR_FRZCTRL_HIOCTRL_CFG_MASK 0x00000001
|
||||
#define SYSMGR_FRZCTRL_HIOCTRL_REGRST_MASK 0x00000080
|
||||
#define SYSMGR_FRZCTRL_HIOCTRL_OCTRST_MASK 0x00000040
|
||||
#define SYSMGR_FRZCTRL_HIOCTRL_OCT_CFGEN_CALSTART_MASK 0x00000100
|
||||
#define SYSMGR_FRZCTRL_HIOCTRL_DLLRST_MASK 0x00000020
|
||||
#define SYSMGR_FRZCTRL_HWCTRL_VIO1REQ_MASK 0x00000001
|
||||
#define SYSMGR_FRZCTRL_HWCTRL_VIO1STATE_ENUM_FROZEN 0x2
|
||||
#define SYSMGR_FRZCTRL_HWCTRL_VIO1STATE_ENUM_THAWED 0x1
|
||||
|
||||
void sys_mgr_frzctrl_freeze_req(void);
|
||||
void sys_mgr_frzctrl_thaw_req(void);
|
||||
|
||||
#endif /* _FREEZE_CONTROLLER_H_ */
|
||||
@@ -0,0 +1,9 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0+ */
|
||||
/*
|
||||
* Copyright (C) 2014 Stefan Roese <sr@denx.de>
|
||||
*/
|
||||
|
||||
#ifndef _SOCFPGA_GPIO_H
|
||||
#define _SOCFPGA_GPIO_H
|
||||
|
||||
#endif /* _SOCFPGA_GPIO_H */
|
||||
@@ -0,0 +1,34 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0
|
||||
*
|
||||
* Copyright (C) 2016-2018 Intel Corporation <www.intel.com>
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _HANDOFF_S10_H_
|
||||
#define _HANDOFF_S10_H_
|
||||
|
||||
/*
|
||||
* Offset for HW handoff from Quartus tools
|
||||
*/
|
||||
#define S10_HANDOFF_BASE 0xFFE3F000
|
||||
#define S10_HANDOFF_MUX (S10_HANDOFF_BASE + 0x10)
|
||||
#define S10_HANDOFF_IOCTL (S10_HANDOFF_BASE + 0x1A0)
|
||||
#define S10_HANDOFF_FPGA (S10_HANDOFF_BASE + 0x330)
|
||||
#define S10_HANODFF_DELAY (S10_HANDOFF_BASE + 0x3F0)
|
||||
#define S10_HANDOFF_CLOCK (S10_HANDOFF_BASE + 0x580)
|
||||
#define S10_HANDOFF_MISC (S10_HANDOFF_BASE + 0x610)
|
||||
#define S10_HANDOFF_MAGIC_MUX 0x504D5558
|
||||
#define S10_HANDOFF_MAGIC_IOCTL 0x494F4354
|
||||
#define S10_HANDOFF_MAGIC_FPGA 0x46504741
|
||||
#define S10_HANDOFF_MAGIC_DELAY 0x444C4159
|
||||
#define S10_HANDOFF_MAGIC_CLOCK 0x434C4B53
|
||||
#define S10_HANDOFF_MAGIC_MISC 0x4D495343
|
||||
#define S10_HANDOFF_OFFSET_LENGTH 0x4
|
||||
#define S10_HANDOFF_OFFSET_DATA 0x10
|
||||
|
||||
#define S10_HANDOFF_CLOCK_OSC (S10_HANDOFF_BASE + 0x608)
|
||||
#define S10_HANDOFF_CLOCK_FPGA (S10_HANDOFF_BASE + 0x60C)
|
||||
|
||||
#define S10_HANDOFF_SIZE 4096
|
||||
|
||||
#endif /* _HANDOFF_S10_H_ */
|
||||
@@ -0,0 +1,151 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0
|
||||
*
|
||||
* Copyright (C) 2017-2018 Intel Corporation <www.intel.com>
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _MAILBOX_S10_H_
|
||||
#define _MAILBOX_S10_H_
|
||||
|
||||
/* user define Uboot ID */
|
||||
#define MBOX_CLIENT_ID_UBOOT 0xB
|
||||
#define MBOX_ID_UBOOT 0x1
|
||||
|
||||
#define MBOX_CMD_DIRECT 0
|
||||
#define MBOX_CMD_INDIRECT 1
|
||||
|
||||
#define MBOX_MAX_CMD_INDEX 2047
|
||||
#define MBOX_CMD_BUFFER_SIZE 32
|
||||
#define MBOX_RESP_BUFFER_SIZE 16
|
||||
|
||||
#define MBOX_HDR_CMD_LSB 0
|
||||
#define MBOX_HDR_CMD_MSK (BIT(11) - 1)
|
||||
#define MBOX_HDR_I_LSB 11
|
||||
#define MBOX_HDR_I_MSK BIT(11)
|
||||
#define MBOX_HDR_LEN_LSB 12
|
||||
#define MBOX_HDR_LEN_MSK 0x007FF000
|
||||
#define MBOX_HDR_ID_LSB 24
|
||||
#define MBOX_HDR_ID_MSK 0x0F000000
|
||||
#define MBOX_HDR_CLIENT_LSB 28
|
||||
#define MBOX_HDR_CLIENT_MSK 0xF0000000
|
||||
|
||||
/* Interrupt flags */
|
||||
#define MBOX_FLAGS_INT_COE BIT(0) /* COUT update interrupt enable */
|
||||
#define MBOX_FLAGS_INT_RIE BIT(1) /* RIN update interrupt enable */
|
||||
#define MBOX_FLAGS_INT_UAE BIT(8) /* Urgent ACK interrupt enable */
|
||||
#define MBOX_ALL_INTRS (MBOX_FLAGS_INT_COE | \
|
||||
MBOX_FLAGS_INT_RIE | \
|
||||
MBOX_FLAGS_INT_UAE)
|
||||
|
||||
/* Status */
|
||||
#define MBOX_STATUS_UA_MSK BIT(8)
|
||||
|
||||
#define MBOX_CMD_HEADER(client, id, len, indirect, cmd) \
|
||||
((((cmd) << MBOX_HDR_CMD_LSB) & MBOX_HDR_CMD_MSK) | \
|
||||
(((indirect) << MBOX_HDR_I_LSB) & MBOX_HDR_I_MSK) | \
|
||||
(((len) << MBOX_HDR_LEN_LSB) & MBOX_HDR_LEN_MSK) | \
|
||||
(((id) << MBOX_HDR_ID_LSB) & MBOX_HDR_ID_MSK) | \
|
||||
(((client) << MBOX_HDR_CLIENT_LSB) & MBOX_HDR_CLIENT_MSK))
|
||||
|
||||
#define MBOX_RESP_ERR_GET(resp) \
|
||||
(((resp) & MBOX_HDR_CMD_MSK) >> MBOX_HDR_CMD_LSB)
|
||||
#define MBOX_RESP_LEN_GET(resp) \
|
||||
(((resp) & MBOX_HDR_LEN_MSK) >> MBOX_HDR_LEN_LSB)
|
||||
#define MBOX_RESP_ID_GET(resp) \
|
||||
(((resp) & MBOX_HDR_ID_MSK) >> MBOX_HDR_ID_LSB)
|
||||
#define MBOX_RESP_CLIENT_GET(resp) \
|
||||
(((resp) & MBOX_HDR_CLIENT_MSK) >> MBOX_HDR_CLIENT_LSB)
|
||||
|
||||
/* Response error list */
|
||||
enum ALT_SDM_MBOX_RESP_CODE {
|
||||
/* CMD completed successfully, but check resp ARGS for any errors */
|
||||
MBOX_RESP_STATOK = 0,
|
||||
/* CMD is incorrectly formatted in some way */
|
||||
MBOX_RESP_INVALID_COMMAND = 1,
|
||||
/* BootROM Command code not undesrtood */
|
||||
MBOX_RESP_UNKNOWN_BR = 2,
|
||||
/* CMD code not recognized by firmware */
|
||||
MBOX_RESP_UNKNOWN = 3,
|
||||
/* Indicates that the device is not configured */
|
||||
MBOX_RESP_NOT_CONFIGURED = 256,
|
||||
/* Indicates that the device is busy */
|
||||
MBOX_RESP_DEVICE_BUSY = 0x1FF,
|
||||
/* Indicates that there is no valid response available */
|
||||
MBOX_RESP_NO_VALID_RESP_AVAILABLE = 0x2FF,
|
||||
/* General Error */
|
||||
MBOX_RESP_ERROR = 0x3FF,
|
||||
};
|
||||
|
||||
/* Mailbox command list */
|
||||
#define MBOX_RESTART 2
|
||||
#define MBOX_CONFIG_STATUS 4
|
||||
#define MBOX_RECONFIG 6
|
||||
#define MBOX_RECONFIG_MSEL 7
|
||||
#define MBOX_RECONFIG_DATA 8
|
||||
#define MBOX_RECONFIG_STATUS 9
|
||||
#define MBOX_QSPI_OPEN 50
|
||||
#define MBOX_QSPI_CLOSE 51
|
||||
#define MBOX_QSPI_DIRECT 59
|
||||
#define MBOX_REBOOT_HPS 71
|
||||
|
||||
/* Mailbox registers */
|
||||
#define MBOX_CIN 0 /* command valid offset */
|
||||
#define MBOX_ROUT 4 /* response output offset */
|
||||
#define MBOX_URG 8 /* urgent command */
|
||||
#define MBOX_FLAGS 0x0c /* interrupt enables */
|
||||
#define MBOX_COUT 0x20 /* command free offset */
|
||||
#define MBOX_RIN 0x24 /* respond valid offset */
|
||||
#define MBOX_STATUS 0x2c /* mailbox status */
|
||||
#define MBOX_CMD_BUF 0x40 /* circular command buffer */
|
||||
#define MBOX_RESP_BUF 0xc0 /* circular response buffer */
|
||||
#define MBOX_DOORBELL_TO_SDM 0x400 /* Doorbell to SDM */
|
||||
#define MBOX_DOORBELL_FROM_SDM 0x480 /* Doorbell from SDM */
|
||||
|
||||
/* Status and bit information returned by RECONFIG_STATUS */
|
||||
#define RECONFIG_STATUS_RESPONSE_LEN 6
|
||||
#define RECONFIG_STATUS_STATE 0
|
||||
#define RECONFIG_STATUS_PIN_STATUS 2
|
||||
#define RECONFIG_STATUS_SOFTFUNC_STATUS 3
|
||||
|
||||
/* Macros for specifying number of arguments in mailbox command */
|
||||
#define MBOX_NUM_ARGS(n, b) (((n) & 0xFF) << (b))
|
||||
#define MBOX_DIRECT_COUNT(n) MBOX_NUM_ARGS((n), 0)
|
||||
#define MBOX_ARG_DESC_COUNT(n) MBOX_NUM_ARGS((n), 8)
|
||||
#define MBOX_RESP_DESC_COUNT(n) MBOX_NUM_ARGS((n), 16)
|
||||
|
||||
#define MBOX_CFGSTAT_STATE_IDLE 0x00000000
|
||||
#define MBOX_CFGSTAT_STATE_CONFIG 0x10000000
|
||||
#define MBOX_CFGSTAT_STATE_FAILACK 0x08000000
|
||||
#define MBOX_CFGSTAT_STATE_ERROR_INVALID 0xf0000001
|
||||
#define MBOX_CFGSTAT_STATE_ERROR_CORRUPT 0xf0000002
|
||||
#define MBOX_CFGSTAT_STATE_ERROR_AUTH 0xf0000003
|
||||
#define MBOX_CFGSTAT_STATE_ERROR_CORE_IO 0xf0000004
|
||||
#define MBOX_CFGSTAT_STATE_ERROR_HARDWARE 0xf0000005
|
||||
#define MBOX_CFGSTAT_STATE_ERROR_FAKE 0xf0000006
|
||||
#define MBOX_CFGSTAT_STATE_ERROR_BOOT_INFO 0xf0000007
|
||||
#define MBOX_CFGSTAT_STATE_ERROR_QSPI_ERROR 0xf0000008
|
||||
|
||||
#define RCF_SOFTFUNC_STATUS_CONF_DONE BIT(0)
|
||||
#define RCF_SOFTFUNC_STATUS_INIT_DONE BIT(1)
|
||||
#define RCF_SOFTFUNC_STATUS_SEU_ERROR BIT(3)
|
||||
#define RCF_PIN_STATUS_NSTATUS BIT(31)
|
||||
|
||||
int mbox_send_cmd(u8 id, u32 cmd, u8 is_indirect, u32 len, u32 *arg, u8 urgent,
|
||||
u32 *resp_buf_len, u32 *resp_buf);
|
||||
int mbox_send_cmd_psci(u8 id, u32 cmd, u8 is_indirect, u32 len, u32 *arg,
|
||||
u8 urgent, u32 *resp_buf_len, u32 *resp_buf);
|
||||
int mbox_send_cmd_only(u8 id, u32 cmd, u8 is_indirect, u32 len, u32 *arg);
|
||||
int mbox_send_cmd_only_psci(u8 id, u32 cmd, u8 is_indirect, u32 len, u32 *arg);
|
||||
int mbox_rcv_resp(u32 *resp_buf, u32 resp_buf_max_len);
|
||||
int mbox_rcv_resp_psci(u32 *resp_buf, u32 resp_buf_max_len);
|
||||
int mbox_init(void);
|
||||
|
||||
#ifdef CONFIG_CADENCE_QSPI
|
||||
int mbox_qspi_close(void);
|
||||
int mbox_qspi_open(void);
|
||||
#endif
|
||||
|
||||
int mbox_reset_cold(void);
|
||||
int mbox_get_fpga_config_status(u32 cmd);
|
||||
int mbox_get_fpga_config_status_psci(u32 cmd);
|
||||
#endif /* _MAILBOX_S10_H_ */
|
||||
@@ -0,0 +1,45 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0 */
|
||||
/*
|
||||
* Copyright (C) 2016-2017 Intel Corporation
|
||||
*/
|
||||
|
||||
#ifndef _SOCFPGA_MISC_H_
|
||||
#define _SOCFPGA_MISC_H_
|
||||
|
||||
#include <asm/sections.h>
|
||||
|
||||
void dwmac_deassert_reset(const unsigned int of_reset_id, const u32 phymode);
|
||||
|
||||
struct bsel {
|
||||
const char *mode;
|
||||
const char *name;
|
||||
};
|
||||
|
||||
extern struct bsel bsel_str[];
|
||||
|
||||
#ifdef CONFIG_FPGA
|
||||
void socfpga_fpga_add(void *fpga_desc);
|
||||
#else
|
||||
inline void socfpga_fpga_add(void *fpga_desc) {}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_TARGET_SOCFPGA_GEN5
|
||||
void socfpga_sdram_remap_zero(void);
|
||||
static inline bool socfpga_is_booting_from_fpga(void)
|
||||
{
|
||||
if ((__image_copy_start >= (char *)SOCFPGA_FPGA_SLAVES_ADDRESS) &&
|
||||
(__image_copy_start < (char *)SOCFPGA_STM_ADDRESS))
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_TARGET_SOCFPGA_ARRIA10
|
||||
void socfpga_init_security_policies(void);
|
||||
void socfpga_sdram_remap_zero(void);
|
||||
#endif
|
||||
|
||||
void do_bridge_reset(int enable, unsigned int mask);
|
||||
void socfpga_pl310_clear(void);
|
||||
|
||||
#endif /* _SOCFPGA_MISC_H_ */
|
||||
@@ -0,0 +1,194 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0+ */
|
||||
/*
|
||||
* Copyright (C) 2014 Marek Vasut <marex@denx.de>
|
||||
*/
|
||||
|
||||
#ifndef _NIC301_REGISTERS_H_
|
||||
#define _NIC301_REGISTERS_H_
|
||||
|
||||
struct nic301_registers {
|
||||
u32 remap; /* 0x0 */
|
||||
/* Security Register Group */
|
||||
u32 _pad_0x4_0x8[1];
|
||||
u32 l4main;
|
||||
u32 l4sp;
|
||||
u32 l4mp; /* 0x10 */
|
||||
u32 l4osc1;
|
||||
u32 l4spim;
|
||||
u32 stm;
|
||||
u32 lwhps2fpgaregs; /* 0x20 */
|
||||
u32 _pad_0x24_0x28[1];
|
||||
u32 usb1;
|
||||
u32 nanddata;
|
||||
u32 _pad_0x30_0x80[20];
|
||||
u32 usb0; /* 0x80 */
|
||||
u32 nandregs;
|
||||
u32 qspidata;
|
||||
u32 fpgamgrdata;
|
||||
u32 hps2fpgaregs; /* 0x90 */
|
||||
u32 acp;
|
||||
u32 rom;
|
||||
u32 ocram;
|
||||
u32 sdrdata; /* 0xA0 */
|
||||
u32 _pad_0xa4_0x1fd0[1995];
|
||||
/* ID Register Group */
|
||||
u32 periph_id_4; /* 0x1FD0 */
|
||||
u32 _pad_0x1fd4_0x1fe0[3];
|
||||
u32 periph_id_0; /* 0x1FE0 */
|
||||
u32 periph_id_1;
|
||||
u32 periph_id_2;
|
||||
u32 periph_id_3;
|
||||
u32 comp_id_0; /* 0x1FF0 */
|
||||
u32 comp_id_1;
|
||||
u32 comp_id_2;
|
||||
u32 comp_id_3;
|
||||
u32 _pad_0x2000_0x2008[2];
|
||||
/* L4 MAIN */
|
||||
u32 l4main_fn_mod_bm_iss;
|
||||
u32 _pad_0x200c_0x3008[1023];
|
||||
/* L4 SP */
|
||||
u32 l4sp_fn_mod_bm_iss;
|
||||
u32 _pad_0x300c_0x4008[1023];
|
||||
/* L4 MP */
|
||||
u32 l4mp_fn_mod_bm_iss;
|
||||
u32 _pad_0x400c_0x5008[1023];
|
||||
/* L4 OSC1 */
|
||||
u32 l4osc_fn_mod_bm_iss;
|
||||
u32 _pad_0x500c_0x6008[1023];
|
||||
/* L4 SPIM */
|
||||
u32 l4spim_fn_mod_bm_iss;
|
||||
u32 _pad_0x600c_0x7008[1023];
|
||||
/* STM */
|
||||
u32 stm_fn_mod_bm_iss;
|
||||
u32 _pad_0x700c_0x7108[63];
|
||||
u32 stm_fn_mod;
|
||||
u32 _pad_0x710c_0x8008[959];
|
||||
/* LWHPS2FPGA */
|
||||
u32 lwhps2fpga_fn_mod_bm_iss;
|
||||
u32 _pad_0x800c_0x8108[63];
|
||||
u32 lwhps2fpga_fn_mod;
|
||||
u32 _pad_0x810c_0xa008[1983];
|
||||
/* USB1 */
|
||||
u32 usb1_fn_mod_bm_iss;
|
||||
u32 _pad_0xa00c_0xa044[14];
|
||||
u32 usb1_ahb_cntl;
|
||||
u32 _pad_0xa048_0xb008[1008];
|
||||
/* NANDDATA */
|
||||
u32 nanddata_fn_mod_bm_iss;
|
||||
u32 _pad_0xb00c_0xb108[63];
|
||||
u32 nanddata_fn_mod;
|
||||
u32 _pad_0xb10c_0x20008[21439];
|
||||
/* USB0 */
|
||||
u32 usb0_fn_mod_bm_iss;
|
||||
u32 _pad_0x2000c_0x20044[14];
|
||||
u32 usb0_ahb_cntl;
|
||||
u32 _pad_0x20048_0x21008[1008];
|
||||
/* NANDREGS */
|
||||
u32 nandregs_fn_mod_bm_iss;
|
||||
u32 _pad_0x2100c_0x21108[63];
|
||||
u32 nandregs_fn_mod;
|
||||
u32 _pad_0x2110c_0x22008[959];
|
||||
/* QSPIDATA */
|
||||
u32 qspidata_fn_mod_bm_iss;
|
||||
u32 _pad_0x2200c_0x22044[14];
|
||||
u32 qspidata_ahb_cntl;
|
||||
u32 _pad_0x22048_0x23008[1008];
|
||||
/* FPGAMGRDATA */
|
||||
u32 fpgamgrdata_fn_mod_bm_iss;
|
||||
u32 _pad_0x2300c_0x23040[13];
|
||||
u32 fpgamgrdata_wr_tidemark; /* 0x23040 */
|
||||
u32 _pad_0x23044_0x23108[49];
|
||||
u32 fn_mod;
|
||||
u32 _pad_0x2310c_0x24008[959];
|
||||
/* HPS2FPGA */
|
||||
u32 hps2fpga_fn_mod_bm_iss;
|
||||
u32 _pad_0x2400c_0x24040[13];
|
||||
u32 hps2fpga_wr_tidemark; /* 0x24040 */
|
||||
u32 _pad_0x24044_0x24108[49];
|
||||
u32 hps2fpga_fn_mod;
|
||||
u32 _pad_0x2410c_0x25008[959];
|
||||
/* ACP */
|
||||
u32 acp_fn_mod_bm_iss;
|
||||
u32 _pad_0x2500c_0x25108[63];
|
||||
u32 acp_fn_mod;
|
||||
u32 _pad_0x2510c_0x26008[959];
|
||||
/* Boot ROM */
|
||||
u32 bootrom_fn_mod_bm_iss;
|
||||
u32 _pad_0x2600c_0x26108[63];
|
||||
u32 bootrom_fn_mod;
|
||||
u32 _pad_0x2610c_0x27008[959];
|
||||
/* On-chip RAM */
|
||||
u32 ocram_fn_mod_bm_iss;
|
||||
u32 _pad_0x2700c_0x27040[13];
|
||||
u32 ocram_wr_tidemark; /* 0x27040 */
|
||||
u32 _pad_0x27044_0x27108[49];
|
||||
u32 ocram_fn_mod;
|
||||
u32 _pad_0x2710c_0x42024[27590];
|
||||
/* DAP */
|
||||
u32 dap_fn_mod2;
|
||||
u32 dap_fn_mod_ahb;
|
||||
u32 _pad_0x4202c_0x42100[53];
|
||||
u32 dap_read_qos; /* 0x42100 */
|
||||
u32 dap_write_qos;
|
||||
u32 dap_fn_mod;
|
||||
u32 _pad_0x4210c_0x43100[1021];
|
||||
/* MPU */
|
||||
u32 mpu_read_qos; /* 0x43100 */
|
||||
u32 mpu_write_qos;
|
||||
u32 mpu_fn_mod;
|
||||
u32 _pad_0x4310c_0x44028[967];
|
||||
/* SDMMC */
|
||||
u32 sdmmc_fn_mod_ahb;
|
||||
u32 _pad_0x4402c_0x44100[53];
|
||||
u32 sdmmc_read_qos; /* 0x44100 */
|
||||
u32 sdmmc_write_qos;
|
||||
u32 sdmmc_fn_mod;
|
||||
u32 _pad_0x4410c_0x45100[1021];
|
||||
/* DMA */
|
||||
u32 dma_read_qos; /* 0x45100 */
|
||||
u32 dma_write_qos;
|
||||
u32 dma_fn_mod;
|
||||
u32 _pad_0x4510c_0x46040[973];
|
||||
/* FPGA2HPS */
|
||||
u32 fpga2hps_wr_tidemark; /* 0x46040 */
|
||||
u32 _pad_0x46044_0x46100[47];
|
||||
u32 fpga2hps_read_qos; /* 0x46100 */
|
||||
u32 fpga2hps_write_qos;
|
||||
u32 fpga2hps_fn_mod;
|
||||
u32 _pad_0x4610c_0x47100[1021];
|
||||
/* ETR */
|
||||
u32 etr_read_qos; /* 0x47100 */
|
||||
u32 etr_write_qos;
|
||||
u32 etr_fn_mod;
|
||||
u32 _pad_0x4710c_0x48100[1021];
|
||||
/* EMAC0 */
|
||||
u32 emac0_read_qos; /* 0x48100 */
|
||||
u32 emac0_write_qos;
|
||||
u32 emac0_fn_mod;
|
||||
u32 _pad_0x4810c_0x49100[1021];
|
||||
/* EMAC1 */
|
||||
u32 emac1_read_qos; /* 0x49100 */
|
||||
u32 emac1_write_qos;
|
||||
u32 emac1_fn_mod;
|
||||
u32 _pad_0x4910c_0x4a028[967];
|
||||
/* USB0 */
|
||||
u32 usb0_fn_mod_ahb;
|
||||
u32 _pad_0x4a02c_0x4a100[53];
|
||||
u32 usb0_read_qos; /* 0x4A100 */
|
||||
u32 usb0_write_qos;
|
||||
u32 usb0_fn_mod;
|
||||
u32 _pad_0x4a10c_0x4b100[1021];
|
||||
/* NAND */
|
||||
u32 nand_read_qos; /* 0x4B100 */
|
||||
u32 nand_write_qos;
|
||||
u32 nand_fn_mod;
|
||||
u32 _pad_0x4b10c_0x4c028[967];
|
||||
/* USB1 */
|
||||
u32 usb1_fn_mod_ahb;
|
||||
u32 _pad_0x4c02c_0x4c100[53];
|
||||
u32 usb1_read_qos; /* 0x4C100 */
|
||||
u32 usb1_write_qos;
|
||||
u32 usb1_fn_mod;
|
||||
};
|
||||
|
||||
#endif /* _NIC301_REGISTERS_H_ */
|
||||
@@ -0,0 +1,16 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0 */
|
||||
/*
|
||||
* Copyright (C) 2016-2017 Intel Corporation <www.intel.com>
|
||||
*/
|
||||
|
||||
#ifndef _PINMUX_H_
|
||||
#define _PINMUX_H_
|
||||
|
||||
#define PINMUX_UART 0xD
|
||||
|
||||
#ifndef __ASSEMBLY__
|
||||
int config_dedicated_pins(const void *blob);
|
||||
int config_pins(const void *blob, const char *pin_grp);
|
||||
#endif
|
||||
|
||||
#endif /* _PINMUX_H_ */
|
||||
@@ -0,0 +1,48 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0+ */
|
||||
/*
|
||||
* Copyright (C) 2012-2017 Altera Corporation <www.altera.com>
|
||||
*/
|
||||
|
||||
#ifndef _RESET_MANAGER_H_
|
||||
#define _RESET_MANAGER_H_
|
||||
|
||||
void reset_cpu(ulong addr);
|
||||
|
||||
void socfpga_per_reset(u32 reset, int set);
|
||||
void socfpga_per_reset_all(void);
|
||||
|
||||
#define RSTMGR_CTRL_SWCOLDRSTREQ_LSB 0
|
||||
#define RSTMGR_CTRL_SWWARMRSTREQ_LSB 1
|
||||
|
||||
/*
|
||||
* Define a reset identifier, from which a permodrst bank ID
|
||||
* and reset ID can be extracted using the subsequent macros
|
||||
* RSTMGR_RESET() and RSTMGR_BANK().
|
||||
*/
|
||||
#define RSTMGR_BANK_OFFSET 8
|
||||
#define RSTMGR_BANK_MASK 0x7
|
||||
#define RSTMGR_RESET_OFFSET 0
|
||||
#define RSTMGR_RESET_MASK 0x1f
|
||||
#define RSTMGR_DEFINE(_bank, _offset) \
|
||||
((_bank) << RSTMGR_BANK_OFFSET) | ((_offset) << RSTMGR_RESET_OFFSET)
|
||||
|
||||
/* Extract reset ID from the reset identifier. */
|
||||
#define RSTMGR_RESET(_reset) \
|
||||
(((_reset) >> RSTMGR_RESET_OFFSET) & RSTMGR_RESET_MASK)
|
||||
|
||||
/* Extract bank ID from the reset identifier. */
|
||||
#define RSTMGR_BANK(_reset) \
|
||||
(((_reset) >> RSTMGR_BANK_OFFSET) & RSTMGR_BANK_MASK)
|
||||
|
||||
/* Create a human-readable reference to SoCFPGA reset. */
|
||||
#define SOCFPGA_RESET(_name) RSTMGR_##_name
|
||||
|
||||
#if defined(CONFIG_TARGET_SOCFPGA_GEN5)
|
||||
#include <asm/arch/reset_manager_gen5.h>
|
||||
#elif defined(CONFIG_TARGET_SOCFPGA_ARRIA10)
|
||||
#include <asm/arch/reset_manager_arria10.h>
|
||||
#elif defined(CONFIG_TARGET_SOCFPGA_STRATIX10)
|
||||
#include <asm/arch/reset_manager_s10.h>
|
||||
#endif
|
||||
|
||||
#endif /* _RESET_MANAGER_H_ */
|
||||
+142
@@ -0,0 +1,142 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0 */
|
||||
/*
|
||||
* Copyright (C) 2016-2017 Intel Corporation
|
||||
*/
|
||||
|
||||
#ifndef _RESET_MANAGER_ARRIA10_H_
|
||||
#define _RESET_MANAGER_ARRIA10_H_
|
||||
|
||||
#include <dt-bindings/reset/altr,rst-mgr-a10.h>
|
||||
|
||||
void socfpga_watchdog_disable(void);
|
||||
void socfpga_reset_deassert_noc_ddr_scheduler(void);
|
||||
int socfpga_reset_deassert_bridges_handoff(void);
|
||||
void socfpga_reset_deassert_osc1wd0(void);
|
||||
int socfpga_bridges_reset(void);
|
||||
|
||||
struct socfpga_reset_manager {
|
||||
u32 stat;
|
||||
u32 ramstat;
|
||||
u32 miscstat;
|
||||
u32 ctrl;
|
||||
u32 hdsken;
|
||||
u32 hdskreq;
|
||||
u32 hdskack;
|
||||
u32 counts;
|
||||
u32 mpumodrst;
|
||||
u32 per0modrst;
|
||||
u32 per1modrst;
|
||||
u32 brgmodrst;
|
||||
u32 sysmodrst;
|
||||
u32 coldmodrst;
|
||||
u32 nrstmodrst;
|
||||
u32 dbgmodrst;
|
||||
u32 mpuwarmmask;
|
||||
u32 per0warmmask;
|
||||
u32 per1warmmask;
|
||||
u32 brgwarmmask;
|
||||
u32 syswarmmask;
|
||||
u32 nrstwarmmask;
|
||||
u32 l3warmmask;
|
||||
u32 tststa;
|
||||
u32 tstscratch;
|
||||
u32 hdsktimeout;
|
||||
u32 hmcintr;
|
||||
u32 hmcintren;
|
||||
u32 hmcintrens;
|
||||
u32 hmcintrenr;
|
||||
u32 hmcgpout;
|
||||
u32 hmcgpin;
|
||||
};
|
||||
|
||||
/*
|
||||
* SocFPGA Arria10 reset IDs, bank mapping is as follows:
|
||||
* 0 ... mpumodrst
|
||||
* 1 ... per0modrst
|
||||
* 2 ... per1modrst
|
||||
* 3 ... brgmodrst
|
||||
* 4 ... sysmodrst
|
||||
*/
|
||||
#define RSTMGR_EMAC0 RSTMGR_DEFINE(1, 0)
|
||||
#define RSTMGR_EMAC1 RSTMGR_DEFINE(1, 1)
|
||||
#define RSTMGR_EMAC2 RSTMGR_DEFINE(1, 2)
|
||||
#define RSTMGR_NAND RSTMGR_DEFINE(1, 5)
|
||||
#define RSTMGR_QSPI RSTMGR_DEFINE(1, 6)
|
||||
#define RSTMGR_SDMMC RSTMGR_DEFINE(1, 7)
|
||||
#define RSTMGR_DMA RSTMGR_DEFINE(1, 16)
|
||||
#define RSTMGR_SPIM0 RSTMGR_DEFINE(1, 17)
|
||||
#define RSTMGR_SPIM1 RSTMGR_DEFINE(1, 18)
|
||||
#define RSTMGR_L4WD0 RSTMGR_DEFINE(2, 0)
|
||||
#define RSTMGR_L4WD1 RSTMGR_DEFINE(2, 1)
|
||||
#define RSTMGR_L4SYSTIMER0 RSTMGR_DEFINE(2, 2)
|
||||
#define RSTMGR_L4SYSTIMER1 RSTMGR_DEFINE(2, 3)
|
||||
#define RSTMGR_SPTIMER0 RSTMGR_DEFINE(2, 4)
|
||||
#define RSTMGR_SPTIMER1 RSTMGR_DEFINE(2, 5)
|
||||
#define RSTMGR_UART0 RSTMGR_DEFINE(2, 16)
|
||||
#define RSTMGR_UART1 RSTMGR_DEFINE(2, 17)
|
||||
#define RSTMGR_DDRSCH RSTMGR_DEFINE(3, 6)
|
||||
|
||||
#define ALT_RSTMGR_CTL_SWWARMRSTREQ_SET_MSK BIT(1)
|
||||
#define ALT_RSTMGR_PER0MODRST_EMAC0_SET_MSK BIT(0)
|
||||
#define ALT_RSTMGR_PER0MODRST_EMAC1_SET_MSK BIT(1)
|
||||
#define ALT_RSTMGR_PER0MODRST_EMAC2_SET_MSK BIT(2)
|
||||
#define ALT_RSTMGR_PER0MODRST_USB0_SET_MSK BIT(3)
|
||||
#define ALT_RSTMGR_PER0MODRST_USB1_SET_MSK BIT(4)
|
||||
#define ALT_RSTMGR_PER0MODRST_NAND_SET_MSK BIT(5)
|
||||
#define ALT_RSTMGR_PER0MODRST_QSPI_SET_MSK BIT(6)
|
||||
#define ALT_RSTMGR_PER0MODRST_SDMMC_SET_MSK BIT(7)
|
||||
#define ALT_RSTMGR_PER0MODRST_EMACECC0_SET_MSK BIT(8)
|
||||
#define ALT_RSTMGR_PER0MODRST_EMACECC1_SET_MSK BIT(9)
|
||||
#define ALT_RSTMGR_PER0MODRST_EMACECC2_SET_MSK BIT(10)
|
||||
#define ALT_RSTMGR_PER0MODRST_USBECC0_SET_MSK BIT(11)
|
||||
#define ALT_RSTMGR_PER0MODRST_USBECC1_SET_MSK BIT(12)
|
||||
#define ALT_RSTMGR_PER0MODRST_NANDECC_SET_MSK BIT(13)
|
||||
#define ALT_RSTMGR_PER0MODRST_QSPIECC_SET_MSK BIT(14)
|
||||
#define ALT_RSTMGR_PER0MODRST_SDMMCECC_SET_MSK BIT(15)
|
||||
#define ALT_RSTMGR_PER0MODRST_DMA_SET_MSK BIT(16)
|
||||
#define ALT_RSTMGR_PER0MODRST_SPIM0_SET_MSK BIT(17)
|
||||
#define ALT_RSTMGR_PER0MODRST_SPIM1_SET_MSK BIT(18)
|
||||
#define ALT_RSTMGR_PER0MODRST_SPIS0_SET_MSK BIT(19)
|
||||
#define ALT_RSTMGR_PER0MODRST_SPIS1_SET_MSK BIT(20)
|
||||
#define ALT_RSTMGR_PER0MODRST_DMAECC_SET_MSK BIT(21)
|
||||
#define ALT_RSTMGR_PER0MODRST_EMACPTP_SET_MSK BIT(22)
|
||||
#define ALT_RSTMGR_PER0MODRST_DMAIF0_SET_MSK BIT(24)
|
||||
#define ALT_RSTMGR_PER0MODRST_DMAIF1_SET_MSK BIT(25)
|
||||
#define ALT_RSTMGR_PER0MODRST_DMAIF2_SET_MSK BIT(26)
|
||||
#define ALT_RSTMGR_PER0MODRST_DMAIF3_SET_MSK BIT(27)
|
||||
#define ALT_RSTMGR_PER0MODRST_DMAIF4_SET_MSK BIT(28)
|
||||
#define ALT_RSTMGR_PER0MODRST_DMAIF5_SET_MSK BIT(29)
|
||||
#define ALT_RSTMGR_PER0MODRST_DMAIF6_SET_MSK BIT(30)
|
||||
#define ALT_RSTMGR_PER0MODRST_DMAIF7_SET_MSK BIT(31)
|
||||
|
||||
#define ALT_RSTMGR_PER1MODRST_WD0_SET_MSK BIT(0)
|
||||
#define ALT_RSTMGR_PER1MODRST_WD1_SET_MSK BIT(1)
|
||||
#define ALT_RSTMGR_PER1MODRST_L4SYSTMR0_SET_MSK BIT(2)
|
||||
#define ALT_RSTMGR_PER1MODRST_L4SYSTMR1_SET_MSK BIT(3)
|
||||
#define ALT_RSTMGR_PER1MODRST_SPTMR0_SET_MSK BIT(4)
|
||||
#define ALT_RSTMGR_PER1MODRST_SPTMR1_SET_MSK BIT(5)
|
||||
#define ALT_RSTMGR_PER1MODRST_I2C0_SET_MSK BIT(8)
|
||||
#define ALT_RSTMGR_PER1MODRST_I2C1_SET_MSK BIT(9)
|
||||
#define ALT_RSTMGR_PER1MODRST_I2C2_SET_MSK BIT(10)
|
||||
#define ALT_RSTMGR_PER1MODRST_I2C3_SET_MSK BIT(11)
|
||||
#define ALT_RSTMGR_PER1MODRST_I2C4_SET_MSK BIT(12)
|
||||
#define ALT_RSTMGR_PER1MODRST_UART0_SET_MSK BIT(16)
|
||||
#define ALT_RSTMGR_PER1MODRST_UART1_SET_MSK BIT(17)
|
||||
#define ALT_RSTMGR_PER1MODRST_GPIO0_SET_MSK BIT(24)
|
||||
#define ALT_RSTMGR_PER1MODRST_GPIO1_SET_MSK BIT(25)
|
||||
#define ALT_RSTMGR_PER1MODRST_GPIO2_SET_MSK BIT(26)
|
||||
|
||||
#define ALT_RSTMGR_BRGMODRST_H2F_SET_MSK BIT(0)
|
||||
#define ALT_RSTMGR_BRGMODRST_LWH2F_SET_MSK BIT(1)
|
||||
#define ALT_RSTMGR_BRGMODRST_F2H_SET_MSK BIT(2)
|
||||
#define ALT_RSTMGR_BRGMODRST_F2SSDRAM0_SET_MSK BIT(3)
|
||||
#define ALT_RSTMGR_BRGMODRST_F2SSDRAM1_SET_MSK BIT(4)
|
||||
#define ALT_RSTMGR_BRGMODRST_F2SSDRAM2_SET_MSK BIT(5)
|
||||
#define ALT_RSTMGR_BRGMODRST_DDRSCH_SET_MSK BIT(6)
|
||||
|
||||
#define ALT_RSTMGR_HDSKEN_SDRSELFREFEN_SET_MSK BIT(0)
|
||||
#define ALT_RSTMGR_HDSKEN_FPGAMGRHSEN_SET_MSK BIT(1)
|
||||
#define ALT_RSTMGR_HDSKEN_FPGAHSEN_SET_MSK BIT(2)
|
||||
#define ALT_RSTMGR_HDSKEN_ETRSTALLEN_SET_MSK BIT(3)
|
||||
|
||||
#endif /* _RESET_MANAGER_ARRIA10_H_ */
|
||||
+49
@@ -0,0 +1,49 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0+ */
|
||||
/*
|
||||
* Copyright (C) 2012-2017 Altera Corporation <www.altera.com>
|
||||
*/
|
||||
|
||||
#ifndef _RESET_MANAGER_GEN5_H_
|
||||
#define _RESET_MANAGER_GEN5_H_
|
||||
|
||||
#include <dt-bindings/reset/altr,rst-mgr.h>
|
||||
|
||||
void socfpga_bridges_set_handoff_regs(bool h2f, bool lwh2f, bool f2h);
|
||||
void socfpga_bridges_reset(int enable);
|
||||
|
||||
struct socfpga_reset_manager {
|
||||
u32 status;
|
||||
u32 ctrl;
|
||||
u32 counts;
|
||||
u32 padding1;
|
||||
u32 mpu_mod_reset;
|
||||
u32 per_mod_reset;
|
||||
u32 per2_mod_reset;
|
||||
u32 brg_mod_reset;
|
||||
u32 misc_mod_reset;
|
||||
u32 padding2[12];
|
||||
u32 tstscratch;
|
||||
};
|
||||
|
||||
/*
|
||||
* SocFPGA Cyclone V/Arria V reset IDs, bank mapping is as follows:
|
||||
* 0 ... mpumodrst
|
||||
* 1 ... permodrst
|
||||
* 2 ... per2modrst
|
||||
* 3 ... brgmodrst
|
||||
* 4 ... miscmodrst
|
||||
*/
|
||||
#define RSTMGR_EMAC0 RSTMGR_DEFINE(1, 0)
|
||||
#define RSTMGR_EMAC1 RSTMGR_DEFINE(1, 1)
|
||||
#define RSTMGR_NAND RSTMGR_DEFINE(1, 4)
|
||||
#define RSTMGR_QSPI RSTMGR_DEFINE(1, 5)
|
||||
#define RSTMGR_L4WD0 RSTMGR_DEFINE(1, 6)
|
||||
#define RSTMGR_OSC1TIMER0 RSTMGR_DEFINE(1, 8)
|
||||
#define RSTMGR_UART0 RSTMGR_DEFINE(1, 16)
|
||||
#define RSTMGR_SPIM0 RSTMGR_DEFINE(1, 18)
|
||||
#define RSTMGR_SPIM1 RSTMGR_DEFINE(1, 19)
|
||||
#define RSTMGR_SDMMC RSTMGR_DEFINE(1, 22)
|
||||
#define RSTMGR_DMA RSTMGR_DEFINE(1, 28)
|
||||
#define RSTMGR_SDR RSTMGR_DEFINE(1, 29)
|
||||
|
||||
#endif /* _RESET_MANAGER_GEN5_H_ */
|
||||
+118
@@ -0,0 +1,118 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0
|
||||
*
|
||||
* Copyright (C) 2016-2018 Intel Corporation <www.intel.com>
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _RESET_MANAGER_S10_
|
||||
#define _RESET_MANAGER_S10_
|
||||
|
||||
void reset_cpu(ulong addr);
|
||||
int cpu_has_been_warmreset(void);
|
||||
|
||||
void socfpga_bridges_reset(int enable);
|
||||
|
||||
void socfpga_per_reset(u32 reset, int set);
|
||||
void socfpga_per_reset_all(void);
|
||||
|
||||
struct socfpga_reset_manager {
|
||||
u32 status;
|
||||
u32 mpu_rst_stat;
|
||||
u32 misc_stat;
|
||||
u32 padding1;
|
||||
u32 hdsk_en;
|
||||
u32 hdsk_req;
|
||||
u32 hdsk_ack;
|
||||
u32 hdsk_stall;
|
||||
u32 mpumodrst;
|
||||
u32 per0modrst;
|
||||
u32 per1modrst;
|
||||
u32 brgmodrst;
|
||||
u32 padding2;
|
||||
u32 cold_mod_reset;
|
||||
u32 padding3;
|
||||
u32 dbg_mod_reset;
|
||||
u32 tap_mod_reset;
|
||||
u32 padding4;
|
||||
u32 padding5;
|
||||
u32 brg_warm_mask;
|
||||
u32 padding6[3];
|
||||
u32 tst_stat;
|
||||
u32 padding7;
|
||||
u32 hdsk_timeout;
|
||||
u32 mpul2flushtimeout;
|
||||
u32 dbghdsktimeout;
|
||||
};
|
||||
|
||||
#define RSTMGR_MPUMODRST_CORE0 0
|
||||
#define RSTMGR_PER0MODRST_OCP_MASK 0x0020bf00
|
||||
#define RSTMGR_BRGMODRST_DDRSCH_MASK 0X00000040
|
||||
#define RSTMGR_BRGMODRST_FPGA2SOC_MASK 0x00000004
|
||||
|
||||
/* Watchdogs and MPU warm reset mask */
|
||||
#define RSTMGR_L4WD_MPU_WARMRESET_MASK 0x000F0F00
|
||||
|
||||
/*
|
||||
* Define a reset identifier, from which a permodrst bank ID
|
||||
* and reset ID can be extracted using the subsequent macros
|
||||
* RSTMGR_RESET() and RSTMGR_BANK().
|
||||
*/
|
||||
#define RSTMGR_BANK_OFFSET 8
|
||||
#define RSTMGR_BANK_MASK 0x7
|
||||
#define RSTMGR_RESET_OFFSET 0
|
||||
#define RSTMGR_RESET_MASK 0x1f
|
||||
#define RSTMGR_DEFINE(_bank, _offset) \
|
||||
((_bank) << RSTMGR_BANK_OFFSET) | ((_offset) << RSTMGR_RESET_OFFSET)
|
||||
|
||||
/* Extract reset ID from the reset identifier. */
|
||||
#define RSTMGR_RESET(_reset) \
|
||||
(((_reset) >> RSTMGR_RESET_OFFSET) & RSTMGR_RESET_MASK)
|
||||
|
||||
/* Extract bank ID from the reset identifier. */
|
||||
#define RSTMGR_BANK(_reset) \
|
||||
(((_reset) >> RSTMGR_BANK_OFFSET) & RSTMGR_BANK_MASK)
|
||||
|
||||
/*
|
||||
* SocFPGA Stratix10 reset IDs, bank mapping is as follows:
|
||||
* 0 ... mpumodrst
|
||||
* 1 ... per0modrst
|
||||
* 2 ... per1modrst
|
||||
* 3 ... brgmodrst
|
||||
*/
|
||||
#define RSTMGR_EMAC0 RSTMGR_DEFINE(1, 0)
|
||||
#define RSTMGR_EMAC1 RSTMGR_DEFINE(1, 1)
|
||||
#define RSTMGR_EMAC2 RSTMGR_DEFINE(1, 2)
|
||||
#define RSTMGR_USB0 RSTMGR_DEFINE(1, 3)
|
||||
#define RSTMGR_USB1 RSTMGR_DEFINE(1, 4)
|
||||
#define RSTMGR_NAND RSTMGR_DEFINE(1, 5)
|
||||
#define RSTMGR_SDMMC RSTMGR_DEFINE(1, 7)
|
||||
#define RSTMGR_EMAC0_OCP RSTMGR_DEFINE(1, 8)
|
||||
#define RSTMGR_EMAC1_OCP RSTMGR_DEFINE(1, 9)
|
||||
#define RSTMGR_EMAC2_OCP RSTMGR_DEFINE(1, 10)
|
||||
#define RSTMGR_USB0_OCP RSTMGR_DEFINE(1, 11)
|
||||
#define RSTMGR_USB1_OCP RSTMGR_DEFINE(1, 12)
|
||||
#define RSTMGR_NAND_OCP RSTMGR_DEFINE(1, 13)
|
||||
#define RSTMGR_SDMMC_OCP RSTMGR_DEFINE(1, 15)
|
||||
#define RSTMGR_DMA RSTMGR_DEFINE(1, 16)
|
||||
#define RSTMGR_SPIM0 RSTMGR_DEFINE(1, 17)
|
||||
#define RSTMGR_SPIM1 RSTMGR_DEFINE(1, 18)
|
||||
#define RSTMGR_L4WD0 RSTMGR_DEFINE(2, 0)
|
||||
#define RSTMGR_L4WD1 RSTMGR_DEFINE(2, 1)
|
||||
#define RSTMGR_L4WD2 RSTMGR_DEFINE(2, 2)
|
||||
#define RSTMGR_L4WD3 RSTMGR_DEFINE(2, 3)
|
||||
#define RSTMGR_OSC1TIMER0 RSTMGR_DEFINE(2, 4)
|
||||
#define RSTMGR_I2C0 RSTMGR_DEFINE(2, 8)
|
||||
#define RSTMGR_I2C1 RSTMGR_DEFINE(2, 9)
|
||||
#define RSTMGR_I2C2 RSTMGR_DEFINE(2, 10)
|
||||
#define RSTMGR_I2C3 RSTMGR_DEFINE(2, 11)
|
||||
#define RSTMGR_I2C4 RSTMGR_DEFINE(2, 12)
|
||||
#define RSTMGR_UART0 RSTMGR_DEFINE(2, 16)
|
||||
#define RSTMGR_UART1 RSTMGR_DEFINE(2, 17)
|
||||
#define RSTMGR_GPIO0 RSTMGR_DEFINE(2, 24)
|
||||
#define RSTMGR_GPIO1 RSTMGR_DEFINE(2, 25)
|
||||
#define RSTMGR_SDR RSTMGR_DEFINE(3, 6)
|
||||
|
||||
/* Create a human-readable reference to SoCFPGA reset. */
|
||||
#define SOCFPGA_RESET(_name) RSTMGR_##_name
|
||||
|
||||
#endif /* _RESET_MANAGER_S10_ */
|
||||
@@ -0,0 +1,25 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0+ */
|
||||
/*
|
||||
* Copyright (C) 2013 Altera Corporation <www.altera.com>
|
||||
*/
|
||||
|
||||
#ifndef _SCAN_MANAGER_H_
|
||||
#define _SCAN_MANAGER_H_
|
||||
|
||||
struct socfpga_scan_manager {
|
||||
u32 stat;
|
||||
u32 en;
|
||||
u32 padding[2];
|
||||
u32 fifo_single_byte;
|
||||
u32 fifo_double_byte;
|
||||
u32 fifo_triple_byte;
|
||||
u32 fifo_quad_byte;
|
||||
};
|
||||
|
||||
int scan_mgr_configure_iocsr(void);
|
||||
u32 scan_mgr_get_fpga_id(void);
|
||||
int iocsr_get_config_table(const unsigned int chain_id,
|
||||
const unsigned long **table,
|
||||
unsigned int *table_len);
|
||||
|
||||
#endif /* _SCAN_MANAGER_H_ */
|
||||
@@ -0,0 +1,22 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0+ */
|
||||
/*
|
||||
* Copyright (C) 2014 Marek Vasut <marex@denx.de>
|
||||
*/
|
||||
|
||||
#ifndef __SOCFPGA_SCU_H__
|
||||
#define __SOCFPGA_SCU_H__
|
||||
|
||||
struct scu_registers {
|
||||
u32 ctrl; /* 0x00 */
|
||||
u32 cfg;
|
||||
u32 cpsr;
|
||||
u32 iassr;
|
||||
u32 _pad_0x10_0x3c[12]; /* 0x10 */
|
||||
u32 fsar; /* 0x40 */
|
||||
u32 fear;
|
||||
u32 _pad_0x48_0x4c[2];
|
||||
u32 acr; /* 0x50 */
|
||||
u32 sacr;
|
||||
};
|
||||
|
||||
#endif /* __SOCFPGA_SCU_H__ */
|
||||
@@ -0,0 +1,17 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0+ */
|
||||
/*
|
||||
* Copyright Altera Corporation (C) 2014-2015
|
||||
*/
|
||||
#ifndef _SDRAM_H_
|
||||
#define _SDRAM_H_
|
||||
|
||||
#ifndef __ASSEMBLY__
|
||||
|
||||
#if defined(CONFIG_TARGET_SOCFPGA_GEN5)
|
||||
#include <asm/arch/sdram_gen5.h>
|
||||
#elif defined(CONFIG_TARGET_SOCFPGA_ARRIA10)
|
||||
#include <asm/arch/sdram_arria10.h>
|
||||
#endif
|
||||
|
||||
#endif
|
||||
#endif /* _SDRAM_H_ */
|
||||
@@ -0,0 +1,381 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0 */
|
||||
/*
|
||||
* Copyright (C) 2015-2017 Intel Corporation <www.intel.com>
|
||||
*/
|
||||
|
||||
#ifndef _SOCFPGA_SDRAM_ARRIA10_H_
|
||||
#define _SOCFPGA_SDRAM_ARRIA10_H_
|
||||
|
||||
#ifndef __ASSEMBLY__
|
||||
int ddr_calibration_sequence(void);
|
||||
|
||||
struct socfpga_ecc_hmc {
|
||||
u32 ip_rev_id;
|
||||
u32 _pad_0x4_0x7;
|
||||
u32 ddrioctrl;
|
||||
u32 ddrcalstat;
|
||||
u32 mpr_0beat1;
|
||||
u32 mpr_1beat1;
|
||||
u32 mpr_2beat1;
|
||||
u32 mpr_3beat1;
|
||||
u32 mpr_4beat1;
|
||||
u32 mpr_5beat1;
|
||||
u32 mpr_6beat1;
|
||||
u32 mpr_7beat1;
|
||||
u32 mpr_8beat1;
|
||||
u32 mpr_0beat2;
|
||||
u32 mpr_1beat2;
|
||||
u32 mpr_2beat2;
|
||||
u32 mpr_3beat2;
|
||||
u32 mpr_4beat2;
|
||||
u32 mpr_5beat2;
|
||||
u32 mpr_6beat2;
|
||||
u32 mpr_7beat2;
|
||||
u32 mpr_8beat2;
|
||||
u32 _pad_0x58_0x5f[2];
|
||||
u32 auto_precharge;
|
||||
u32 _pad_0x64_0xff[39];
|
||||
u32 eccctrl;
|
||||
u32 eccctrl2;
|
||||
u32 _pad_0x108_0x10f[2];
|
||||
u32 errinten;
|
||||
u32 errintens;
|
||||
u32 errintenr;
|
||||
u32 intmode;
|
||||
u32 intstat;
|
||||
u32 diaginttest;
|
||||
u32 modstat;
|
||||
u32 derraddra;
|
||||
u32 serraddra;
|
||||
u32 _pad_0x134_0x137;
|
||||
u32 autowb_corraddr;
|
||||
u32 serrcntreg;
|
||||
u32 autowb_drop_cntreg;
|
||||
u32 _pad_0x144_0x147;
|
||||
u32 ecc_reg2wreccdatabus;
|
||||
u32 ecc_rdeccdata2regbus;
|
||||
u32 ecc_reg2rdeccdatabus;
|
||||
u32 _pad_0x154_0x15f[3];
|
||||
u32 ecc_diagon;
|
||||
u32 ecc_decstat;
|
||||
u32 _pad_0x168_0x16f[2];
|
||||
u32 ecc_errgenaddr_0;
|
||||
u32 ecc_errgenaddr_1;
|
||||
u32 ecc_errgenaddr_2;
|
||||
u32 ecc_errgenaddr_3;
|
||||
};
|
||||
|
||||
struct socfpga_noc_ddr_scheduler {
|
||||
u32 ddr_t_main_scheduler_id_coreid;
|
||||
u32 ddr_t_main_scheduler_id_revisionid;
|
||||
u32 ddr_t_main_scheduler_ddrconf;
|
||||
u32 ddr_t_main_scheduler_ddrtiming;
|
||||
u32 ddr_t_main_scheduler_ddrmode;
|
||||
u32 ddr_t_main_scheduler_readlatency;
|
||||
u32 _pad_0x20_0x34[8];
|
||||
u32 ddr_t_main_scheduler_activate;
|
||||
u32 ddr_t_main_scheduler_devtodev;
|
||||
};
|
||||
|
||||
/*
|
||||
* OCRAM firewall
|
||||
*/
|
||||
struct socfpga_noc_fw_ocram {
|
||||
u32 enable;
|
||||
u32 enable_set;
|
||||
u32 enable_clear;
|
||||
u32 region0;
|
||||
u32 region1;
|
||||
u32 region2;
|
||||
u32 region3;
|
||||
u32 region4;
|
||||
u32 region5;
|
||||
};
|
||||
|
||||
/* for master such as MPU and FPGA */
|
||||
struct socfpga_noc_fw_ddr_mpu_fpga2sdram {
|
||||
u32 enable;
|
||||
u32 enable_set;
|
||||
u32 enable_clear;
|
||||
u32 _pad_0xc_0xf;
|
||||
u32 mpuregion0addr;
|
||||
u32 mpuregion1addr;
|
||||
u32 mpuregion2addr;
|
||||
u32 mpuregion3addr;
|
||||
u32 fpga2sdram0region0addr;
|
||||
u32 fpga2sdram0region1addr;
|
||||
u32 fpga2sdram0region2addr;
|
||||
u32 fpga2sdram0region3addr;
|
||||
u32 fpga2sdram1region0addr;
|
||||
u32 fpga2sdram1region1addr;
|
||||
u32 fpga2sdram1region2addr;
|
||||
u32 fpga2sdram1region3addr;
|
||||
u32 fpga2sdram2region0addr;
|
||||
u32 fpga2sdram2region1addr;
|
||||
u32 fpga2sdram2region2addr;
|
||||
u32 fpga2sdram2region3addr;
|
||||
};
|
||||
|
||||
/* for L3 master */
|
||||
struct socfpga_noc_fw_ddr_l3 {
|
||||
u32 enable;
|
||||
u32 enable_set;
|
||||
u32 enable_clear;
|
||||
u32 hpsregion0addr;
|
||||
u32 hpsregion1addr;
|
||||
u32 hpsregion2addr;
|
||||
u32 hpsregion3addr;
|
||||
u32 hpsregion4addr;
|
||||
u32 hpsregion5addr;
|
||||
u32 hpsregion6addr;
|
||||
u32 hpsregion7addr;
|
||||
};
|
||||
|
||||
struct socfpga_io48_mmr {
|
||||
u32 dbgcfg0;
|
||||
u32 dbgcfg1;
|
||||
u32 dbgcfg2;
|
||||
u32 dbgcfg3;
|
||||
u32 dbgcfg4;
|
||||
u32 dbgcfg5;
|
||||
u32 dbgcfg6;
|
||||
u32 reserve0;
|
||||
u32 reserve1;
|
||||
u32 reserve2;
|
||||
u32 ctrlcfg0;
|
||||
u32 ctrlcfg1;
|
||||
u32 ctrlcfg2;
|
||||
u32 ctrlcfg3;
|
||||
u32 ctrlcfg4;
|
||||
u32 ctrlcfg5;
|
||||
u32 ctrlcfg6;
|
||||
u32 ctrlcfg7;
|
||||
u32 ctrlcfg8;
|
||||
u32 ctrlcfg9;
|
||||
u32 dramtiming0;
|
||||
u32 dramodt0;
|
||||
u32 dramodt1;
|
||||
u32 sbcfg0;
|
||||
u32 sbcfg1;
|
||||
u32 sbcfg2;
|
||||
u32 sbcfg3;
|
||||
u32 sbcfg4;
|
||||
u32 sbcfg5;
|
||||
u32 sbcfg6;
|
||||
u32 sbcfg7;
|
||||
u32 caltiming0;
|
||||
u32 caltiming1;
|
||||
u32 caltiming2;
|
||||
u32 caltiming3;
|
||||
u32 caltiming4;
|
||||
u32 caltiming5;
|
||||
u32 caltiming6;
|
||||
u32 caltiming7;
|
||||
u32 caltiming8;
|
||||
u32 caltiming9;
|
||||
u32 caltiming10;
|
||||
u32 dramaddrw;
|
||||
u32 sideband0;
|
||||
u32 sideband1;
|
||||
u32 sideband2;
|
||||
u32 sideband3;
|
||||
u32 sideband4;
|
||||
u32 sideband5;
|
||||
u32 sideband6;
|
||||
u32 sideband7;
|
||||
u32 sideband8;
|
||||
u32 sideband9;
|
||||
u32 sideband10;
|
||||
u32 sideband11;
|
||||
u32 sideband12;
|
||||
u32 sideband13;
|
||||
u32 sideband14;
|
||||
u32 sideband15;
|
||||
u32 dramsts;
|
||||
u32 dbgdone;
|
||||
u32 dbgsignals;
|
||||
u32 dbgreset;
|
||||
u32 dbgmatch;
|
||||
u32 counter0mask;
|
||||
u32 counter1mask;
|
||||
u32 counter0match;
|
||||
u32 counter1match;
|
||||
u32 niosreserve0;
|
||||
u32 niosreserve1;
|
||||
u32 niosreserve2;
|
||||
};
|
||||
|
||||
#endif /*__ASSEMBLY__*/
|
||||
|
||||
#define IO48_MMR_CTRLCFG0_DB2_BURST_LENGTH_MASK 0x1F000000
|
||||
#define IO48_MMR_CTRLCFG0_DB2_BURST_LENGTH_SHIFT 24
|
||||
#define IO48_MMR_CTRLCFG0_DB1_BURST_LENGTH_MASK 0x00F80000
|
||||
#define IO48_MMR_CTRLCFG0_DB1_BURST_LENGTH_SHIFT 19
|
||||
#define IO48_MMR_CTRLCFG0_DB0_BURST_LENGTH_MASK 0x0007C000
|
||||
#define IO48_MMR_CTRLCFG0_DB0_BURST_LENGTH_SHIFT 14
|
||||
#define IO48_MMR_CTRLCFG0_CTRL_BURST_LENGTH_MASK 0x00003E00
|
||||
#define IO48_MMR_CTRLCFG0_CTRL_BURST_LENGTH_SHIFT 9
|
||||
#define IO48_MMR_CTRLCFG0_AC_POS_MASK 0x00000180
|
||||
#define IO48_MMR_CTRLCFG0_AC_POS_SHIFT 7
|
||||
#define IO48_MMR_CTRLCFG0_DIMM_TYPE_MASK 0x00000070
|
||||
#define IO48_MMR_CTRLCFG0_DIM_TYPE_SHIFT 4
|
||||
#define IO48_MMR_CTRLCFG0_MEM_TYPE_MASK 0x0000000F
|
||||
#define IO48_MMR_CTRLCFG0_MEM_TYPE_SHIFT 0
|
||||
|
||||
#define IO48_MMR_CTRLCFG1_DBC3_ENABLE_DM BIT(30)
|
||||
#define IO48_MMR_CTRLCFG1_DBC2_ENABLE_DM BIT(29)
|
||||
#define IO48_MMR_CTRLCFG1_DBC1_ENABLE_DM BIT(28)
|
||||
#define IO48_MMR_CTRLCFG1_DBC0_ENABLE_DM BIT(27)
|
||||
#define IO48_MMR_CTRLCFG1_CTRL_ENABLE_DM BIT(26)
|
||||
#define IO48_MMR_CTRLCFG1_DQSTRK_EN BIT(25)
|
||||
#define IO48_MMR_CTRLCFG1_STARVE_LIMIT_MASK 0x01F80000
|
||||
#define IO48_MMR_CTRLCFG1_STARVE_LIMIT_SHIFT 19
|
||||
#define IO48_MMR_CTRLCFG1_REORDER_READ BIT(18)
|
||||
#define IO48_MMR_CTRLCFG1_DBC3_REORDER_RDATA BIT(17)
|
||||
#define IO48_MMR_CTRLCFG1_DBC2_REORDER_RDATA BIT(16)
|
||||
#define IO48_MMR_CTRLCFG1_DBC1_REORDER_RDATA BIT(15)
|
||||
#define IO48_MMR_CTRLCFG1_DBC0_REORDER_RDATA BIT(14)
|
||||
#define IO48_MMR_CTRLCFG1_CTRL_REORDER_RDATA BIT(13)
|
||||
#define IO48_MMR_CTRLCFG1_REORDER_DATA BIT(12)
|
||||
#define IO48_MMR_CTRLCFG1_DBC3_ENABLE_ECC BIT(11)
|
||||
#define IO48_MMR_CTRLCFG1_DBC2_ENABLE_ECC BIT(10)
|
||||
#define IO48_MMR_CTRLCFG1_DBC1_ENABLE_ECC BIT(9)
|
||||
#define IO48_MMR_CTRLCFG1_DBC0_ENABLE_ECC BIT(8)
|
||||
#define IO48_MMR_CTRLCFG1_CTRL_ENABLE_ECC BIT(7)
|
||||
#define IO48_MMR_CTRLCFG1_ADDR_ORDER_MASK 0x00000060
|
||||
#define IO48_MMR_CTRLCFG1_ADDR_ORDER_SHIFT 5
|
||||
#define IO48_MMR_CTRLCFG1_DBC3_BURST_LENGTH_MASK 0x0000001F
|
||||
#define IO48_MMR_CTRLCFG1_DBC3_BURST_LENGTH_SHIFT 0
|
||||
|
||||
#define IO48_MMR_CALTIMING0_CFG_ACT_TO_ACT_DIFF_BG_MASK 0x3F000000
|
||||
#define IO48_MMR_CALTIMING0_CFG_ACT_TO_ACT_DIFF_BG_SHIFT 24
|
||||
#define IO48_MMR_CALTIMING0_CFG_ACT_TO_ACT_DIFF_BANK_MASK 0x00FC0000
|
||||
#define IO48_MMR_CALTIMING0_CFG_ACT_TO_ACT_DIFF_BANK_SHIFT 18
|
||||
#define IO48_MMR_CALTIMING0_CFG_ACT_TO_ACT_MASK 0x0003F000
|
||||
#define IO48_MMR_CALTIMING0_CFG_ACT_TO_ACT_SHIFT 12
|
||||
#define IO48_MMR_CALTIMING0_CFG_ACT_TO_PCH_MASK 0x00000FC0
|
||||
#define IO48_MMR_CALTIMING0_CFG_ACT_TO_PCH_SHIFT 6
|
||||
#define IO48_MMR_CALTIMING0_CFG_ACT_TO_RDWR_MASK 0x0000003F
|
||||
#define IO48_MMR_CALTIMING0_CFG_ACT_TO_RDWR_SHIFT 0
|
||||
|
||||
#define IO48_MMR_CALTIMING1_CFG_RD_TO_WR_DIFF_CHIP_MASK 0x3F000000
|
||||
#define IO48_MMR_CALTIMING1_CFG_RD_TO_WR_DIFF_CHIP_SHIFT 24
|
||||
#define IO48_MMR_CALTIMING1_CFG_RD_TO_WR_MASK 0x00FC0000
|
||||
#define IO48_MMR_CALTIMING1_CFG_RD_TO_WR_SHIFT 18
|
||||
#define IO48_MMR_CALTIMING1_CFG_RD_TO_RD_DB_MASK 0x0003F000
|
||||
#define IO48_MMR_CALTIMING1_CFG_RD_TO_RD_DB_SHIFT 12
|
||||
#define IO48_MMR_CALTIMING1_CFG_RD_TO_RD_DC_MASK 0x00000FC0
|
||||
#define IO48_MMR_CALTIMING1_CFG_RD_TO_RD_DC_SHIFT 6
|
||||
#define IO48_MMR_CALTIMING1_CFG_RD_TO_RD_MASK 0x0000003F
|
||||
#define IO48_MMR_CALTIMING1_CFG_RD_TO_RD_SHIFT 0
|
||||
|
||||
#define IO48_MMR_CALTIMING2_CFG_WR_TO_WR_DIFF_CHIP_MASK 0x3F000000
|
||||
#define IO48_MMR_CALTIMING2_CFG_WR_TO_WR_DIFF_CHIP_SHIFT 24
|
||||
#define IO48_MMR_CALTIMING2_CFG_WR_TO_WR_MASK 0x00FC0000
|
||||
#define IO48_MMR_CALTIMING2_CFG_WR_TO_WR_SHIFT 18
|
||||
#define IO48_MMR_CALTIMING2_CFG_RD_TO_AP_VALID_MASK 0x0003F000
|
||||
#define IO48_MMR_CALTIMING2_CFG_RD_TO_AP_VALID_SHIFT 12
|
||||
#define IO48_MMR_CALTIMING2_CFG_RD_TO_PCH_MASK 0x00000FC0
|
||||
#define IO48_MMR_CALTIMING2_CFG_RD_TO_PCH_SHIFT 6
|
||||
#define IO48_MMR_CALTIMING2_CFG_RD_TO_WR_DIFF_BG_MASK 0x0000003F
|
||||
#define IO48_MMR_CALTIMING2_CFG_RD_TO_WR_DIFF_BG_SHIFT 0
|
||||
|
||||
#define IO48_MMR_CALTIMING3_CFG_WR_TO_PCH_MASK 0x3F000000
|
||||
#define IO48_MMR_CALTIMING3_CFG_WR_TO_PCH_SHIFT 24
|
||||
#define IO48_MMR_CALTIMING3_CFG_WR_TO_RD_DIFF_BG_MASK 0x00FC0000
|
||||
#define IO48_MMR_CALTIMING3_CFG_WR_TO_RD_DIFF_BG_SHIFT 18
|
||||
#define IO48_MMR_CALTIMING3_CFG_WR_TO_RD_DIFF_CHIP_MASK 0x0003F000
|
||||
#define IO48_MMR_CALTIMING3_CFG_WR_TO_RD_DIFF_CHIP_SHIFT 12
|
||||
#define IO48_MMR_CALTIMING3_CFG_WR_TO_RD_MASK 0x00000FC0
|
||||
#define IO48_MMR_CALTIMING3_CFG_WR_TO_RD_SHIFT 6
|
||||
#define IO48_MMR_CALTIMING3_CFG_WR_TO_WR_DIFF_BG_MASK 0x0000003F
|
||||
#define IO48_MMR_CALTIMING3_CFG_WR_TO_WR_DIFF_BG_SHIFT 0
|
||||
|
||||
#define IO48_MMR_CALTIMING4_CFG_PDN_TO_VALID_MASK 0xFC000000
|
||||
#define IO48_MMR_CALTIMING4_CFG_PDN_TO_VALID_SHIFT 26
|
||||
#define IO48_MMR_CALTIMING4_CFG_ARF_TO_VALID_MASK 0x03FC0000
|
||||
#define IO48_MMR_CALTIMING4_CFG_ARF_TO_VALID_SHIFT 18
|
||||
#define IO48_MMR_CALTIMING4_CFG_PCH_ALL_TO_VALID_MASK 0x0003F000
|
||||
#define IO48_MMR_CALTIMING4_CFG_PCH_ALL_TO_VALID_SHIFT 12
|
||||
#define IO48_MMR_CALTIMING4_CFG_PCH_TO_VALID_MASK 0x00000FC0
|
||||
#define IO48_MMR_CALTIMING4_CFG_PCH_TO_VALID_SHIFT 6
|
||||
#define IO48_MMR_CALTIMING4_CFG_WR_AP_TO_VALID_MASK 0x0000003F
|
||||
#define IO48_MMR_CALTIMING4_CFG_WR_AP_TO_VALID_SHIFT 0
|
||||
|
||||
#define IO48_MMR_CALTIMING9_CFG_WR_4_ACT_TO_ACT_MASK 0x000000FF
|
||||
#define IO48_MMR_CALTIMING9_CFG_WR_4_ACT_TO_ACT_SHIFT 0
|
||||
|
||||
#define IO48_MMR_DRAMADDRW_CFG_CS_ADDR_WIDTH_MASK 0x00070000
|
||||
#define IO48_MMR_DRAMADDRW_CFG_CS_ADDR_WIDTH_SHIFT 16
|
||||
#define IO48_MMR_DRAMADDRW_CFG_BANK_GROUP_ADDR_WIDTH_MASK 0x0000C000
|
||||
#define IO48_MMR_DRAMADDRW_CFG_BANK_GROUP_ADDR_WIDTH_SHIFT 14
|
||||
#define IO48_MMR_DRAMADDRW_CFG_BANK_ADDR_WIDTH_MASK 0x00003C00
|
||||
#define IO48_MMR_DRAMADDRW_CFG_BANK_ADDR_WIDTH_SHIFT 10
|
||||
#define IO48_MMR_DRAMADDRW_CFG_ROW_ADDR_WIDTH_MASK 0x000003E0
|
||||
#define IO48_MMR_DRAMADDRW_CFG_ROW_ADDR_WIDTH_SHIFT 5
|
||||
#define IO48_MMR_DRAMADDRW_CFG_COL_ADDR_WIDTH_MASK 0x0000001F
|
||||
#define IO48_MMR_DRAMADDRW_CFG_COL_ADDR_WIDTH_SHIFT 0
|
||||
|
||||
#define ALT_ECC_HMC_OCP_DDRIOCTRL_IO_SIZE_MSK 0x00000003
|
||||
|
||||
#define ALT_ECC_HMC_OCP_INTSTAT_SERRPENA_SET_MSK BIT(0)
|
||||
#define ALT_ECC_HMC_OCP_INTSTAT_DERRPENA_SET_MSK BIT(1)
|
||||
#define ALT_ECC_HMC_OCP_ERRINTEN_SERRINTEN_SET_MSK BIT(0)
|
||||
#define ALT_ECC_HMC_OCP_ERRINTEN_DERRINTEN_SET_MSK BIT(1)
|
||||
#define ALT_ECC_HMC_OCP_INTMOD_INTONCMP_SET_MSK BIT(16)
|
||||
#define ALT_ECC_HMC_OCP_ECCCTL_AWB_CNT_RST_SET_MSK BIT(16)
|
||||
#define ALT_ECC_HMC_OCP_ECCCTL_CNT_RST_SET_MSK BIT(8)
|
||||
#define ALT_ECC_HMC_OCP_ECCCTL_ECC_EN_SET_MSK BIT(0)
|
||||
#define ALT_ECC_HMC_OCP_ECCCTL2_RMW_EN_SET_MSK BIT(8)
|
||||
#define ALT_ECC_HMC_OCP_ECCCTL2_AWB_EN_SET_MSK BIT(0)
|
||||
|
||||
#define ALT_ECC_HMC_OCP_SERRCNTREG_VALUE 8
|
||||
|
||||
#define ALT_NOC_MPU_DDR_T_SCHED_DDRTIMING_ACTTOACT_LSB 0
|
||||
#define ALT_NOC_MPU_DDR_T_SCHED_DDRTIMING_RDTOMISS_LSB 6
|
||||
#define ALT_NOC_MPU_DDR_T_SCHED_DDRTIMING_WRTOMISS_LSB 12
|
||||
#define ALT_NOC_MPU_DDR_T_SCHED_DDRTIMING_BURSTLEN_LSB 18
|
||||
#define ALT_NOC_MPU_DDR_T_SCHED_DDRTIMING_RDTOWR_LSB 21
|
||||
#define ALT_NOC_MPU_DDR_T_SCHED_DDRTIMING_WRTORD_LSB 26
|
||||
#define ALT_NOC_MPU_DDR_T_SCHED_DDRTIMING_BWRATIO_LSB 31
|
||||
|
||||
#define ALT_NOC_MPU_DDR_T_SCHED_DDRMOD_AUTOPRECHARGE_LSB 0
|
||||
#define ALT_NOC_MPU_DDR_T_SCHED_DDRMOD_BWRATIOEXTENDED_LSB 1
|
||||
|
||||
#define ALT_NOC_MPU_DDR_T_SCHED_ACTIVATE_RRD_LSB 0
|
||||
#define ALT_NOC_MPU_DDR_T_SCHED_ACTIVATE_FAW_LSB 4
|
||||
#define ALT_NOC_MPU_DDR_T_SCHED_ACTIVATE_FAWBANK_LSB 10
|
||||
|
||||
#define ALT_NOC_MPU_DDR_T_SCHED_DEVTODEV_BUSRDTORD_LSB 0
|
||||
#define ALT_NOC_MPU_DDR_T_SCHED_DEVTODEV_BUSRDTOWR_LSB 2
|
||||
#define ALT_NOC_MPU_DDR_T_SCHED_DEVTODEV_BUSWRTORD_LSB 4
|
||||
|
||||
#define ALT_NOC_FW_DDR_END_ADDR_LSB 16
|
||||
#define ALT_NOC_FW_DDR_ADDR_MASK 0xFFFF
|
||||
#define ALT_NOC_FW_DDR_SCR_EN_HPSREG0EN_SET_MSK BIT(0)
|
||||
#define ALT_NOC_FW_DDR_SCR_EN_HPSREG1EN_SET_MSK BIT(1)
|
||||
#define ALT_NOC_FW_DDR_SCR_EN_HPSREG2EN_SET_MSK BIT(2)
|
||||
#define ALT_NOC_FW_DDR_SCR_EN_HPSREG3EN_SET_MSK BIT(3)
|
||||
#define ALT_NOC_FW_DDR_SCR_EN_HPSREG4EN_SET_MSK BIT(4)
|
||||
#define ALT_NOC_FW_DDR_SCR_EN_HPSREG5EN_SET_MSK BIT(5)
|
||||
#define ALT_NOC_FW_DDR_SCR_EN_HPSREG6EN_SET_MSK BIT(6)
|
||||
#define ALT_NOC_FW_DDR_SCR_EN_HPSREG7EN_SET_MSK BIT(7)
|
||||
#define ALT_NOC_FW_DDR_SCR_EN_MPUREG0EN_SET_MSK BIT(0)
|
||||
#define ALT_NOC_FW_DDR_SCR_EN_MPUREG1EN_SET_MSK BIT(1)
|
||||
#define ALT_NOC_FW_DDR_SCR_EN_MPUREG2EN_SET_MSK BIT(2)
|
||||
#define ALT_NOC_FW_DDR_SCR_EN_MPUREG3EN_SET_MSK BIT(3)
|
||||
#define ALT_NOC_FW_DDR_SCR_EN_F2SDR0REG0EN_SET_MSK BIT(4)
|
||||
#define ALT_NOC_FW_DDR_SCR_EN_F2SDR0REG1EN_SET_MSK BIT(5)
|
||||
#define ALT_NOC_FW_DDR_SCR_EN_F2SDR0REG2EN_SET_MSK BIT(6)
|
||||
#define ALT_NOC_FW_DDR_SCR_EN_F2SDR0REG3EN_SET_MSK BIT(7)
|
||||
#define ALT_NOC_FW_DDR_SCR_EN_F2SDR1REG0EN_SET_MSK BIT(8)
|
||||
#define ALT_NOC_FW_DDR_SCR_EN_F2SDR1REG1EN_SET_MSK BIT(9)
|
||||
#define ALT_NOC_FW_DDR_SCR_EN_F2SDR1REG2EN_SET_MSK BIT(10)
|
||||
#define ALT_NOC_FW_DDR_SCR_EN_F2SDR1REG3EN_SET_MSK BIT(11)
|
||||
#define ALT_NOC_FW_DDR_SCR_EN_F2SDR2REG0EN_SET_MSK BIT(12)
|
||||
#define ALT_NOC_FW_DDR_SCR_EN_F2SDR2REG1EN_SET_MSK BIT(13)
|
||||
#define ALT_NOC_FW_DDR_SCR_EN_F2SDR2REG2EN_SET_MSK BIT(14)
|
||||
#define ALT_NOC_FW_DDR_SCR_EN_F2SDR2REG3EN_SET_MSK BIT(15)
|
||||
|
||||
#define ALT_IO48_DRAMTIME_MEM_READ_LATENCY_MASK 0x0000003F
|
||||
#endif /* _SOCFPGA_SDRAM_ARRIA10_H_ */
|
||||
@@ -0,0 +1,437 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0+ */
|
||||
/*
|
||||
* Copyright Altera Corporation (C) 2014-2015
|
||||
*/
|
||||
#ifndef _SOCFPGA_SDRAM_GEN5_H_
|
||||
#define _SOCFPGA_SDRAM_GEN5_H_
|
||||
|
||||
#ifndef __ASSEMBLY__
|
||||
|
||||
const struct socfpga_sdram_config *socfpga_get_sdram_config(void);
|
||||
|
||||
void socfpga_get_seq_ac_init(const u32 **init, unsigned int *nelem);
|
||||
void socfpga_get_seq_inst_init(const u32 **init, unsigned int *nelem);
|
||||
const struct socfpga_sdram_rw_mgr_config *socfpga_get_sdram_rwmgr_config(void);
|
||||
const struct socfpga_sdram_io_config *socfpga_get_sdram_io_config(void);
|
||||
const struct socfpga_sdram_misc_config *socfpga_get_sdram_misc_config(void);
|
||||
|
||||
#define SDR_CTRLGRP_ADDRESS (SOCFPGA_SDR_ADDRESS | 0x5000)
|
||||
|
||||
struct socfpga_sdr_ctrl {
|
||||
u32 ctrl_cfg;
|
||||
u32 dram_timing1;
|
||||
u32 dram_timing2;
|
||||
u32 dram_timing3;
|
||||
u32 dram_timing4; /* 0x10 */
|
||||
u32 lowpwr_timing;
|
||||
u32 dram_odt;
|
||||
u32 extratime1;
|
||||
u32 __padding0[3];
|
||||
u32 dram_addrw; /* 0x2c */
|
||||
u32 dram_if_width; /* 0x30 */
|
||||
u32 dram_dev_width;
|
||||
u32 dram_sts;
|
||||
u32 dram_intr;
|
||||
u32 sbe_count; /* 0x40 */
|
||||
u32 dbe_count;
|
||||
u32 err_addr;
|
||||
u32 drop_count;
|
||||
u32 drop_addr; /* 0x50 */
|
||||
u32 lowpwr_eq;
|
||||
u32 lowpwr_ack;
|
||||
u32 static_cfg;
|
||||
u32 ctrl_width; /* 0x60 */
|
||||
u32 cport_width;
|
||||
u32 cport_wmap;
|
||||
u32 cport_rmap;
|
||||
u32 rfifo_cmap; /* 0x70 */
|
||||
u32 wfifo_cmap;
|
||||
u32 cport_rdwr;
|
||||
u32 port_cfg;
|
||||
u32 fpgaport_rst; /* 0x80 */
|
||||
u32 __padding1;
|
||||
u32 fifo_cfg;
|
||||
u32 protport_default;
|
||||
u32 prot_rule_addr; /* 0x90 */
|
||||
u32 prot_rule_id;
|
||||
u32 prot_rule_data;
|
||||
u32 prot_rule_rdwr;
|
||||
u32 __padding2[3];
|
||||
u32 mp_priority; /* 0xac */
|
||||
u32 mp_weight0; /* 0xb0 */
|
||||
u32 mp_weight1;
|
||||
u32 mp_weight2;
|
||||
u32 mp_weight3;
|
||||
u32 mp_pacing0; /* 0xc0 */
|
||||
u32 mp_pacing1;
|
||||
u32 mp_pacing2;
|
||||
u32 mp_pacing3;
|
||||
u32 mp_threshold0; /* 0xd0 */
|
||||
u32 mp_threshold1;
|
||||
u32 mp_threshold2;
|
||||
u32 __padding3[29];
|
||||
u32 phy_ctrl0; /* 0x150 */
|
||||
u32 phy_ctrl1;
|
||||
u32 phy_ctrl2;
|
||||
};
|
||||
|
||||
/* SDRAM configuration structure for the SPL. */
|
||||
struct socfpga_sdram_config {
|
||||
u32 ctrl_cfg;
|
||||
u32 dram_timing1;
|
||||
u32 dram_timing2;
|
||||
u32 dram_timing3;
|
||||
u32 dram_timing4;
|
||||
u32 lowpwr_timing;
|
||||
u32 dram_odt;
|
||||
u32 extratime1;
|
||||
u32 dram_addrw;
|
||||
u32 dram_if_width;
|
||||
u32 dram_dev_width;
|
||||
u32 dram_intr;
|
||||
u32 lowpwr_eq;
|
||||
u32 static_cfg;
|
||||
u32 ctrl_width;
|
||||
u32 cport_width;
|
||||
u32 cport_wmap;
|
||||
u32 cport_rmap;
|
||||
u32 rfifo_cmap;
|
||||
u32 wfifo_cmap;
|
||||
u32 cport_rdwr;
|
||||
u32 port_cfg;
|
||||
u32 fpgaport_rst;
|
||||
u32 fifo_cfg;
|
||||
u32 mp_priority;
|
||||
u32 mp_weight0;
|
||||
u32 mp_weight1;
|
||||
u32 mp_weight2;
|
||||
u32 mp_weight3;
|
||||
u32 mp_pacing0;
|
||||
u32 mp_pacing1;
|
||||
u32 mp_pacing2;
|
||||
u32 mp_pacing3;
|
||||
u32 mp_threshold0;
|
||||
u32 mp_threshold1;
|
||||
u32 mp_threshold2;
|
||||
u32 phy_ctrl0;
|
||||
};
|
||||
|
||||
struct socfpga_sdram_rw_mgr_config {
|
||||
u8 activate_0_and_1;
|
||||
u8 activate_0_and_1_wait1;
|
||||
u8 activate_0_and_1_wait2;
|
||||
u8 activate_1;
|
||||
u8 clear_dqs_enable;
|
||||
u8 guaranteed_read;
|
||||
u8 guaranteed_read_cont;
|
||||
u8 guaranteed_write;
|
||||
u8 guaranteed_write_wait0;
|
||||
u8 guaranteed_write_wait1;
|
||||
u8 guaranteed_write_wait2;
|
||||
u8 guaranteed_write_wait3;
|
||||
u8 idle;
|
||||
u8 idle_loop1;
|
||||
u8 idle_loop2;
|
||||
u8 init_reset_0_cke_0;
|
||||
u8 init_reset_1_cke_0;
|
||||
u8 lfsr_wr_rd_bank_0;
|
||||
u8 lfsr_wr_rd_bank_0_data;
|
||||
u8 lfsr_wr_rd_bank_0_dqs;
|
||||
u8 lfsr_wr_rd_bank_0_nop;
|
||||
u8 lfsr_wr_rd_bank_0_wait;
|
||||
u8 lfsr_wr_rd_bank_0_wl_1;
|
||||
u8 lfsr_wr_rd_dm_bank_0;
|
||||
u8 lfsr_wr_rd_dm_bank_0_data;
|
||||
u8 lfsr_wr_rd_dm_bank_0_dqs;
|
||||
u8 lfsr_wr_rd_dm_bank_0_nop;
|
||||
u8 lfsr_wr_rd_dm_bank_0_wait;
|
||||
u8 lfsr_wr_rd_dm_bank_0_wl_1;
|
||||
u8 mrs0_dll_reset;
|
||||
u8 mrs0_dll_reset_mirr;
|
||||
u8 mrs0_user;
|
||||
u8 mrs0_user_mirr;
|
||||
u8 mrs1;
|
||||
u8 mrs1_mirr;
|
||||
u8 mrs2;
|
||||
u8 mrs2_mirr;
|
||||
u8 mrs3;
|
||||
u8 mrs3_mirr;
|
||||
u8 precharge_all;
|
||||
u8 read_b2b;
|
||||
u8 read_b2b_wait1;
|
||||
u8 read_b2b_wait2;
|
||||
u8 refresh_all;
|
||||
u8 rreturn;
|
||||
u8 sgle_read;
|
||||
u8 zqcl;
|
||||
|
||||
u8 true_mem_data_mask_width;
|
||||
u8 mem_address_mirroring;
|
||||
u8 mem_data_mask_width;
|
||||
u8 mem_data_width;
|
||||
u8 mem_dq_per_read_dqs;
|
||||
u8 mem_dq_per_write_dqs;
|
||||
u8 mem_if_read_dqs_width;
|
||||
u8 mem_if_write_dqs_width;
|
||||
u8 mem_number_of_cs_per_dimm;
|
||||
u8 mem_number_of_ranks;
|
||||
u8 mem_virtual_groups_per_read_dqs;
|
||||
u8 mem_virtual_groups_per_write_dqs;
|
||||
};
|
||||
|
||||
struct socfpga_sdram_io_config {
|
||||
u16 delay_per_opa_tap;
|
||||
u8 delay_per_dchain_tap;
|
||||
u8 delay_per_dqs_en_dchain_tap;
|
||||
u8 dll_chain_length;
|
||||
u8 dqdqs_out_phase_max;
|
||||
u8 dqs_en_delay_max;
|
||||
u8 dqs_en_delay_offset;
|
||||
u8 dqs_en_phase_max;
|
||||
u8 dqs_in_delay_max;
|
||||
u8 dqs_in_reserve;
|
||||
u8 dqs_out_reserve;
|
||||
u8 io_in_delay_max;
|
||||
u8 io_out1_delay_max;
|
||||
u8 io_out2_delay_max;
|
||||
u8 shift_dqs_en_when_shift_dqs;
|
||||
};
|
||||
|
||||
struct socfpga_sdram_misc_config {
|
||||
u32 reg_file_init_seq_signature;
|
||||
u8 afi_rate_ratio;
|
||||
u8 calib_lfifo_offset;
|
||||
u8 calib_vfifo_offset;
|
||||
u8 enable_super_quick_calibration;
|
||||
u8 max_latency_count_width;
|
||||
u8 read_valid_fifo_size;
|
||||
u8 tinit_cntr0_val;
|
||||
u8 tinit_cntr1_val;
|
||||
u8 tinit_cntr2_val;
|
||||
u8 treset_cntr0_val;
|
||||
u8 treset_cntr1_val;
|
||||
u8 treset_cntr2_val;
|
||||
};
|
||||
|
||||
#define SDR_CTRLGRP_CTRLCFG_NODMPINS_LSB 23
|
||||
#define SDR_CTRLGRP_CTRLCFG_NODMPINS_MASK 0x00800000
|
||||
#define SDR_CTRLGRP_CTRLCFG_DQSTRKEN_LSB 22
|
||||
#define SDR_CTRLGRP_CTRLCFG_DQSTRKEN_MASK 0x00400000
|
||||
#define SDR_CTRLGRP_CTRLCFG_STARVELIMIT_LSB 16
|
||||
#define SDR_CTRLGRP_CTRLCFG_STARVELIMIT_MASK 0x003f0000
|
||||
#define SDR_CTRLGRP_CTRLCFG_REORDEREN_LSB 15
|
||||
#define SDR_CTRLGRP_CTRLCFG_REORDEREN_MASK 0x00008000
|
||||
#define SDR_CTRLGRP_CTRLCFG_ECCCORREN_LSB 11
|
||||
#define SDR_CTRLGRP_CTRLCFG_ECCCORREN_MASK 0x00000800
|
||||
#define SDR_CTRLGRP_CTRLCFG_ECCEN_LSB 10
|
||||
#define SDR_CTRLGRP_CTRLCFG_ECCEN_MASK 0x00000400
|
||||
#define SDR_CTRLGRP_CTRLCFG_ADDRORDER_LSB 8
|
||||
#define SDR_CTRLGRP_CTRLCFG_ADDRORDER_MASK 0x00000300
|
||||
#define SDR_CTRLGRP_CTRLCFG_MEMBL_LSB 3
|
||||
#define SDR_CTRLGRP_CTRLCFG_MEMBL_MASK 0x000000f8
|
||||
#define SDR_CTRLGRP_CTRLCFG_MEMTYPE_LSB 0
|
||||
#define SDR_CTRLGRP_CTRLCFG_MEMTYPE_MASK 0x00000007
|
||||
/* Register template: sdr::ctrlgrp::dramtiming1 */
|
||||
#define SDR_CTRLGRP_DRAMTIMING1_TRFC_LSB 24
|
||||
#define SDR_CTRLGRP_DRAMTIMING1_TRFC_MASK 0xff000000
|
||||
#define SDR_CTRLGRP_DRAMTIMING1_TFAW_LSB 18
|
||||
#define SDR_CTRLGRP_DRAMTIMING1_TFAW_MASK 0x00fc0000
|
||||
#define SDR_CTRLGRP_DRAMTIMING1_TRRD_LSB 14
|
||||
#define SDR_CTRLGRP_DRAMTIMING1_TRRD_MASK 0x0003c000
|
||||
#define SDR_CTRLGRP_DRAMTIMING1_TCL_LSB 9
|
||||
#define SDR_CTRLGRP_DRAMTIMING1_TCL_MASK 0x00003e00
|
||||
#define SDR_CTRLGRP_DRAMTIMING1_TAL_LSB 4
|
||||
#define SDR_CTRLGRP_DRAMTIMING1_TAL_MASK 0x000001f0
|
||||
#define SDR_CTRLGRP_DRAMTIMING1_TCWL_LSB 0
|
||||
#define SDR_CTRLGRP_DRAMTIMING1_TCWL_MASK 0x0000000f
|
||||
/* Register template: sdr::ctrlgrp::dramtiming2 */
|
||||
#define SDR_CTRLGRP_DRAMTIMING2_TWTR_LSB 25
|
||||
#define SDR_CTRLGRP_DRAMTIMING2_TWTR_MASK 0x1e000000
|
||||
#define SDR_CTRLGRP_DRAMTIMING2_TWR_LSB 21
|
||||
#define SDR_CTRLGRP_DRAMTIMING2_TWR_MASK 0x01e00000
|
||||
#define SDR_CTRLGRP_DRAMTIMING2_TRP_LSB 17
|
||||
#define SDR_CTRLGRP_DRAMTIMING2_TRP_MASK 0x001e0000
|
||||
#define SDR_CTRLGRP_DRAMTIMING2_TRCD_LSB 13
|
||||
#define SDR_CTRLGRP_DRAMTIMING2_TRCD_MASK 0x0001e000
|
||||
#define SDR_CTRLGRP_DRAMTIMING2_TREFI_LSB 0
|
||||
#define SDR_CTRLGRP_DRAMTIMING2_TREFI_MASK 0x00001fff
|
||||
/* Register template: sdr::ctrlgrp::dramtiming3 */
|
||||
#define SDR_CTRLGRP_DRAMTIMING3_TCCD_LSB 19
|
||||
#define SDR_CTRLGRP_DRAMTIMING3_TCCD_MASK 0x00780000
|
||||
#define SDR_CTRLGRP_DRAMTIMING3_TMRD_LSB 15
|
||||
#define SDR_CTRLGRP_DRAMTIMING3_TMRD_MASK 0x00078000
|
||||
#define SDR_CTRLGRP_DRAMTIMING3_TRC_LSB 9
|
||||
#define SDR_CTRLGRP_DRAMTIMING3_TRC_MASK 0x00007e00
|
||||
#define SDR_CTRLGRP_DRAMTIMING3_TRAS_LSB 4
|
||||
#define SDR_CTRLGRP_DRAMTIMING3_TRAS_MASK 0x000001f0
|
||||
#define SDR_CTRLGRP_DRAMTIMING3_TRTP_LSB 0
|
||||
#define SDR_CTRLGRP_DRAMTIMING3_TRTP_MASK 0x0000000f
|
||||
/* Register template: sdr::ctrlgrp::dramtiming4 */
|
||||
#define SDR_CTRLGRP_DRAMTIMING4_MINPWRSAVECYCLES_LSB 20
|
||||
#define SDR_CTRLGRP_DRAMTIMING4_MINPWRSAVECYCLES_MASK 0x00f00000
|
||||
#define SDR_CTRLGRP_DRAMTIMING4_PWRDOWNEXIT_LSB 10
|
||||
#define SDR_CTRLGRP_DRAMTIMING4_PWRDOWNEXIT_MASK 0x000ffc00
|
||||
#define SDR_CTRLGRP_DRAMTIMING4_SELFRFSHEXIT_LSB 0
|
||||
#define SDR_CTRLGRP_DRAMTIMING4_SELFRFSHEXIT_MASK 0x000003ff
|
||||
/* Register template: sdr::ctrlgrp::lowpwrtiming */
|
||||
#define SDR_CTRLGRP_LOWPWRTIMING_CLKDISABLECYCLES_LSB 16
|
||||
#define SDR_CTRLGRP_LOWPWRTIMING_CLKDISABLECYCLES_MASK 0x000f0000
|
||||
#define SDR_CTRLGRP_LOWPWRTIMING_AUTOPDCYCLES_LSB 0
|
||||
#define SDR_CTRLGRP_LOWPWRTIMING_AUTOPDCYCLES_MASK 0x0000ffff
|
||||
/* Register template: sdr::ctrlgrp::dramaddrw */
|
||||
#define SDR_CTRLGRP_DRAMADDRW_CSBITS_LSB 13
|
||||
#define SDR_CTRLGRP_DRAMADDRW_CSBITS_MASK 0x0000e000
|
||||
#define SDR_CTRLGRP_DRAMADDRW_BANKBITS_LSB 10
|
||||
#define SDR_CTRLGRP_DRAMADDRW_BANKBITS_MASK 0x00001c00
|
||||
#define SDR_CTRLGRP_DRAMADDRW_ROWBITS_LSB 5
|
||||
#define SDR_CTRLGRP_DRAMADDRW_ROWBITS_MASK 0x000003e0
|
||||
#define SDR_CTRLGRP_DRAMADDRW_COLBITS_LSB 0
|
||||
#define SDR_CTRLGRP_DRAMADDRW_COLBITS_MASK 0x0000001f
|
||||
/* Register template: sdr::ctrlgrp::dramifwidth */
|
||||
#define SDR_CTRLGRP_DRAMIFWIDTH_IFWIDTH_LSB 0
|
||||
#define SDR_CTRLGRP_DRAMIFWIDTH_IFWIDTH_MASK 0x000000ff
|
||||
/* Register template: sdr::ctrlgrp::dramdevwidth */
|
||||
#define SDR_CTRLGRP_DRAMDEVWIDTH_DEVWIDTH_LSB 0
|
||||
#define SDR_CTRLGRP_DRAMDEVWIDTH_DEVWIDTH_MASK 0x0000000f
|
||||
/* Register template: sdr::ctrlgrp::dramintr */
|
||||
#define SDR_CTRLGRP_DRAMINTR_INTREN_LSB 0
|
||||
#define SDR_CTRLGRP_DRAMINTR_INTREN_MASK 0x00000001
|
||||
#define SDR_CTRLGRP_LOWPWREQ_SELFRFSHMASK_LSB 4
|
||||
#define SDR_CTRLGRP_LOWPWREQ_SELFRFSHMASK_MASK 0x00000030
|
||||
/* Register template: sdr::ctrlgrp::staticcfg */
|
||||
#define SDR_CTRLGRP_STATICCFG_APPLYCFG_LSB 3
|
||||
#define SDR_CTRLGRP_STATICCFG_APPLYCFG_MASK 0x00000008
|
||||
#define SDR_CTRLGRP_STATICCFG_USEECCASDATA_LSB 2
|
||||
#define SDR_CTRLGRP_STATICCFG_USEECCASDATA_MASK 0x00000004
|
||||
#define SDR_CTRLGRP_STATICCFG_MEMBL_LSB 0
|
||||
#define SDR_CTRLGRP_STATICCFG_MEMBL_MASK 0x00000003
|
||||
/* Register template: sdr::ctrlgrp::ctrlwidth */
|
||||
#define SDR_CTRLGRP_CTRLWIDTH_CTRLWIDTH_LSB 0
|
||||
#define SDR_CTRLGRP_CTRLWIDTH_CTRLWIDTH_MASK 0x00000003
|
||||
/* Register template: sdr::ctrlgrp::cportwidth */
|
||||
#define SDR_CTRLGRP_CPORTWIDTH_CMDPORTWIDTH_LSB 0
|
||||
#define SDR_CTRLGRP_CPORTWIDTH_CMDPORTWIDTH_MASK 0x000fffff
|
||||
/* Register template: sdr::ctrlgrp::cportwmap */
|
||||
#define SDR_CTRLGRP_CPORTWMAP_CPORTWFIFOMAP_LSB 0
|
||||
#define SDR_CTRLGRP_CPORTWMAP_CPORTWFIFOMAP_MASK 0x3fffffff
|
||||
/* Register template: sdr::ctrlgrp::cportrmap */
|
||||
#define SDR_CTRLGRP_CPORTRMAP_CPORTRFIFOMAP_LSB 0
|
||||
#define SDR_CTRLGRP_CPORTRMAP_CPORTRFIFOMAP_MASK 0x3fffffff
|
||||
/* Register template: sdr::ctrlgrp::rfifocmap */
|
||||
#define SDR_CTRLGRP_RFIFOCMAP_RFIFOCPORTMAP_LSB 0
|
||||
#define SDR_CTRLGRP_RFIFOCMAP_RFIFOCPORTMAP_MASK 0x00ffffff
|
||||
/* Register template: sdr::ctrlgrp::wfifocmap */
|
||||
#define SDR_CTRLGRP_WFIFOCMAP_WFIFOCPORTMAP_LSB 0
|
||||
#define SDR_CTRLGRP_WFIFOCMAP_WFIFOCPORTMAP_MASK 0x00ffffff
|
||||
/* Register template: sdr::ctrlgrp::cportrdwr */
|
||||
#define SDR_CTRLGRP_CPORTRDWR_CPORTRDWR_LSB 0
|
||||
#define SDR_CTRLGRP_CPORTRDWR_CPORTRDWR_MASK 0x000fffff
|
||||
/* Register template: sdr::ctrlgrp::portcfg */
|
||||
#define SDR_CTRLGRP_PORTCFG_AUTOPCHEN_LSB 10
|
||||
#define SDR_CTRLGRP_PORTCFG_AUTOPCHEN_MASK 0x000ffc00
|
||||
#define SDR_CTRLGRP_PORTCFG_PORTPROTOCOL_LSB 0
|
||||
#define SDR_CTRLGRP_PORTCFG_PORTPROTOCOL_MASK 0x000003ff
|
||||
/* Register template: sdr::ctrlgrp::fifocfg */
|
||||
#define SDR_CTRLGRP_FIFOCFG_INCSYNC_LSB 10
|
||||
#define SDR_CTRLGRP_FIFOCFG_INCSYNC_MASK 0x00000400
|
||||
#define SDR_CTRLGRP_FIFOCFG_SYNCMODE_LSB 0
|
||||
#define SDR_CTRLGRP_FIFOCFG_SYNCMODE_MASK 0x000003ff
|
||||
/* Register template: sdr::ctrlgrp::mppriority */
|
||||
#define SDR_CTRLGRP_MPPRIORITY_USERPRIORITY_LSB 0
|
||||
#define SDR_CTRLGRP_MPPRIORITY_USERPRIORITY_MASK 0x3fffffff
|
||||
/* Register template: sdr::ctrlgrp::mpweight::mpweight_0 */
|
||||
#define SDR_CTRLGRP_MPWEIGHT_MPWEIGHT_0_STATICWEIGHT_31_0_LSB 0
|
||||
#define SDR_CTRLGRP_MPWEIGHT_MPWEIGHT_0_STATICWEIGHT_31_0_MASK 0xffffffff
|
||||
/* Register template: sdr::ctrlgrp::mpweight::mpweight_1 */
|
||||
#define SDR_CTRLGRP_MPWEIGHT_MPWEIGHT_1_SUMOFWEIGHTS_13_0_LSB 18
|
||||
#define SDR_CTRLGRP_MPWEIGHT_MPWEIGHT_1_SUMOFWEIGHTS_13_0_MASK 0xfffc0000
|
||||
#define SDR_CTRLGRP_MPWEIGHT_MPWEIGHT_1_STATICWEIGHT_49_32_LSB 0
|
||||
#define SDR_CTRLGRP_MPWEIGHT_MPWEIGHT_1_STATICWEIGHT_49_32_MASK 0x0003ffff
|
||||
/* Register template: sdr::ctrlgrp::mpweight::mpweight_2 */
|
||||
#define SDR_CTRLGRP_MPWEIGHT_MPWEIGHT_2_SUMOFWEIGHTS_45_14_LSB 0
|
||||
#define SDR_CTRLGRP_MPWEIGHT_MPWEIGHT_2_SUMOFWEIGHTS_45_14_MASK 0xffffffff
|
||||
/* Register template: sdr::ctrlgrp::mpweight::mpweight_3 */
|
||||
#define SDR_CTRLGRP_MPWEIGHT_MPWEIGHT_3_SUMOFWEIGHTS_63_46_LSB 0
|
||||
#define SDR_CTRLGRP_MPWEIGHT_MPWEIGHT_3_SUMOFWEIGHTS_63_46_MASK 0x0003ffff
|
||||
/* Register template: sdr::ctrlgrp::mppacing::mppacing_0 */
|
||||
#define SDR_CTRLGRP_MPPACING_MPPACING_0_THRESHOLD1_31_0_LSB 0
|
||||
#define SDR_CTRLGRP_MPPACING_MPPACING_0_THRESHOLD1_31_0_MASK 0xffffffff
|
||||
/* Register template: sdr::ctrlgrp::mppacing::mppacing_1 */
|
||||
#define SDR_CTRLGRP_MPPACING_MPPACING_1_THRESHOLD2_3_0_LSB 28
|
||||
#define SDR_CTRLGRP_MPPACING_MPPACING_1_THRESHOLD2_3_0_MASK 0xf0000000
|
||||
#define SDR_CTRLGRP_MPPACING_MPPACING_1_THRESHOLD1_59_32_LSB 0
|
||||
#define SDR_CTRLGRP_MPPACING_MPPACING_1_THRESHOLD1_59_32_MASK 0x0fffffff
|
||||
/* Register template: sdr::ctrlgrp::mppacing::mppacing_2 */
|
||||
#define SDR_CTRLGRP_MPPACING_MPPACING_2_THRESHOLD2_35_4_LSB 0
|
||||
#define SDR_CTRLGRP_MPPACING_MPPACING_2_THRESHOLD2_35_4_MASK 0xffffffff
|
||||
/* Register template: sdr::ctrlgrp::mppacing::mppacing_3 */
|
||||
#define SDR_CTRLGRP_MPPACING_MPPACING_3_THRESHOLD2_59_36_LSB 0
|
||||
#define SDR_CTRLGRP_MPPACING_MPPACING_3_THRESHOLD2_59_36_MASK 0x00ffffff
|
||||
/* Register template: sdr::ctrlgrp::mpthresholdrst::mpthresholdrst_0 */
|
||||
#define \
|
||||
SDR_CTRLGRP_MPTHRESHOLDRST_0_THRESHOLDRSTCYCLES_31_0_LSB 0
|
||||
#define \
|
||||
SDR_CTRLGRP_MPTHRESHOLDRST_0_THRESHOLDRSTCYCLES_31_0_MASK \
|
||||
0xffffffff
|
||||
/* Register template: sdr::ctrlgrp::mpthresholdrst::mpthresholdrst_1 */
|
||||
#define \
|
||||
SDR_CTRLGRP_MPTHRESHOLDRST_1_THRESHOLDRSTCYCLES_63_32_LSB 0
|
||||
#define \
|
||||
SDR_CTRLGRP_MPTHRESHOLDRST_1_THRESHOLDRSTCYCLES_63_32_MASK \
|
||||
0xffffffff
|
||||
/* Register template: sdr::ctrlgrp::mpthresholdrst::mpthresholdrst_2 */
|
||||
#define \
|
||||
SDR_CTRLGRP_MPTHRESHOLDRST_2_THRESHOLDRSTCYCLES_79_64_LSB 0
|
||||
#define \
|
||||
SDR_CTRLGRP_MPTHRESHOLDRST_2_THRESHOLDRSTCYCLES_79_64_MASK \
|
||||
0x0000ffff
|
||||
/* Register template: sdr::ctrlgrp::remappriority */
|
||||
#define SDR_CTRLGRP_REMAPPRIORITY_PRIORITYREMAP_LSB 0
|
||||
#define SDR_CTRLGRP_REMAPPRIORITY_PRIORITYREMAP_MASK 0x000000ff
|
||||
/* Register template: sdr::ctrlgrp::phyctrl::phyctrl_0 */
|
||||
#define SDR_CTRLGRP_PHYCTRL_PHYCTRL_0_SAMPLECOUNT_19_0_LSB 12
|
||||
#define SDR_CTRLGRP_PHYCTRL_PHYCTRL_0_SAMPLECOUNT_19_0_WIDTH 20
|
||||
#define SDR_CTRLGRP_PHYCTRL_PHYCTRL_0_SAMPLECOUNT_19_0_SET(x) \
|
||||
(((x) << 12) & 0xfffff000)
|
||||
#define SDR_CTRLGRP_PHYCTRL_PHYCTRL_0_ADDLATSEL_SET(x) \
|
||||
(((x) << 10) & 0x00000c00)
|
||||
#define SDR_CTRLGRP_PHYCTRL_PHYCTRL_0_DQSLOGICDELAYEN_SET(x) \
|
||||
(((x) << 6) & 0x000000c0)
|
||||
#define SDR_CTRLGRP_PHYCTRL_PHYCTRL_0_RESETDELAYEN_SET(x) \
|
||||
(((x) << 8) & 0x00000100)
|
||||
#define SDR_CTRLGRP_PHYCTRL_PHYCTRL_0_LPDDRDIS_SET(x) \
|
||||
(((x) << 9) & 0x00000200)
|
||||
#define SDR_CTRLGRP_PHYCTRL_PHYCTRL_0_DQSDELAYEN_SET(x) \
|
||||
(((x) << 4) & 0x00000030)
|
||||
#define SDR_CTRLGRP_PHYCTRL_PHYCTRL_0_DQDELAYEN_SET(x) \
|
||||
(((x) << 2) & 0x0000000c)
|
||||
#define SDR_CTRLGRP_PHYCTRL_PHYCTRL_0_ACDELAYEN_SET(x) \
|
||||
(((x) << 0) & 0x00000003)
|
||||
/* Register template: sdr::ctrlgrp::phyctrl::phyctrl_1 */
|
||||
#define SDR_CTRLGRP_PHYCTRL_PHYCTRL_1_LONGIDLESAMPLECOUNT_19_0_WIDTH 20
|
||||
#define SDR_CTRLGRP_PHYCTRL_PHYCTRL_1_LONGIDLESAMPLECOUNT_19_0_SET(x) \
|
||||
(((x) << 12) & 0xfffff000)
|
||||
#define SDR_CTRLGRP_PHYCTRL_PHYCTRL_1_SAMPLECOUNT_31_20_SET(x) \
|
||||
(((x) << 0) & 0x00000fff)
|
||||
/* Register template: sdr::ctrlgrp::phyctrl::phyctrl_2 */
|
||||
#define SDR_CTRLGRP_PHYCTRL_PHYCTRL_2_LONGIDLESAMPLECOUNT_31_20_SET(x) \
|
||||
(((x) << 0) & 0x00000fff)
|
||||
/* Register template: sdr::ctrlgrp::dramodt */
|
||||
#define SDR_CTRLGRP_DRAMODT_READ_LSB 4
|
||||
#define SDR_CTRLGRP_DRAMODT_READ_MASK 0x000000f0
|
||||
#define SDR_CTRLGRP_DRAMODT_WRITE_LSB 0
|
||||
#define SDR_CTRLGRP_DRAMODT_WRITE_MASK 0x0000000f
|
||||
/* Field instance: sdr::ctrlgrp::dramsts */
|
||||
#define SDR_CTRLGRP_DRAMSTS_DBEERR_MASK 0x00000008
|
||||
#define SDR_CTRLGRP_DRAMSTS_SBEERR_MASK 0x00000004
|
||||
/* Register template: sdr::ctrlgrp::extratime1 */
|
||||
#define SDR_CTRLGRP_EXTRATIME1_RD_TO_WR_LSB 20
|
||||
#define SDR_CTRLGRP_EXTRATIME1_RD_TO_WR_BC_LSB 24
|
||||
#define SDR_CTRLGRP_EXTRATIME1_RD_TO_WR_DIFF_LSB 28
|
||||
|
||||
/* SDRAM width macro for configuration with ECC */
|
||||
#define SDRAM_WIDTH_32BIT_WITH_ECC 40
|
||||
#define SDRAM_WIDTH_16BIT_WITH_ECC 24
|
||||
|
||||
#endif
|
||||
#endif /* _SOCFPGA_SDRAM_GEN5_H_ */
|
||||
@@ -0,0 +1,95 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0+ */
|
||||
/*
|
||||
* Copyright (C) 2013-2017 Altera Corporation <www.altera.com>
|
||||
*/
|
||||
|
||||
#ifndef _SYSTEM_MANAGER_H_
|
||||
#define _SYSTEM_MANAGER_H_
|
||||
|
||||
#if defined(CONFIG_TARGET_SOCFPGA_STRATIX10)
|
||||
#include <asm/arch/system_manager_s10.h>
|
||||
#else
|
||||
#define SYSMGR_ROMCODEGRP_CTRL_WARMRSTCFGPINMUX BIT(0)
|
||||
#define SYSMGR_ROMCODEGRP_CTRL_WARMRSTCFGIO BIT(1)
|
||||
#define SYSMGR_ECC_OCRAM_EN BIT(0)
|
||||
#define SYSMGR_ECC_OCRAM_SERR BIT(3)
|
||||
#define SYSMGR_ECC_OCRAM_DERR BIT(4)
|
||||
#define SYSMGR_FPGAINTF_USEFPGA 0x1
|
||||
#define SYSMGR_FPGAINTF_SPIM0 BIT(0)
|
||||
#define SYSMGR_FPGAINTF_SPIM1 BIT(1)
|
||||
#define SYSMGR_FPGAINTF_EMAC0 BIT(2)
|
||||
#define SYSMGR_FPGAINTF_EMAC1 BIT(3)
|
||||
#define SYSMGR_FPGAINTF_NAND BIT(4)
|
||||
#define SYSMGR_FPGAINTF_SDMMC BIT(5)
|
||||
|
||||
#define SYSMGR_SDMMC_DRVSEL_SHIFT 0
|
||||
|
||||
/* EMAC Group Bit definitions */
|
||||
#define SYSMGR_EMACGRP_CTRL_PHYSEL_ENUM_GMII_MII 0x0
|
||||
#define SYSMGR_EMACGRP_CTRL_PHYSEL_ENUM_RGMII 0x1
|
||||
#define SYSMGR_EMACGRP_CTRL_PHYSEL_ENUM_RMII 0x2
|
||||
|
||||
#define SYSMGR_EMACGRP_CTRL_PHYSEL0_LSB 0
|
||||
#define SYSMGR_EMACGRP_CTRL_PHYSEL1_LSB 2
|
||||
#define SYSMGR_EMACGRP_CTRL_PHYSEL_MASK 0x3
|
||||
|
||||
/* For dedicated IO configuration */
|
||||
/* Voltage select enums */
|
||||
#define VOLTAGE_SEL_3V 0x0
|
||||
#define VOLTAGE_SEL_1P8V 0x1
|
||||
#define VOLTAGE_SEL_2P5V 0x2
|
||||
|
||||
/* Input buffer enable */
|
||||
#define INPUT_BUF_DISABLE 0
|
||||
#define INPUT_BUF_1P8V 1
|
||||
#define INPUT_BUF_2P5V3V 2
|
||||
|
||||
/* Weak pull up enable */
|
||||
#define WK_PU_DISABLE 0
|
||||
#define WK_PU_ENABLE 1
|
||||
|
||||
/* Pull up slew rate control */
|
||||
#define PU_SLW_RT_SLOW 0
|
||||
#define PU_SLW_RT_FAST 1
|
||||
#define PU_SLW_RT_DEFAULT PU_SLW_RT_SLOW
|
||||
|
||||
/* Pull down slew rate control */
|
||||
#define PD_SLW_RT_SLOW 0
|
||||
#define PD_SLW_RT_FAST 1
|
||||
#define PD_SLW_RT_DEFAULT PD_SLW_RT_SLOW
|
||||
|
||||
/* Drive strength control */
|
||||
#define PU_DRV_STRG_DEFAULT 0x10
|
||||
#define PD_DRV_STRG_DEFAULT 0x10
|
||||
|
||||
/* bit position */
|
||||
#define PD_DRV_STRG_LSB 0
|
||||
#define PD_SLW_RT_LSB 5
|
||||
#define PU_DRV_STRG_LSB 8
|
||||
#define PU_SLW_RT_LSB 13
|
||||
#define WK_PU_LSB 16
|
||||
#define INPUT_BUF_LSB 17
|
||||
#define BIAS_TRIM_LSB 19
|
||||
#define VOLTAGE_SEL_LSB 0
|
||||
|
||||
#define ALT_SYSMGR_NOC_H2F_SET_MSK BIT(0)
|
||||
#define ALT_SYSMGR_NOC_LWH2F_SET_MSK BIT(4)
|
||||
#define ALT_SYSMGR_NOC_F2H_SET_MSK BIT(8)
|
||||
#define ALT_SYSMGR_NOC_F2SDR0_SET_MSK BIT(16)
|
||||
#define ALT_SYSMGR_NOC_F2SDR1_SET_MSK BIT(20)
|
||||
#define ALT_SYSMGR_NOC_F2SDR2_SET_MSK BIT(24)
|
||||
#define ALT_SYSMGR_NOC_TMO_EN_SET_MSK BIT(0)
|
||||
|
||||
#define ALT_SYSMGR_ECC_INTSTAT_SERR_OCRAM_SET_MSK BIT(1)
|
||||
#define ALT_SYSMGR_ECC_INTSTAT_DERR_OCRAM_SET_MSK BIT(1)
|
||||
|
||||
#if defined(CONFIG_TARGET_SOCFPGA_GEN5)
|
||||
#include <asm/arch/system_manager_gen5.h>
|
||||
#elif defined(CONFIG_TARGET_SOCFPGA_ARRIA10)
|
||||
#include <asm/arch/system_manager_arria10.h>
|
||||
#endif
|
||||
|
||||
#define SYSMGR_GET_BOOTINFO_BSEL(bsel) \
|
||||
(((bsel) >> SYSMGR_BOOTINFO_BSEL_SHIFT) & 7)
|
||||
#endif
|
||||
#endif /* _SYSTEM_MANAGER_H_ */
|
||||
+80
@@ -0,0 +1,80 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0 */
|
||||
/*
|
||||
* Copyright (C) 2016-2017 Intel Corporation <www.intel.com>
|
||||
*/
|
||||
|
||||
#ifndef _SYSTEM_MANAGER_ARRIA10_H_
|
||||
#define _SYSTEM_MANAGER_ARRIA10_H_
|
||||
|
||||
struct socfpga_system_manager {
|
||||
u32 siliconid1;
|
||||
u32 siliconid2;
|
||||
u32 wddbg;
|
||||
u32 bootinfo;
|
||||
u32 mpu_ctrl_l2_ecc;
|
||||
u32 _pad_0x14_0x1f[3];
|
||||
u32 dma;
|
||||
u32 dma_periph;
|
||||
u32 sdmmcgrp_ctrl;
|
||||
u32 sdmmc_l3master;
|
||||
u32 nand_bootstrap;
|
||||
u32 nand_l3master;
|
||||
u32 usb0_l3master;
|
||||
u32 usb1_l3master;
|
||||
u32 emac_global;
|
||||
u32 emac[3];
|
||||
u32 _pad_0x50_0x5f[4];
|
||||
u32 fpgaintf_en_global;
|
||||
u32 fpgaintf_en_0;
|
||||
u32 fpgaintf_en_1;
|
||||
u32 fpgaintf_en_2;
|
||||
u32 fpgaintf_en_3;
|
||||
u32 _pad_0x74_0x7f[3];
|
||||
u32 noc_addr_remap_value;
|
||||
u32 noc_addr_remap_set;
|
||||
u32 noc_addr_remap_clear;
|
||||
u32 _pad_0x8c_0x8f;
|
||||
u32 ecc_intmask_value;
|
||||
u32 ecc_intmask_set;
|
||||
u32 ecc_intmask_clr;
|
||||
u32 ecc_intstatus_serr;
|
||||
u32 ecc_intstatus_derr;
|
||||
u32 mpu_status_l2_ecc;
|
||||
u32 mpu_clear_l2_ecc;
|
||||
u32 mpu_status_l1_parity;
|
||||
u32 mpu_clear_l1_parity;
|
||||
u32 mpu_set_l1_parity;
|
||||
u32 _pad_0xb8_0xbf[2];
|
||||
u32 noc_timeout;
|
||||
u32 noc_idlereq_set;
|
||||
u32 noc_idlereq_clr;
|
||||
u32 noc_idlereq_value;
|
||||
u32 noc_idleack;
|
||||
u32 noc_idlestatus;
|
||||
u32 fpga2soc_ctrl;
|
||||
u32 _pad_0xdc_0xff[9];
|
||||
u32 tsmc_tsel_0;
|
||||
u32 tsmc_tsel_1;
|
||||
u32 tsmc_tsel_2;
|
||||
u32 tsmc_tsel_3;
|
||||
u32 _pad_0x110_0x200[60];
|
||||
u32 romhw_ctrl;
|
||||
u32 romcode_ctrl;
|
||||
u32 romcode_cpu1startaddr;
|
||||
u32 romcode_initswstate;
|
||||
u32 romcode_initswlastld;
|
||||
u32 _pad_0x214_0x217;
|
||||
u32 warmram_enable;
|
||||
u32 warmram_datastart;
|
||||
u32 warmram_length;
|
||||
u32 warmram_execution;
|
||||
u32 warmram_crc;
|
||||
u32 _pad_0x22c_0x22f;
|
||||
u32 isw_handoff[8];
|
||||
u32 romcode_bootromswstate[8];
|
||||
};
|
||||
|
||||
#define SYSMGR_SDMMC_SMPLSEL_SHIFT 4
|
||||
#define SYSMGR_BOOTINFO_BSEL_SHIFT 12
|
||||
|
||||
#endif /* _SYSTEM_MANAGER_ARRIA10_H_ */
|
||||
+121
@@ -0,0 +1,121 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0+ */
|
||||
/*
|
||||
* Copyright (C) 2013-2017 Altera Corporation <www.altera.com>
|
||||
*/
|
||||
|
||||
#ifndef _SYSTEM_MANAGER_GEN5_H_
|
||||
#define _SYSTEM_MANAGER_GEN5_H_
|
||||
|
||||
#ifndef __ASSEMBLY__
|
||||
|
||||
void sysmgr_pinmux_init(void);
|
||||
void sysmgr_config_warmrstcfgio(int enable);
|
||||
|
||||
void sysmgr_get_pinmux_table(const u8 **table, unsigned int *table_len);
|
||||
|
||||
struct socfpga_system_manager {
|
||||
/* System Manager Module */
|
||||
u32 siliconid1; /* 0x00 */
|
||||
u32 siliconid2;
|
||||
u32 _pad_0x8_0xf[2];
|
||||
u32 wddbg; /* 0x10 */
|
||||
u32 bootinfo;
|
||||
u32 hpsinfo;
|
||||
u32 parityinj;
|
||||
/* FPGA Interface Group */
|
||||
u32 fpgaintfgrp_gbl; /* 0x20 */
|
||||
u32 fpgaintfgrp_indiv;
|
||||
u32 fpgaintfgrp_module;
|
||||
u32 _pad_0x2c_0x2f;
|
||||
/* Scan Manager Group */
|
||||
u32 scanmgrgrp_ctrl; /* 0x30 */
|
||||
u32 _pad_0x34_0x3f[3];
|
||||
/* Freeze Control Group */
|
||||
u32 frzctrl_vioctrl; /* 0x40 */
|
||||
u32 _pad_0x44_0x4f[3];
|
||||
u32 frzctrl_hioctrl; /* 0x50 */
|
||||
u32 frzctrl_src;
|
||||
u32 frzctrl_hwctrl;
|
||||
u32 _pad_0x5c_0x5f;
|
||||
/* EMAC Group */
|
||||
u32 emacgrp_ctrl; /* 0x60 */
|
||||
u32 emacgrp_l3master;
|
||||
u32 _pad_0x68_0x6f[2];
|
||||
/* DMA Controller Group */
|
||||
u32 dmagrp_ctrl; /* 0x70 */
|
||||
u32 dmagrp_persecurity;
|
||||
u32 _pad_0x78_0x7f[2];
|
||||
/* Preloader (initial software) Group */
|
||||
u32 iswgrp_handoff[8]; /* 0x80 */
|
||||
u32 _pad_0xa0_0xbf[8]; /* 0xa0 */
|
||||
/* Boot ROM Code Register Group */
|
||||
u32 romcodegrp_ctrl; /* 0xc0 */
|
||||
u32 romcodegrp_cpu1startaddr;
|
||||
u32 romcodegrp_initswstate;
|
||||
u32 romcodegrp_initswlastld;
|
||||
u32 romcodegrp_bootromswstate; /* 0xd0 */
|
||||
u32 __pad_0xd4_0xdf[3];
|
||||
/* Warm Boot from On-Chip RAM Group */
|
||||
u32 romcodegrp_warmramgrp_enable; /* 0xe0 */
|
||||
u32 romcodegrp_warmramgrp_datastart;
|
||||
u32 romcodegrp_warmramgrp_length;
|
||||
u32 romcodegrp_warmramgrp_execution;
|
||||
u32 romcodegrp_warmramgrp_crc; /* 0xf0 */
|
||||
u32 __pad_0xf4_0xff[3];
|
||||
/* Boot ROM Hardware Register Group */
|
||||
u32 romhwgrp_ctrl; /* 0x100 */
|
||||
u32 _pad_0x104_0x107;
|
||||
/* SDMMC Controller Group */
|
||||
u32 sdmmcgrp_ctrl;
|
||||
u32 sdmmcgrp_l3master;
|
||||
/* NAND Flash Controller Register Group */
|
||||
u32 nandgrp_bootstrap; /* 0x110 */
|
||||
u32 nandgrp_l3master;
|
||||
/* USB Controller Group */
|
||||
u32 usbgrp_l3master;
|
||||
u32 _pad_0x11c_0x13f[9];
|
||||
/* ECC Management Register Group */
|
||||
u32 eccgrp_l2; /* 0x140 */
|
||||
u32 eccgrp_ocram;
|
||||
u32 eccgrp_usb0;
|
||||
u32 eccgrp_usb1;
|
||||
u32 eccgrp_emac0; /* 0x150 */
|
||||
u32 eccgrp_emac1;
|
||||
u32 eccgrp_dma;
|
||||
u32 eccgrp_can0;
|
||||
u32 eccgrp_can1; /* 0x160 */
|
||||
u32 eccgrp_nand;
|
||||
u32 eccgrp_qspi;
|
||||
u32 eccgrp_sdmmc;
|
||||
u32 _pad_0x170_0x3ff[164];
|
||||
/* Pin Mux Control Group */
|
||||
u32 emacio[20]; /* 0x400 */
|
||||
u32 flashio[12]; /* 0x450 */
|
||||
u32 generalio[28]; /* 0x480 */
|
||||
u32 _pad_0x4f0_0x4ff[4];
|
||||
u32 mixed1io[22]; /* 0x500 */
|
||||
u32 mixed2io[8]; /* 0x558 */
|
||||
u32 gplinmux[23]; /* 0x578 */
|
||||
u32 gplmux[71]; /* 0x5d4 */
|
||||
u32 nandusefpga; /* 0x6f0 */
|
||||
u32 _pad_0x6f4;
|
||||
u32 rgmii1usefpga; /* 0x6f8 */
|
||||
u32 _pad_0x6fc_0x700[2];
|
||||
u32 i2c0usefpga; /* 0x704 */
|
||||
u32 sdmmcusefpga; /* 0x708 */
|
||||
u32 _pad_0x70c_0x710[2];
|
||||
u32 rgmii0usefpga; /* 0x714 */
|
||||
u32 _pad_0x718_0x720[3];
|
||||
u32 i2c3usefpga; /* 0x724 */
|
||||
u32 i2c2usefpga; /* 0x728 */
|
||||
u32 i2c1usefpga; /* 0x72c */
|
||||
u32 spim1usefpga; /* 0x730 */
|
||||
u32 _pad_0x734;
|
||||
u32 spim0usefpga; /* 0x738 */
|
||||
};
|
||||
#endif
|
||||
|
||||
#define SYSMGR_SDMMC_SMPLSEL_SHIFT 3
|
||||
#define SYSMGR_BOOTINFO_BSEL_SHIFT 0
|
||||
|
||||
#endif /* _SYSTEM_MANAGER_GEN5_H_ */
|
||||
+176
@@ -0,0 +1,176 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0
|
||||
*
|
||||
* Copyright (C) 2016-2018 Intel Corporation <www.intel.com>
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _SYSTEM_MANAGER_S10_
|
||||
#define _SYSTEM_MANAGER_S10_
|
||||
|
||||
void sysmgr_pinmux_init(void);
|
||||
void populate_sysmgr_fpgaintf_module(void);
|
||||
void populate_sysmgr_pinmux(void);
|
||||
void sysmgr_pinmux_table_sel(const u32 **table, unsigned int *table_len);
|
||||
void sysmgr_pinmux_table_ctrl(const u32 **table, unsigned int *table_len);
|
||||
void sysmgr_pinmux_table_fpga(const u32 **table, unsigned int *table_len);
|
||||
void sysmgr_pinmux_table_delay(const u32 **table, unsigned int *table_len);
|
||||
|
||||
struct socfpga_system_manager {
|
||||
/* System Manager Module */
|
||||
u32 siliconid1; /* 0x00 */
|
||||
u32 siliconid2;
|
||||
u32 wddbg;
|
||||
u32 _pad_0xc;
|
||||
u32 mpu_status; /* 0x10 */
|
||||
u32 mpu_ace;
|
||||
u32 _pad_0x18_0x1c[2];
|
||||
u32 dma; /* 0x20 */
|
||||
u32 dma_periph;
|
||||
/* SDMMC Controller Group */
|
||||
u32 sdmmcgrp_ctrl;
|
||||
u32 sdmmcgrp_l3master;
|
||||
/* NAND Flash Controller Register Group */
|
||||
u32 nandgrp_bootstrap; /* 0x30 */
|
||||
u32 nandgrp_l3master;
|
||||
/* USB Controller Group */
|
||||
u32 usb0_l3master;
|
||||
u32 usb1_l3master;
|
||||
/* EMAC Group */
|
||||
u32 emac_gbl; /* 0x40 */
|
||||
u32 emac0;
|
||||
u32 emac1;
|
||||
u32 emac2;
|
||||
u32 emac0_ace; /* 0x50 */
|
||||
u32 emac1_ace;
|
||||
u32 emac2_ace;
|
||||
u32 nand_axuser;
|
||||
u32 _pad_0x60_0x64[2]; /* 0x60 */
|
||||
/* FPGA interface Group */
|
||||
u32 fpgaintf_en_1;
|
||||
u32 fpgaintf_en_2;
|
||||
u32 fpgaintf_en_3; /* 0x70 */
|
||||
u32 dma_l3master;
|
||||
u32 etr_l3master;
|
||||
u32 _pad_0x7c;
|
||||
u32 sec_ctrl_slt; /* 0x80 */
|
||||
u32 osc_trim;
|
||||
u32 _pad_0x88_0x8c[2];
|
||||
/* ECC Group */
|
||||
u32 ecc_intmask_value; /* 0x90 */
|
||||
u32 ecc_intmask_set;
|
||||
u32 ecc_intmask_clr;
|
||||
u32 ecc_intstatus_serr;
|
||||
u32 ecc_intstatus_derr; /* 0xa0 */
|
||||
u32 _pad_0xa4_0xac[3];
|
||||
u32 noc_addr_remap; /* 0xb0 */
|
||||
u32 hmc_clk;
|
||||
u32 io_pa_ctrl;
|
||||
u32 _pad_0xbc;
|
||||
/* NOC Group */
|
||||
u32 noc_timeout; /* 0xc0 */
|
||||
u32 noc_idlereq_set;
|
||||
u32 noc_idlereq_clr;
|
||||
u32 noc_idlereq_value;
|
||||
u32 noc_idleack; /* 0xd0 */
|
||||
u32 noc_idlestatus;
|
||||
u32 fpga2soc_ctrl;
|
||||
u32 fpga_config;
|
||||
u32 iocsrclk_gate; /* 0xe0 */
|
||||
u32 gpo;
|
||||
u32 gpi;
|
||||
u32 _pad_0xec;
|
||||
u32 mpu; /* 0xf0 */
|
||||
u32 sdm_hps_spare;
|
||||
u32 hps_sdm_spare;
|
||||
u32 _pad_0xfc_0x1fc[65];
|
||||
/* Boot scratch register group */
|
||||
u32 boot_scratch_cold0; /* 0x200 */
|
||||
u32 boot_scratch_cold1;
|
||||
u32 boot_scratch_cold2;
|
||||
u32 boot_scratch_cold3;
|
||||
u32 boot_scratch_cold4; /* 0x210 */
|
||||
u32 boot_scratch_cold5;
|
||||
u32 boot_scratch_cold6;
|
||||
u32 boot_scratch_cold7;
|
||||
u32 boot_scratch_cold8; /* 0x220 */
|
||||
u32 boot_scratch_cold9;
|
||||
u32 _pad_0x228_0xffc[886];
|
||||
/* Pin select and pin control group */
|
||||
u32 pinsel0[40]; /* 0x1000 */
|
||||
u32 _pad_0x10a0_0x10fc[24];
|
||||
u32 pinsel40[8];
|
||||
u32 _pad_0x1120_0x112c[4];
|
||||
u32 ioctrl0[28];
|
||||
u32 _pad_0x11a0_0x11fc[24];
|
||||
u32 ioctrl28[20];
|
||||
u32 _pad_0x1250_0x12fc[44];
|
||||
/* Use FPGA mux */
|
||||
u32 rgmii0usefpga; /* 0x1300 */
|
||||
u32 rgmii1usefpga;
|
||||
u32 rgmii2usefpga;
|
||||
u32 i2c0usefpga;
|
||||
u32 i2c1usefpga;
|
||||
u32 i2c_emac0_usefpga;
|
||||
u32 i2c_emac1_usefpga;
|
||||
u32 i2c_emac2_usefpga;
|
||||
u32 nandusefpga;
|
||||
u32 _pad_0x1324;
|
||||
u32 spim0usefpga;
|
||||
u32 spim1usefpga;
|
||||
u32 spis0usefpga;
|
||||
u32 spis1usefpga;
|
||||
u32 uart0usefpga;
|
||||
u32 uart1usefpga;
|
||||
u32 mdio0usefpga;
|
||||
u32 mdio1usefpga;
|
||||
u32 mdio2usefpga;
|
||||
u32 _pad_0x134c;
|
||||
u32 jtagusefpga;
|
||||
u32 sdmmcusefpga;
|
||||
u32 hps_osc_clk;
|
||||
u32 _pad_0x135c_0x13fc[41];
|
||||
u32 iodelay0[40];
|
||||
u32 _pad_0x14a0_0x14fc[24];
|
||||
u32 iodelay40[8];
|
||||
|
||||
};
|
||||
|
||||
#define SYSMGR_ROMCODEGRP_CTRL_WARMRSTCFGPINMUX BIT(0)
|
||||
#define SYSMGR_ROMCODEGRP_CTRL_WARMRSTCFGIO BIT(1)
|
||||
#define SYSMGR_ECC_OCRAM_EN BIT(0)
|
||||
#define SYSMGR_ECC_OCRAM_SERR BIT(3)
|
||||
#define SYSMGR_ECC_OCRAM_DERR BIT(4)
|
||||
#define SYSMGR_FPGAINTF_USEFPGA 0x1
|
||||
|
||||
#define SYSMGR_FPGAINTF_NAND BIT(4)
|
||||
#define SYSMGR_FPGAINTF_SDMMC BIT(8)
|
||||
#define SYSMGR_FPGAINTF_SPIM0 BIT(16)
|
||||
#define SYSMGR_FPGAINTF_SPIM1 BIT(24)
|
||||
#define SYSMGR_FPGAINTF_EMAC0 BIT(0)
|
||||
#define SYSMGR_FPGAINTF_EMAC1 BIT(8)
|
||||
#define SYSMGR_FPGAINTF_EMAC2 BIT(16)
|
||||
|
||||
#define SYSMGR_SDMMC_SMPLSEL_SHIFT 4
|
||||
#define SYSMGR_SDMMC_DRVSEL_SHIFT 0
|
||||
|
||||
/* EMAC Group Bit definitions */
|
||||
#define SYSMGR_EMACGRP_CTRL_PHYSEL_ENUM_GMII_MII 0x0
|
||||
#define SYSMGR_EMACGRP_CTRL_PHYSEL_ENUM_RGMII 0x1
|
||||
#define SYSMGR_EMACGRP_CTRL_PHYSEL_ENUM_RMII 0x2
|
||||
|
||||
#define SYSMGR_EMACGRP_CTRL_PHYSEL0_LSB 0
|
||||
#define SYSMGR_EMACGRP_CTRL_PHYSEL1_LSB 2
|
||||
#define SYSMGR_EMACGRP_CTRL_PHYSEL_MASK 0x3
|
||||
|
||||
#define SYSMGR_NOC_H2F_MSK 0x00000001
|
||||
#define SYSMGR_NOC_LWH2F_MSK 0x00000010
|
||||
#define SYSMGR_HMC_CLK_STATUS_MSK 0x00000001
|
||||
|
||||
#define SYSMGR_DMA_IRQ_NS 0xFF000000
|
||||
#define SYSMGR_DMA_MGR_NS 0x00010000
|
||||
|
||||
#define SYSMGR_DMAPERIPH_ALL_NS 0xFFFFFFFF
|
||||
|
||||
#define SYSMGR_WDDBG_PAUSE_ALL_CPU 0x0F0F0F0F
|
||||
|
||||
#endif /* _SYSTEM_MANAGER_S10_ */
|
||||
@@ -0,0 +1,17 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0+ */
|
||||
/*
|
||||
* Copyright (C) 2012 Altera Corporation <www.altera.com>
|
||||
*/
|
||||
|
||||
#ifndef _SOCFPGA_TIMER_H_
|
||||
#define _SOCFPGA_TIMER_H_
|
||||
|
||||
struct socfpga_timer {
|
||||
u32 load_val;
|
||||
u32 curr_val;
|
||||
u32 ctrl;
|
||||
u32 eoi;
|
||||
u32 int_stat;
|
||||
};
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user