Skip to content

Commit

Permalink
board/custom-board-design: update to build with latest HSS code base.
Browse files Browse the repository at this point in the history
- Update board specific Makefile.
- Add IHC usage.
- Removed soc_config directory to match other boards.
  • Loading branch information
Cyril-Jean authored and Ivan Griffin committed Apr 22, 2022
1 parent bde2529 commit 6b218e2
Show file tree
Hide file tree
Showing 7 changed files with 629 additions and 76 deletions.
7 changes: 3 additions & 4 deletions boards/custom-board-design/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,7 @@ EXTRA_SRCS-y += \
$(BOARD_DIR)/hss_board_init.c \

EXTRA_SRCS-$(CONFIG_USE_LOGO) += \
init/hss_logo_init.c

$(BOARD_DIR)/hss_logo_init.c

$(BOARD_DIR)/hss_uart_init.o: CFLAGS=$(CFLAGS_GCCEXT)

Expand Down Expand Up @@ -101,7 +100,7 @@ SOC_CONFIG_FILES = \
$(BOARD_DIR)/fpga_design_config/ddr/hw_ddr_segs.h \
$(BOARD_DIR)/fpga_design_config/ddr/hw_ddrc.h \
$(BOARD_DIR)/fpga_design_config/general/hw_gen_peripherals.h \
$(BOARD_DIR)/fpga_design_config/hw_platform.h \
$(BOARD_DIR)/fpga_design_config/fpga_design_config.h \
$(BOARD_DIR)/fpga_design_config/io/hw_hsio_mux.h \
$(BOARD_DIR)/fpga_design_config/io/hw_mssio_mux.h \
$(BOARD_DIR)/fpga_design_config/memory_map/hw_apb_split.h \
Expand All @@ -125,7 +124,7 @@ SOC_CONFIG_FILES = \
$(BOARD_DIR)/fpga_design_config/sgmii/hw_sgmii_tip.h \

