Skip to content

Commit 1c1965c

Browse files
rajanv-xilinxMeena Paleti
authored andcommitted
sw_apps: versal_psmfw: Version less build support for PSMFW
This patch adds support for versionless build support for PSMFW for 2020.2 release. Signed-off-by: Rajan Vaja <[email protected]> Acked-by: Nicole Baze <[email protected]>
1 parent f977e1e commit 1c1965c

File tree

14 files changed

+1910
-0
lines changed

14 files changed

+1910
-0
lines changed
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# Makefile generated by Xilinx.
2+
3+
DRIVER_LIB_VERSION = 1.0
4+
PROCESSOR = psv_psm_0
5+
LIBRARIES = ${PROCESSOR}/lib/libxil.a
6+
BSP_MAKEFILES := $(wildcard $(PROCESSOR)/libsrc/*/src/Makefile)
7+
SUBDIRS := $(patsubst %/Makefile, %, $(BSP_MAKEFILES))
8+
BSP_PARALLEL_MAKEFILES := $(filter-out $(BSP_SEQUENTIAL_MAKEFILES),$(BSP_MAKEFILES))
9+
SEQ_SUBDIRS := $(patsubst %/Makefile, %, $(BSP_SEQUENTIAL_MAKEFILES))
10+
PAR_SUBDIRS := $(patsubst %/Makefile, %, $(BSP_PARALLEL_MAKEFILES))
11+
12+
ifneq (,$(findstring win,$(RDI_PLATFORM)))
13+
SHELL = CMD
14+
endif
15+
16+
all:
17+
$(MAKE) --no-print-directory seq_libs
18+
$(MAKE) -j --no-print-directory par_libs
19+
$(MAKE) --no-print-directory archive
20+
@echo 'Finished building libraries'
21+
22+
include: $(addsuffix /make.include,$(SUBDIRS))
23+
24+
seq_libs: $(addsuffix /make.libs,$(SEQ_SUBDIRS))
25+
@echo 'Finished building libraries sequentially.'
26+
27+
par_libs: $(addsuffix /make.libs,$(PAR_SUBDIRS))
28+
@echo 'Finished building libraries parallelly.'
29+
30+
archive:
31+
mb-ar -r $(LIBRARIES) $(wildcard $(PROCESSOR)/lib/*.o)
32+
33+
clean: $(addsuffix /make.clean,$(SUBDIRS))
34+
rm -f ${PROCESSOR}/lib/libxil.a
35+
36+
$(PROCESSOR)/lib/libxil.a: $(PROCESSOR)/lib/libxil_init.a
37+
cp -f $< $@
38+
39+
%/make.include: $(if $(wildcard $(PROCESSOR)/lib/libxil_init.a),$(PROCESSOR)/lib/libxil.a,)
40+
@echo "Running Make include in $(subst /make.include,,$@)"
41+
$(MAKE) -C $(subst /make.include,,$@) -s include "SHELL=$(SHELL)" "COMPILER=mb-gcc" "ASSEMBLER=mb-as" "ARCHIVER=mb-ar" "COMPILER_FLAGS= -O2 -c -mcpu=v -mlittle-endian -mxl-barrel-shift -mxl-pattern-compare" "EXTRA_COMPILER_FLAGS=-g -ffunction-sections -fdata-sections -Wall -Wextra"
42+
43+
%/make.libs: include
44+
@echo "Running Make libs in $(subst /make.libs,,$@)"
45+
$(MAKE) -C $(subst /make.libs,,$@) -s libs "SHELL=$(SHELL)" "COMPILER=mb-gcc" "ASSEMBLER=mb-as" "ARCHIVER=mb-ar" "COMPILER_FLAGS= -O2 -c -mcpu=v -mlittle-endian -mxl-barrel-shift -mxl-pattern-compare" "EXTRA_COMPILER_FLAGS=-g -ffunction-sections -fdata-sections -Wall -Wextra"
46+
47+
%/make.clean:
48+
$(MAKE) -C $(subst /make.clean,,$@) -s clean
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
Building Versal PSMFW from git:
2+
===============================
3+
4+
PSMFW(versal_psmfw) has 3 directories.
5+
1. data - It contains files for Vitis
6+
2. src - It contains the PSMFW source files
7+
3. misc - It contains miscellaneous files required to
8+
compile PSMFW.
9+
10+
How to compile Versal PSMFW:
11+
===============================
12+
1. Go to the PSMFW src directory "lib/sw_apps/versal_psmfw/src/"
13+
2. If executables and other artifacts from previous PSMFW build are present,
14+
run "make clean" to delete them.
15+
3. Give "make" to compile the PSMFW with BSP.
16+
4. This will create "psmfw.elf" in the PSMFW src directory.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
2+
/*******************************************************************
3+
*
4+
* CAUTION: This file is automatically generated by HSI.
5+
* Version:
6+
* DO NOT EDIT.
7+
*
8+
* Copyright (C) 2010-2020 Xilinx, Inc. All Rights Reserved.
9+
* SPDX-License-Identifier: MIT
10+
*
11+
* Description: Configurations for Standalone BSP
12+
*
13+
*******************************************************************/
14+
15+
#ifndef BSPCONFIG_H /* prevent circular inclusions */
16+
#define BSPCONFIG_H /* by using protection macros */
17+
18+
#define MICROBLAZE_PVR_NONE
19+
20+
#endif /*end of __BSPCONFIG_H_*/
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
LIBSOURCES = *.c *.S
2+
PROFILE_ARCH_OBJS = profile_mcount_mb.o
3+
LIBS = standalone_libs
Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
#!/bin/bash
2+
3+
# this script will copy the required bsp directories
4+
5+
# present working dir
6+
WORKING_DIR=../misc
7+
8+
#bsp dir where files will be copied
9+
BSP_DIR=$WORKING_DIR/versal_psmfw_bsp/psv_psm_0
10+
11+
#processor dir
12+
PROC_DIRNAME=cpu
13+
14+
# Embedded Sw dir relative path from versal_plm src
15+
EMBEDDED_SW_DIR=$WORKING_DIR/../../../..
16+
17+
# selection of drivers is based on the board selected
18+
DRIVERS_LIST="$WORKING_DIR/drivers.txt"
19+
20+
# drivers directory
21+
DRIVERS_DIR=$EMBEDDED_SW_DIR/XilinxProcessorIPLib/drivers
22+
23+
# standalone dir, source of standalone files
24+
STANDALONE_DIR=$EMBEDDED_SW_DIR/lib/bsp/standalone/src
25+
26+
# libraries dir
27+
SERVICES_DIR=$EMBEDDED_SW_DIR/lib/sw_services
28+
29+
# creation of BSP folders required
30+
if [ -d $BSP_DIR ]; then
31+
echo "BSP directory already exists"
32+
else
33+
mkdir -p $BSP_DIR/code
34+
mkdir -p $BSP_DIR/include
35+
mkdir -p $BSP_DIR/lib
36+
mkdir -p $BSP_DIR/libsrc
37+
fi
38+
39+
# create bsp standalone/src folder
40+
if [ -d $BSP_DIR/libsrc/standalone/src ]; then
41+
echo "Standalone directory already exists"
42+
else
43+
mkdir -p $BSP_DIR/libsrc/standalone/src
44+
fi
45+
46+
# copy bsp standalone code
47+
cp $STANDALONE_DIR/common/* $BSP_DIR/libsrc/standalone/src/
48+
cp $STANDALONE_DIR/microblaze/* $BSP_DIR/libsrc/standalone/src/
49+
cp -r $STANDALONE_DIR/profile $BSP_DIR/libsrc/standalone/src/
50+
cp $WORKING_DIR/bspconfig.h $BSP_DIR/libsrc/standalone/src/
51+
cp $WORKING_DIR/microblaze_interrupts_g.c $BSP_DIR/libsrc/standalone/src/
52+
cp $WORKING_DIR/bspconfig.h $BSP_DIR/include/
53+
cp $WORKING_DIR/Makefile $BSP_DIR/../
54+
55+
# copy the bsp drivers
56+
while read line
57+
do
58+
# copy driver code to bsp
59+
if [ -d $BSP_DIR/libsrc/$line/src ]; then
60+
echo "$line directory already exists"
61+
else
62+
mkdir -p $BSP_DIR/libsrc/$line
63+
fi
64+
cp -r $DRIVERS_DIR/$line/src $BSP_DIR/libsrc/$line
65+
#copy the driver include files
66+
cp -r $DRIVERS_DIR/$line/src/*.h $BSP_DIR/include/
67+
# copy all the HSM generated driver files DRIVER_g.c
68+
cp $WORKING_DIR/x"$line"_g.c $BSP_DIR/libsrc/$line/src/
69+
done < $DRIVERS_LIST
70+
71+
#copy the processor code.
72+
if [ -d $BSP_DIR/libsrc/$PROC_DIRNAME/src ]; then
73+
echo "$PROC_DIRNAME directory already exists"
74+
else
75+
mkdir -p $BSP_DIR/libsrc/$PROC_DIRNAME
76+
fi
77+
cp -r $DRIVERS_DIR/$PROC_DIRNAME/src $BSP_DIR/libsrc/$PROC_DIRNAME/src
78+
79+
#copy the xparameters.h
80+
cp $WORKING_DIR/xparameters*.h $BSP_DIR/include/
81+
82+
# other dependencies which are required
83+
cp $WORKING_DIR/config.make $BSP_DIR/libsrc/standalone/src/
84+
cp $STANDALONE_DIR/common/*.h $BSP_DIR/include/
85+
cp $STANDALONE_DIR/microblaze/*.h $BSP_DIR/include/
86+
87+
# no inbyte and outbyte present in standalone
88+
cp $WORKING_DIR/inbyte.c $WORKING_DIR/outbyte.c $BSP_DIR/libsrc/standalone/src/
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
iomodule
2+
ipipsu
3+
uartpsv
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#include "xparameters.h"
2+
#include "xuartpsv_hw.h"
3+
4+
#ifdef __cplusplus
5+
extern "C" {
6+
#endif
7+
char inbyte(void);
8+
#ifdef __cplusplus
9+
}
10+
#endif
11+
12+
char inbyte(void) {
13+
return XUartPsv_RecvByte(STDIN_BASEADDRESS);
14+
}
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
2+
/*******************************************************************
3+
*
4+
* CAUTION: This file is automatically generated by HSI.
5+
* Version:
6+
* DO NOT EDIT.
7+
*
8+
* Copyright (C) 2010-2020 Xilinx, Inc. All Rights Reserved.
9+
* SPDX-License-Identifier: MIT
10+
*
11+
* Description: Interrupt Handler Table for MicroBlaze Processor
12+
*
13+
*******************************************************************/
14+
15+
#include "microblaze_interrupts_i.h"
16+
#include "xparameters.h"
17+
18+
19+
extern void XNullHandler (void *);
20+
21+
/*
22+
* The interrupt handler table for microblaze processor
23+
*/
24+
25+
MB_InterruptVectorTableEntry MB_InterruptVectorTable[] =
26+
{
27+
{ XNullHandler,
28+
(void*) XNULL}
29+
};
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#include "xparameters.h"
2+
#include "xuartpsv_hw.h"
3+
4+
#ifdef __cplusplus
5+
extern "C" {
6+
#endif
7+
void outbyte(char c);
8+
9+
#ifdef __cplusplus
10+
}
11+
#endif
12+
13+
void outbyte(char c) {
14+
XUartPsv_SendByte(STDOUT_BASEADDRESS, c);
15+
}
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
2+
/*******************************************************************
3+
*
4+
* CAUTION: This file is automatically generated by HSI.
5+
* Version:
6+
* DO NOT EDIT.
7+
*
8+
* Copyright (C) 2010-2020 Xilinx, Inc. All Rights Reserved.
9+
* SPDX-License-Identifier: MIT
10+
*
11+
* Description: Driver configuration
12+
*
13+
*******************************************************************/
14+
15+
#include "xparameters.h"
16+
#include "xiomodule.h"
17+
18+
19+
20+
/*
21+
* The configuration table for devices
22+
*/
23+
24+
XIOModule_Config XIOModule_ConfigTable[] =
25+
{
26+
{
27+
XPAR_PSV_PSM_IOMODULE_0_DEVICE_ID,
28+
XPAR_PSV_PSM_IOMODULE_0_BASEADDR,
29+
XPAR_PSV_PSM_IOMODULE_0_IO_BASEADDR,
30+
XPAR_PSV_PSM_IOMODULE_0_INTC_HAS_FAST,
31+
XPAR_PSV_PSM_IOMODULE_0_INTC_BASE_VECTORS,
32+
XPAR_PSV_PSM_IOMODULE_0_INTC_ADDR_WIDTH ,
33+
((XPAR_PSV_PSM_IOMODULE_0_INTC_LEVEL_EDGE << 16) | 0x7FF),
34+
XIN_SVC_SGL_ISR_OPTION,
35+
XPAR_PSV_PSM_IOMODULE_0_FREQ,
36+
XPAR_PSV_PSM_IOMODULE_0_UART_BAUDRATE,
37+
{
38+
XPAR_PSV_PSM_IOMODULE_0_USE_PIT1,
39+
XPAR_PSV_PSM_IOMODULE_0_USE_PIT2,
40+
XPAR_PSV_PSM_IOMODULE_0_USE_PIT3,
41+
XPAR_PSV_PSM_IOMODULE_0_USE_PIT4,
42+
},
43+
{
44+
XPAR_PSV_PSM_IOMODULE_0_PIT1_SIZE,
45+
XPAR_PSV_PSM_IOMODULE_0_PIT2_SIZE,
46+
XPAR_PSV_PSM_IOMODULE_0_PIT3_SIZE,
47+
XPAR_PSV_PSM_IOMODULE_0_PIT4_SIZE,
48+
},
49+
{
50+
XPAR_PSV_PSM_IOMODULE_0_PIT1_EXPIRED_MASK,
51+
XPAR_PSV_PSM_IOMODULE_0_PIT2_EXPIRED_MASK,
52+
XPAR_PSV_PSM_IOMODULE_0_PIT3_EXPIRED_MASK,
53+
XPAR_PSV_PSM_IOMODULE_0_PIT4_EXPIRED_MASK,
54+
},
55+
{
56+
XPAR_PSV_PSM_IOMODULE_0_PIT1_PRESCALER,
57+
XPAR_PSV_PSM_IOMODULE_0_PIT2_PRESCALER,
58+
XPAR_PSV_PSM_IOMODULE_0_PIT3_PRESCALER,
59+
XPAR_PSV_PSM_IOMODULE_0_PIT4_PRESCALER,
60+
},
61+
{
62+
XPAR_PSV_PSM_IOMODULE_0_PIT1_READABLE,
63+
XPAR_PSV_PSM_IOMODULE_0_PIT2_READABLE,
64+
XPAR_PSV_PSM_IOMODULE_0_PIT3_READABLE,
65+
XPAR_PSV_PSM_IOMODULE_0_PIT4_READABLE,
66+
},
67+
{
68+
XPAR_PSV_PSM_IOMODULE_0_GPO1_INIT,
69+
XPAR_PSV_PSM_IOMODULE_0_GPO2_INIT,
70+
XPAR_PSV_PSM_IOMODULE_0_GPO3_INIT,
71+
XPAR_PSV_PSM_IOMODULE_0_GPO4_INIT,
72+
},
73+
{
74+
}
75+
76+
}
77+
};

0 commit comments

Comments
 (0)