Skip to content

Commit

Permalink
examples: freertos: zynqmp_amp_demo: wrap demo symbols in #ifndef's
Browse files Browse the repository at this point in the history
Allow Shared memory, TTC and IPI values to be set dynamically. This will enable
the demos to be run on different platforms.

Signed-off-by: Ben Levinsky <ben.levinsky@amd.com>
  • Loading branch information
bentheredonethat committed May 30, 2023
1 parent 3a5a091 commit b85879a
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
8 changes: 6 additions & 2 deletions examples/system/freertos/zynqmp_r5/zynqmp_amp_demo/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,12 @@
#define IPI_IER_OFFSET 0x18 /* IPI interrupt enable reg offset */
#define IPI_IDR_OFFSET 0x1C /* IPI interrupt disable reg offset */

#define IPI_MASK 0x1000000 /* IPI mask for kick from APU.
We use PL0 IPI in this demo. */
#ifndef IPI_MASK
/*
* IPI mask for kick from APU. We use PL0 IPI in this demo.
*/
#define IPI_MASK 0x1000000
#endif

/* TTC counter offsets */
#define XTTCPS_CLK_CNTRL_OFFSET 0x0 /* TTC counter clock control reg offset */
Expand Down
10 changes: 10 additions & 0 deletions examples/system/freertos/zynqmp_r5/zynqmp_amp_demo/sys_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,21 @@

#define INTC_DEVICE_ID XPAR_SCUGIC_0_DEVICE_ID

#ifndef IPI_IRQ_VECT_ID
#define IPI_IRQ_VECT_ID 65
#endif

#ifndef SHM_BASE_ADDR
#define SHM_BASE_ADDR 0x3ED80000
#endif

#ifndef TTC0_BASE_ADDR
#define TTC0_BASE_ADDR 0xFF110000
#endif

#ifndef IPI_BASE_ADDR
#define IPI_BASE_ADDR 0xFF310000
#endif

/* Default generic I/O region page shift */
/* Each I/O region can contain multiple pages.
Expand Down

0 comments on commit b85879a

Please sign in to comment.