config.h: $(SOC_CONFIG_FILES)
$(SOC_CONFIG_FILES): $(BOARD_DIR)/soc_fpga_design/xml/custom_design_cfg.xml
$(SOC_CONFIG_FILES): $(subst $\",,$(CONFIG_SOC_FPGA_DESIGN_XML))
@$(ECHO) " CFGGEN $<";
$(PYTHON) tools/polarfire-soc-configuration-generator/mpfs_configuration_generator.py $< $(BOARD_DIR)

Expand Down
24 changes: 20 additions & 4 deletions boards/custom-board-design/def_config
Original file line number Diff line number Diff line change
@@ -1,4 +1,14 @@
# Generated by Kconfiglib (https://github.com/ulfalizer/Kconfiglib)

#
# Board/Design Configuration Options
#

#
# Custom Board Design Configuration Options
#
CONFIG_SOC_FPGA_DESIGN_XML="boards/custom-board-design/soc_fpga_design/xml/custom_design_cfg.xml"
# end of Icicle-Kit Design Configuration Options
# end of Board/Design Configuration Options

#
# Services
Expand All @@ -9,14 +19,12 @@ CONFIG_SERVICE_BOOT=y
#
# Boot Service
#
CONFIG_SERVICE_BOOT_DDR_TARGET_ADDR=0xA0000000
CONFIG_SERVICE_BOOT_SPI_FLASH_OFFSET=0x400
# CONFIG_SERVICE_BOOT_USE_PAYLOAD is not set
# CONFIG_SERVICE_BOOT_CUSTOM_FLOW is not set
CONFIG_SERVICE_BOOT_DDR_TARGET_ADDR=0xA0000000
CONFIG_SERVICE_BOOT_MMC_USE_GPT=y
# end of Boot Service

# CONFIG_SERVICE_CRYPTO is not set
CONFIG_SERVICE_DDR=y
CONFIG_SERVICE_GOTO=y
CONFIG_SERVICE_IPI_POLL=y
Expand Down Expand Up @@ -160,3 +168,11 @@ CONFIG_DEBUG_LOOP_TIMES_THRESHOLD=2500000
CONFIG_DEBUG_PERF_CTRS=y
CONFIG_DEBUG_PERF_CTRS_NUM=16
# end of Debug Options

#
# SSMB Options
#
CONFIG_HSS_USE_IHC=y
CONFIG_IPI_MAX_NUM_QUEUE_MESSAGES=8
# CONFIG_IPI_FIXED_BASE is not set
# end of SSMB Options
Original file line number Diff line number Diff line change
@@ -0,0 +1,174 @@
/*******************************************************************************
* Copyright 2021 Microchip FPGA Embedded Systems Solutions.
*
* SPDX-License-Identifier: MIT
*
* MPFS HAL Embedded Software
*
*/

/*========================================================================*//**
@mainpage Configuration for the MiV-IHC driver
@section intro_sec Introduction
Used to configure the driver with base addresses from your Libero Projext.
These addresses will not change unless you change the Libero design
IHC subsytem design.
This file is used for reference only.
When usiing in a project copy to
src/boards/your-board/platform-config/drivers_config/fpga-ip/miv_ihc
and rename dropping the _reference.
@section
*//*==========================================================================*/


#ifndef MIV_IHC_ADD_MAPPING_H_
#define MIV_IHC_ADD_MAPPING_H_

#ifndef COMMON_AHB_BASE_ADD
#define COMMON_AHB_BASE_ADD 0x50000000UL
#endif
#ifndef IHC_HO_BASE_OFFSET
#define IHC_HO_BASE_OFFSET 0x00000000UL
#endif
#ifndef IHC_H1_BASE_OFFSET
#define IHC_H1_BASE_OFFSET 0x00000500UL
#endif
#ifndef IHC_H2_BASE_OFFSET
#define IHC_H2_BASE_OFFSET 0x00000A00UL
#endif
#ifndef IHC_H3_BASE_OFFSET
#define IHC_H3_BASE_OFFSET 0x00000F00UL
#endif
#ifndef IHC_H4_BASE_OFFSET
#define IHC_H4_BASE_OFFSET 0x00001400UL
#endif

/************** My Hart 0 ************/

#ifndef IHC_LOCAL_H0_REMOTE_H1
#define IHC_LOCAL_H0_REMOTE_H1 0x50000000
#endif

#ifndef IHC_LOCAL_H0_REMOTE_H2
#define IHC_LOCAL_H0_REMOTE_H2 0x50000100
#endif

#ifndef IHC_LOCAL_H0_REMOTE_H3
#define IHC_LOCAL_H0_REMOTE_H3 0x50000200
#endif

#ifndef IHC_LOCAL_H0_REMOTE_H4
#define IHC_LOCAL_H0_REMOTE_H4 0x50000300
#endif

#ifndef IHCIA_LOCAL_H0
#define IHCIA_LOCAL_H0 0x50000400
#endif

/************** My Hart 1 ************/

#ifndef IHC_LOCAL_H1_REMOTE_H0
#define IHC_LOCAL_H1_REMOTE_H0 0x50000500
#endif

#ifndef IHC_LOCAL_H1_REMOTE_H2
#define IHC_LOCAL_H1_REMOTE_H2 0x50000600
#endif

#ifndef IHC_LOCAL_H1_REMOTE_H3
#define IHC_LOCAL_H1_REMOTE_H3 0x50000700
#endif

#ifndef IHC_LOCAL_H1_REMOTE_H4
#define IHC_LOCAL_H1_REMOTE_H4 0x50000800
#endif

#ifndef IHCIA_LOCAL_H1
#define IHCIA_LOCAL_H1 0x50000900
#endif

/************** My Hart 2 ************/

#ifndef IHC_LOCAL_H2_REMOTE_H0
#define IHC_LOCAL_H2_REMOTE_H0 0x50000A00
#endif

#ifndef IHC_LOCAL_H2_REMOTE_H1
#define IHC_LOCAL_H2_REMOTE_H1 0x50000B00
#endif

#ifndef IHC_LOCAL_H2_REMOTE_H3
#define IHC_LOCAL_H2_REMOTE_H3 0x50000C00
#endif

#ifndef IHC_LOCAL_H2_REMOTE_H4
#define IHC_LOCAL_H2_REMOTE_H4 0x50000D00
#endif

#ifndef IHCIA_LOCAL_H2
#define IHCIA_LOCAL_H2 0x50000E00
#endif

/************** My Hart 3 ************/

#ifndef IHC_LOCAL_H3_REMOTE_H0
#define IHC_LOCAL_H3_REMOTE_H0 0x50000F00
#endif

#ifndef IHC_LOCAL_H3_REMOTE_H1
#define IHC_LOCAL_H3_REMOTE_H1 0x50001000
#endif

#ifndef IHC_LOCAL_H3_REMOTE_H2
#define IHC_LOCAL_H3_REMOTE_H2 0x50001100
#endif

#ifndef IHC_LOCAL_H3_REMOTE_H4
#define IHC_LOCAL_H3_REMOTE_H4 0x50001200
#endif

#ifndef IHCIA_LOCAL_H3
#define IHCIA_LOCAL_H3 0x50001300
#endif

/************** My Hart 4 ************/

#ifndef IHC_LOCAL_H4_REMOTE_H0
#define IHC_LOCAL_H4_REMOTE_H0 0x50001400
#endif

#ifndef IHC_LOCAL_H4_REMOTE_H1
#define IHC_LOCAL_H4_REMOTE_H1 0x50001500
#endif

#ifndef IHC_LOCAL_H4_REMOTE_H2
#define IHC_LOCAL_H4_REMOTE_H2 0x50001600
#endif

#ifndef IHC_LOCAL_H4_REMOTE_H3
#define IHC_LOCAL_H4_REMOTE_H3 0x50001700
#endif

#ifndef IHCIA_LOCAL_H4
#define IHCIA_LOCAL_H4 0x50001800
#endif

/*------------------------------------------------------------------------------
* choose the interrupt mapping used in our system
* Please see miv_ihc_regs.h for the defaults
*/
#define IHCIA_hart0_IRQHandler fabric_f2h_63_plic_IRQHandler
#define IHCIA_hart1_IRQHandler fabric_f2h_62_plic_IRQHandler
#define IHCIA_hart2_IRQHandler fabric_f2h_61_plic_IRQHandler
#define IHCIA_hart3_IRQHandler fabric_f2h_60_plic_IRQHandler
#define IHCIA_hart4_IRQHandler fabric_f2h_59_plic_IRQHandler

#define IHCIA_hart0_INT FABRIC_F2H_63_PLIC
#define IHCIA_hart1_INT FABRIC_F2H_62_PLIC
#define IHCIA_hart2_INT FABRIC_F2H_61_PLIC
#define IHCIA_hart3_INT FABRIC_F2H_60_PLIC
#define IHCIA_hart4_INT FABRIC_F2H_59_PLIC

#endif /* MIV_IHC_ADD_MAPPING_H_ */
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
/*******************************************************************************
* Copyright 2019-2021 Microchip FPGA Embedded Systems Solutions.
*
* SPDX-License-Identifier: MIT
*
* MPFS HAL Embedded Software
*
*/

/*========================================================================*//**
@mainpage Configuration for the MiV-IhC driver
@section intro_sec Introduction
Used to configure the driver
@section
*//*==========================================================================*/


#ifndef MIV_IHC_CONFIG_H_
#define MIV_IHC_CONFIG_H_

#include "miv_ihc_add_mapping.h"

/*------------------------------------------------------------------------------
* define the monitor hart (HSS hart) used in our system
*/
#define HSS_HART_MASK HART0_MASK
#define HSS_HART_ID HART0_ID

/*------------------------------------------------------------------------------
* HSS_REMOTE_HARTS_MASK
* This is used to define the harts the HSS is communicating with
*/
#define HSS_REMOTE_HARTS_MASK (HART1_MASK | HART2_MASK |HART3_MASK | HART4_MASK)

/*------------------------------------------------------------------------------
* Define which harts are connected via comms channels to a particular hart
* user defined
*/
#define IHCIA_H0_REMOTE_HARTS (HSS_REMOTE_HARTS_MASK) /* connected to all harts */
#define IHCIA_H1_REMOTE_HARTS (HSS_HART_MASK | HART4_MASK) /* HSS and Context B connected */
#define IHCIA_H2_REMOTE_HARTS (HSS_HART_MASK)
#define IHCIA_H3_REMOTE_HARTS (HSS_HART_MASK)
#define IHCIA_H4_REMOTE_HARTS (HSS_HART_MASK | HART1_MASK) /* HSS and Context A connected */

/*------------------------------------------------------------------------------
* interrupts enabled in this system design for a particular hart
* User defined
*/
#define IHCIA_H0_REMOTE_HARTS_INTS HSS_HART_DEFAULT_INT_EN /* connected to all harts */
#define IHCIA_H1_REMOTE_HARTS_INTS (HSS_HART_MP_INT_EN | HSS_HART_ACK_INT_EN | HART4_MP_INT_EN | HART4_ACK_INT_EN) /* HSS and Context B connected */
#define IHCIA_H2_REMOTE_HARTS_INTS (HSS_HART_MP_INT_EN | HSS_HART_ACK_INT_EN)
#define IHCIA_H3_REMOTE_HARTS_INTS (HSS_HART_MP_INT_EN | HSS_HART_ACK_INT_EN)
#define IHCIA_H4_REMOTE_HARTS_INTS (HSS_HART_MP_INT_EN | HSS_HART_ACK_INT_EN | HART1_MP_INT_EN | HART1_ACK_INT_EN) /* HSS and Context A connected */

#endif /* MIV_IHC_CONFIG_H_ */

Loading

0 comments on commit 6b218e2

Please sign in to comment.