Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
DIOT Zynq Ultrascale-based System Board
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
8
Issues
8
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Projects
DIOT Zynq Ultrascale-based System Board
Commits
5e334670
Commit
5e334670
authored
Jul 20, 2021
by
Adam Wujek
Committed by
Adam Wujek
Aug 02, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sw/petalinux/fsbl: clear pin 29 (TX_DISABLE for SFP)
Signed-off-by:
Adam Wujek
<
dev_public@wujek.eu
>
parent
0d2f3033
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
92 additions
and
0 deletions
+92
-0
0001-clear-TX_DISABLE-for-SFP-gpio-29.patch
...sp/fsbl/files/0001-clear-TX_DISABLE-for-SFP-gpio-29.patch
+83
-0
fsbl_%.bbappend
...x/project-spec/meta-user/recipes-bsp/fsbl/fsbl_%.bbappend
+9
-0
No files found.
sw/petalinux/project-spec/meta-user/recipes-bsp/fsbl/files/0001-clear-TX_DISABLE-for-SFP-gpio-29.patch
0 → 100644
View file @
5e334670
From 25dff62774a9d7e29a69cd7e302c417c5e7935e1 Mon Sep 17 00:00:00 2001
From: Adam Wujek <dev_public@wujek.eu>
Date: Wed, 21 Jul 2021 00:02:44 +0200
Subject: [PATCH] clear TX_DISABLE for SFP (gpio 29)
Signed-off-by: Adam Wujek <dev_public@wujek.eu>
---
lib/sw_apps/zynqmp_fsbl/src/xfsbl_board.c | 42 +++++++++++++++++++++++
lib/sw_apps/zynqmp_fsbl/src/xfsbl_board.h | 1 +
2 files changed, 43 insertions(+)
diff --git a/lib/sw_apps/zynqmp_fsbl/src/xfsbl_board.c b/lib/sw_apps/zynqmp_fsbl/src/xfsbl_board.c
index 910139cca..cfcf366b3 100644
--- a/lib/sw_apps/zynqmp_fsbl/src/xfsbl_board.c
+++ b/lib/sw_apps/zynqmp_fsbl/src/xfsbl_board.c
@@ -763,6 +763,47 @@ static void XFsbl_PcieReset(void)
}
#endif
#endif
+
+/*
+ * gpio_init
+ *
+ * Lower GPIO pin 29. This enables SFP (clears TX_DISABLE)
+ */
+void gpio_myplatform_init()
+{
+ uint32_t *gpio_base = (uint32_t *)(0xFF0A0000);
+ uint32_t bank = 1;
+ uint32_t *gpio_mask = (uint32_t *)(GPIO_BASEADDR + 8 * bank);
+ uint32_t *gpio_data = (uint32_t *)(GPIO_BASEADDR + 0x40 + 4 * bank);
+ uint32_t *gpio_dirm = (uint32_t *)(GPIO_BASEADDR + 0x204 + 0x40 * bank);
+ uint32_t *gpio_oen = (uint32_t *)(GPIO_BASEADDR + 0x208 + 0x40 * bank);
+ uint32_t *gpio_data_ro = (uint32_t *)(GPIO_BASEADDR + 0x60 + 4 * bank);
+ uint32_t tmp_data;
+
+ XFsbl_Printf(DEBUG_PRINT_ALWAYS,
+ "Clear gpio 29 (clear TX_DISABLE for SFP).\n\r");
+
+ /* Read the register and print it out for debugging */
+ tmp_data = *gpio_data_ro;
+ XFsbl_Printf(DEBUG_GENERAL,
+ "%s: Before: gpio%d = 0x%08p, dirm = 0x%08p, "
+ "oen = 0x%08p\r\n",
+ __FUNCTION__, bank, tmp_data, *gpio_dirm, *gpio_oen);
+
+ *gpio_dirm |= 1 << 3;
+ *gpio_oen |= 1 << 3;
+ *gpio_mask |= 1 << 3;
+
+ *gpio_data &= ~(1 << 3);
+
+ /* Read the register and print it out for debugging */
+ tmp_data = *gpio_data_ro;
+ XFsbl_Printf(DEBUG_GENERAL,
+ "%s: After: gpio%d = 0x%08p, dirm = 0x%08p, "
+ "oen = 0x%08p\r\n",
+ __FUNCTION__, bank, tmp_data, *gpio_dirm, *gpio_oen);
+}
+
/*****************************************************************************/
/**
* This function does board specific initialization.
@@ -779,6 +820,7 @@ static void XFsbl_PcieReset(void)
u32 XFsbl_BoardInit(void)
{
u32 Status;
+ gpio_myplatform_init();
#if defined(XPS_BOARD_ZCU102) || defined(XPS_BOARD_ZCU106) \
|| defined(XPS_BOARD_ZCU104) || defined(XPS_BOARD_ZCU111)
/* Program I2C to configure GT lanes */
diff --git a/lib/sw_apps/zynqmp_fsbl/src/xfsbl_board.h b/lib/sw_apps/zynqmp_fsbl/src/xfsbl_board.h
index 2cc6175fa..b94741ed9 100644
--- a/lib/sw_apps/zynqmp_fsbl/src/xfsbl_board.h
+++ b/lib/sw_apps/zynqmp_fsbl/src/xfsbl_board.h
@@ -196,6 +196,7 @@ typedef struct XVoutCommands {
/************************** Function Prototypes ******************************/
#endif
u32 XFsbl_BoardInit(void);
+void gpio_myplatform_init();
#ifdef __cplusplus
}
sw/petalinux/project-spec/meta-user/recipes-bsp/fsbl/fsbl_%.bbappend
0 → 100644
View file @
5e334670
#Force to use embeddedsw repo
EXTERNALXSCTSRC = ""
EXTERNALXSCTSRC_BUILD = ""
#Patch FSBL
FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
SRC_URI += "file://0001-clear-TX_DISABLE-for-SFP-gpio-29.patch"
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment