2020-09-01 04:38:59 +03:00
|
|
|
/*
|
|
|
|
* Microchip PolarFire SoC machine interface
|
|
|
|
*
|
|
|
|
* Copyright (c) 2020 Wind River Systems, Inc.
|
|
|
|
*
|
|
|
|
* Author:
|
|
|
|
* Bin Meng <bin.meng@windriver.com>
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify it
|
|
|
|
* under the terms and conditions of the GNU General Public License,
|
|
|
|
* version 2 or later, as published by the Free Software Foundation.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope it will be useful, but WITHOUT
|
|
|
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
|
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
|
|
|
* more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License along with
|
|
|
|
* this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef HW_MICROCHIP_PFSOC_H
|
|
|
|
#define HW_MICROCHIP_PFSOC_H
|
|
|
|
|
2022-12-22 15:08:11 +03:00
|
|
|
#include "hw/boards.h"
|
2020-09-01 04:39:01 +03:00
|
|
|
#include "hw/char/mchp_pfsoc_mmuart.h"
|
2022-12-22 15:08:11 +03:00
|
|
|
#include "hw/cpu/cluster.h"
|
2020-09-01 04:39:05 +03:00
|
|
|
#include "hw/dma/sifive_pdma.h"
|
2020-10-28 08:30:03 +03:00
|
|
|
#include "hw/misc/mchp_pfsoc_dmc.h"
|
2020-10-28 08:30:05 +03:00
|
|
|
#include "hw/misc/mchp_pfsoc_ioscb.h"
|
2020-10-28 08:30:07 +03:00
|
|
|
#include "hw/misc/mchp_pfsoc_sysreg.h"
|
2020-09-01 04:39:08 +03:00
|
|
|
#include "hw/net/cadence_gem.h"
|
2020-09-01 04:39:03 +03:00
|
|
|
#include "hw/sd/cadence_sdhci.h"
|
2022-12-22 15:08:11 +03:00
|
|
|
#include "hw/riscv/riscv_hart.h"
|
2020-09-01 04:39:01 +03:00
|
|
|
|
2020-09-01 04:38:59 +03:00
|
|
|
typedef struct MicrochipPFSoCState {
|
|
|
|
/*< private >*/
|
|
|
|
DeviceState parent_obj;
|
|
|
|
|
|
|
|
/*< public >*/
|
|
|
|
CPUClusterState e_cluster;
|
|
|
|
CPUClusterState u_cluster;
|
|
|
|
RISCVHartArrayState e_cpus;
|
|
|
|
RISCVHartArrayState u_cpus;
|
|
|
|
DeviceState *plic;
|
2020-10-28 08:30:03 +03:00
|
|
|
MchpPfSoCDdrSgmiiPhyState ddr_sgmii_phy;
|
|
|
|
MchpPfSoCDdrCfgState ddr_cfg;
|
2020-10-28 08:30:05 +03:00
|
|
|
MchpPfSoCIoscbState ioscb;
|
2020-09-01 04:39:01 +03:00
|
|
|
MchpPfSoCMMUartState *serial0;
|
|
|
|
MchpPfSoCMMUartState *serial1;
|
|
|
|
MchpPfSoCMMUartState *serial2;
|
|
|
|
MchpPfSoCMMUartState *serial3;
|
|
|
|
MchpPfSoCMMUartState *serial4;
|
2020-10-28 08:30:07 +03:00
|
|
|
MchpPfSoCSysregState sysreg;
|
2020-09-01 04:39:05 +03:00
|
|
|
SiFivePDMAState dma;
|
2020-09-01 04:39:08 +03:00
|
|
|
CadenceGEMState gem0;
|
|
|
|
CadenceGEMState gem1;
|
2020-09-01 04:39:03 +03:00
|
|
|
CadenceSDHCIState sdhci;
|
2020-09-01 04:38:59 +03:00
|
|
|
} MicrochipPFSoCState;
|
|
|
|
|
|
|
|
#define TYPE_MICROCHIP_PFSOC "microchip.pfsoc"
|
|
|
|
#define MICROCHIP_PFSOC(obj) \
|
|
|
|
OBJECT_CHECK(MicrochipPFSoCState, (obj), TYPE_MICROCHIP_PFSOC)
|
|
|
|
|
|
|
|
typedef struct MicrochipIcicleKitState {
|
|
|
|
/*< private >*/
|
|
|
|
MachineState parent_obj;
|
|
|
|
|
|
|
|
/*< public >*/
|
|
|
|
MicrochipPFSoCState soc;
|
|
|
|
} MicrochipIcicleKitState;
|
|
|
|
|
|
|
|
#define TYPE_MICROCHIP_ICICLE_KIT_MACHINE \
|
|
|
|
MACHINE_TYPE_NAME("microchip-icicle-kit")
|
|
|
|
#define MICROCHIP_ICICLE_KIT_MACHINE(obj) \
|
|
|
|
OBJECT_CHECK(MicrochipIcicleKitState, (obj), \
|
|
|
|
TYPE_MICROCHIP_ICICLE_KIT_MACHINE)
|
|
|
|
|
|
|
|
enum {
|
2020-10-28 08:30:08 +03:00
|
|
|
MICROCHIP_PFSOC_RSVD0,
|
2020-09-01 04:38:59 +03:00
|
|
|
MICROCHIP_PFSOC_DEBUG,
|
|
|
|
MICROCHIP_PFSOC_E51_DTIM,
|
|
|
|
MICROCHIP_PFSOC_BUSERR_UNIT0,
|
|
|
|
MICROCHIP_PFSOC_BUSERR_UNIT1,
|
|
|
|
MICROCHIP_PFSOC_BUSERR_UNIT2,
|
|
|
|
MICROCHIP_PFSOC_BUSERR_UNIT3,
|
|
|
|
MICROCHIP_PFSOC_BUSERR_UNIT4,
|
|
|
|
MICROCHIP_PFSOC_CLINT,
|
|
|
|
MICROCHIP_PFSOC_L2CC,
|
2020-09-01 04:39:05 +03:00
|
|
|
MICROCHIP_PFSOC_DMA,
|
2020-09-01 04:38:59 +03:00
|
|
|
MICROCHIP_PFSOC_L2LIM,
|
|
|
|
MICROCHIP_PFSOC_PLIC,
|
2020-09-01 04:39:01 +03:00
|
|
|
MICROCHIP_PFSOC_MMUART0,
|
2022-08-13 16:51:27 +03:00
|
|
|
MICROCHIP_PFSOC_WDOG0,
|
2020-09-01 04:38:59 +03:00
|
|
|
MICROCHIP_PFSOC_SYSREG,
|
2022-08-13 16:51:27 +03:00
|
|
|
MICROCHIP_PFSOC_AXISW,
|
2020-09-01 04:38:59 +03:00
|
|
|
MICROCHIP_PFSOC_MPUCFG,
|
2022-08-13 16:51:27 +03:00
|
|
|
MICROCHIP_PFSOC_FMETER,
|
2020-10-28 08:30:03 +03:00
|
|
|
MICROCHIP_PFSOC_DDR_SGMII_PHY,
|
2020-09-01 04:39:03 +03:00
|
|
|
MICROCHIP_PFSOC_EMMC_SD,
|
2020-10-28 08:30:03 +03:00
|
|
|
MICROCHIP_PFSOC_DDR_CFG,
|
2020-09-01 04:39:01 +03:00
|
|
|
MICROCHIP_PFSOC_MMUART1,
|
|
|
|
MICROCHIP_PFSOC_MMUART2,
|
|
|
|
MICROCHIP_PFSOC_MMUART3,
|
|
|
|
MICROCHIP_PFSOC_MMUART4,
|
2022-08-13 16:51:27 +03:00
|
|
|
MICROCHIP_PFSOC_WDOG1,
|
|
|
|
MICROCHIP_PFSOC_WDOG2,
|
|
|
|
MICROCHIP_PFSOC_WDOG3,
|
|
|
|
MICROCHIP_PFSOC_WDOG4,
|
2020-11-12 10:49:51 +03:00
|
|
|
MICROCHIP_PFSOC_SPI0,
|
|
|
|
MICROCHIP_PFSOC_SPI1,
|
2022-08-13 16:51:27 +03:00
|
|
|
MICROCHIP_PFSOC_I2C0,
|
2020-10-28 08:30:10 +03:00
|
|
|
MICROCHIP_PFSOC_I2C1,
|
2022-08-13 16:51:27 +03:00
|
|
|
MICROCHIP_PFSOC_CAN0,
|
|
|
|
MICROCHIP_PFSOC_CAN1,
|
2020-09-01 04:39:08 +03:00
|
|
|
MICROCHIP_PFSOC_GEM0,
|
|
|
|
MICROCHIP_PFSOC_GEM1,
|
2020-09-01 04:39:09 +03:00
|
|
|
MICROCHIP_PFSOC_GPIO0,
|
|
|
|
MICROCHIP_PFSOC_GPIO1,
|
|
|
|
MICROCHIP_PFSOC_GPIO2,
|
2022-08-13 16:51:27 +03:00
|
|
|
MICROCHIP_PFSOC_RTC,
|
2020-09-01 04:38:59 +03:00
|
|
|
MICROCHIP_PFSOC_ENVM_CFG,
|
|
|
|
MICROCHIP_PFSOC_ENVM_DATA,
|
2022-08-13 16:51:27 +03:00
|
|
|
MICROCHIP_PFSOC_USB,
|
2020-11-12 10:49:51 +03:00
|
|
|
MICROCHIP_PFSOC_QSPI_XIP,
|
2020-10-28 08:30:05 +03:00
|
|
|
MICROCHIP_PFSOC_IOSCB,
|
2022-11-18 01:55:17 +03:00
|
|
|
MICROCHIP_PFSOC_FABRIC_FIC0,
|
|
|
|
MICROCHIP_PFSOC_FABRIC_FIC1,
|
2022-08-13 16:51:27 +03:00
|
|
|
MICROCHIP_PFSOC_FABRIC_FIC3,
|
2020-11-01 20:05:38 +03:00
|
|
|
MICROCHIP_PFSOC_DRAM_LO,
|
|
|
|
MICROCHIP_PFSOC_DRAM_LO_ALIAS,
|
|
|
|
MICROCHIP_PFSOC_DRAM_HI,
|
|
|
|
MICROCHIP_PFSOC_DRAM_HI_ALIAS
|
2020-09-01 04:38:59 +03:00
|
|
|
};
|
|
|
|
|
2020-09-01 04:39:01 +03:00
|
|
|
enum {
|
2020-09-01 04:39:05 +03:00
|
|
|
MICROCHIP_PFSOC_DMA_IRQ0 = 5,
|
|
|
|
MICROCHIP_PFSOC_DMA_IRQ1 = 6,
|
|
|
|
MICROCHIP_PFSOC_DMA_IRQ2 = 7,
|
|
|
|
MICROCHIP_PFSOC_DMA_IRQ3 = 8,
|
|
|
|
MICROCHIP_PFSOC_DMA_IRQ4 = 9,
|
|
|
|
MICROCHIP_PFSOC_DMA_IRQ5 = 10,
|
|
|
|
MICROCHIP_PFSOC_DMA_IRQ6 = 11,
|
|
|
|
MICROCHIP_PFSOC_DMA_IRQ7 = 12,
|
2020-09-01 04:39:08 +03:00
|
|
|
MICROCHIP_PFSOC_GEM0_IRQ = 64,
|
|
|
|
MICROCHIP_PFSOC_GEM1_IRQ = 70,
|
2020-09-01 04:39:03 +03:00
|
|
|
MICROCHIP_PFSOC_EMMC_SD_IRQ = 88,
|
2020-09-01 04:39:01 +03:00
|
|
|
MICROCHIP_PFSOC_MMUART0_IRQ = 90,
|
|
|
|
MICROCHIP_PFSOC_MMUART1_IRQ = 91,
|
|
|
|
MICROCHIP_PFSOC_MMUART2_IRQ = 92,
|
|
|
|
MICROCHIP_PFSOC_MMUART3_IRQ = 93,
|
|
|
|
MICROCHIP_PFSOC_MMUART4_IRQ = 94,
|
2022-11-18 01:55:18 +03:00
|
|
|
MICROCHIP_PFSOC_MAILBOX_IRQ = 96,
|
2020-09-01 04:39:01 +03:00
|
|
|
};
|
|
|
|
|
2020-09-01 04:38:59 +03:00
|
|
|
#define MICROCHIP_PFSOC_MANAGEMENT_CPU_COUNT 1
|
|
|
|
#define MICROCHIP_PFSOC_COMPUTE_CPU_COUNT 4
|
|
|
|
|
2022-12-11 06:08:23 +03:00
|
|
|
#define MICROCHIP_PFSOC_PLIC_NUM_SOURCES 187
|
2020-09-01 04:38:59 +03:00
|
|
|
#define MICROCHIP_PFSOC_PLIC_NUM_PRIORITIES 7
|
2022-12-11 06:08:27 +03:00
|
|
|
#define MICROCHIP_PFSOC_PLIC_PRIORITY_BASE 0x00
|
2020-09-01 04:38:59 +03:00
|
|
|
#define MICROCHIP_PFSOC_PLIC_PENDING_BASE 0x1000
|
|
|
|
#define MICROCHIP_PFSOC_PLIC_ENABLE_BASE 0x2000
|
|
|
|
#define MICROCHIP_PFSOC_PLIC_ENABLE_STRIDE 0x80
|
|
|
|
#define MICROCHIP_PFSOC_PLIC_CONTEXT_BASE 0x200000
|
|
|
|
#define MICROCHIP_PFSOC_PLIC_CONTEXT_STRIDE 0x1000
|
|
|
|
|
|
|
|
#endif /* HW_MICROCHIP_PFSOC_H */
|