mirror of
https://github.com/openwrt/openwrt.git
synced 2026-10-12 09:08:20 +04:00
uboot-zynq: bump to 2026.04
While at it, replace the SPI MAC address read patch with a rebased series from the Digilent u-boot repository. It should be noted that this feature is still not upstreamed. Refresh patches as required. As most of the zynq boards are merged into xilinx_zynq_virt, add UBOOT_CONFIG to the respective boards in the Makefile. Compile-tested: all Zynq boards Runtime-tested: Antminer S9 Signed-off-by: Zoltan HERPAI <wigyori@uid0.hu>
This commit is contained in:
1 parent
7f1eede1a8
commit
d51c611e71
10 files changed
+471
-153
No files matched your search
@@ -7,9 +7,8 @@
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_VERSION:=2019.07
|
||||
|
||||
PKG_HASH:=bff4fa77e8da17521c030ca4c5b947a056c1b1be4d3e6ee8637020b8d50251d0
|
||||
PKG_VERSION:=2026.04
|
||||
PKG_HASH:=ac7c04b8b7004923b00a4e5d6699c5df4d21233bac9fda690d8cfbc209fff2fd
|
||||
|
||||
include $(INCLUDE_DIR)/kernel.mk
|
||||
include $(INCLUDE_DIR)/u-boot.mk
|
||||
@@ -28,6 +27,7 @@ endef
|
||||
define U-Boot/zc702
|
||||
NAME:=Xilinx ZC702 Dev Board
|
||||
BUILD_DEVICES:=xlnx_zynq-zc702
|
||||
UBOOT_CONFIG:=xilinx_zynq_virt
|
||||
endef
|
||||
|
||||
define U-Boot/antminer-s9
|
||||
@@ -39,16 +39,19 @@ endef
|
||||
define U-Boot/zed
|
||||
NAME:=Avnet Digilent ZedBoard Dev Board
|
||||
BUILD_DEVICES:=avnet_zynq-zed
|
||||
UBOOT_CONFIG:=xilinx_zynq_virt
|
||||
endef
|
||||
|
||||
define U-Boot/zybo
|
||||
NAME:=Digilent Zybo Dev Board
|
||||
BUILD_DEVICES:=digilent_zynq-zybo
|
||||
UBOOT_CONFIG:=xilinx_zynq_virt
|
||||
endef
|
||||
|
||||
define U-Boot/zybo_z7
|
||||
NAME:=Digilent Zybo Z7 board
|
||||
BUILD_DEVICES:=digilent_zynq-zybo-z7
|
||||
UBOOT_CONFIG:=xilinx_zynq_virt
|
||||
endef
|
||||
|
||||
UBOOT_TARGETS := \
|
||||
|
||||
@@ -1,46 +0,0 @@
|
||||
From e33a814e772cdc36436c8c188d8c42d019fda639 Mon Sep 17 00:00:00 2001
|
||||
From: Dirk Mueller <dmueller@suse.com>
|
||||
Date: Tue, 14 Jan 2020 18:53:41 +0100
|
||||
Subject: [PATCH] scripts/dtc: Remove redundant YYLOC global declaration
|
||||
|
||||
gcc 10 will default to -fno-common, which causes this error at link
|
||||
time:
|
||||
|
||||
(.text+0x0): multiple definition of `yylloc'; dtc-lexer.lex.o (symbol from plugin):(.text+0x0): first defined here
|
||||
|
||||
This is because both dtc-lexer as well as dtc-parser define the same
|
||||
global symbol yyloc. Before with -fcommon those were merged into one
|
||||
defintion. The proper solution would be to to mark this as "extern",
|
||||
however that leads to:
|
||||
|
||||
dtc-lexer.l:26:16: error: redundant redeclaration of 'yylloc' [-Werror=redundant-decls]
|
||||
26 | extern YYLTYPE yylloc;
|
||||
| ^~~~~~
|
||||
In file included from dtc-lexer.l:24:
|
||||
dtc-parser.tab.h:127:16: note: previous declaration of 'yylloc' was here
|
||||
127 | extern YYLTYPE yylloc;
|
||||
| ^~~~~~
|
||||
cc1: all warnings being treated as errors
|
||||
|
||||
which means the declaration is completely redundant and can just be
|
||||
dropped.
|
||||
|
||||
Signed-off-by: Dirk Mueller <dmueller@suse.com>
|
||||
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
|
||||
[robh: cherry-pick from upstream]
|
||||
Cc: stable@vger.kernel.org
|
||||
Signed-off-by: Rob Herring <robh@kernel.org>
|
||||
---
|
||||
scripts/dtc/dtc-lexer.l | 1 -
|
||||
1 file changed, 1 deletion(-)
|
||||
|
||||
--- a/scripts/dtc/dtc-lexer.l
|
||||
+++ b/scripts/dtc/dtc-lexer.l
|
||||
@@ -38,7 +38,6 @@ LINECOMMENT "//".*\n
|
||||
#include "srcpos.h"
|
||||
#include "dtc-parser.tab.h"
|
||||
|
||||
-YYLTYPE yylloc;
|
||||
extern bool treesource_error;
|
||||
|
||||
/* CAUTION: this will stop working if we ever use yyless() or yyunput() */
|
||||
+50
@@ -0,0 +1,50 @@
|
||||
From a054c5d9082ebcb7b4db2ece543b1e52473d3cd1 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Ionel=20B=C4=83di=C8=99or?= <ionel.badisor@gmail.com>
|
||||
Date: Tue, 27 Feb 2024 23:32:04 +0200
|
||||
Subject: [PATCH 110/115] digilent: net: Add entry point for setting zynq_get
|
||||
MAC address from QSPI
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
To set zynq_gem mac address from qspi OTP or regular an entry
|
||||
point is needed
|
||||
|
||||
Signed-off-by: Ionel Bădișor <ionel.badisor@gmail.com>
|
||||
---
|
||||
drivers/net/zynq_gem.c | 17 +++++++++++++++++
|
||||
1 file changed, 17 insertions(+)
|
||||
|
||||
--- a/drivers/net/zynq_gem.c
|
||||
+++ b/drivers/net/zynq_gem.c
|
||||
@@ -316,6 +316,22 @@ static int phywrite(struct zynq_gem_priv
|
||||
ZYNQ_GEM_PHYMNTNC_OP_W_MASK, &data);
|
||||
}
|
||||
|
||||
+__weak int zynq_board_read_rom_ethaddr(unsigned char *ethaddr)
|
||||
+{
|
||||
+ return -ENOSYS;
|
||||
+}
|
||||
+
|
||||
+static int zynq_gem_read_rom_mac(struct udevice *dev)
|
||||
+{
|
||||
+ struct eth_pdata *pdata = dev_get_plat(dev);
|
||||
+
|
||||
+ if (!pdata)
|
||||
+ return -ENOSYS;
|
||||
+
|
||||
+ return zynq_board_read_rom_ethaddr(pdata->enetaddr);
|
||||
+}
|
||||
+
|
||||
+
|
||||
static int zynq_gem_setup_mac(struct udevice *dev)
|
||||
{
|
||||
u32 i, macaddrlow, macaddrhigh;
|
||||
@@ -1036,6 +1052,7 @@ static const struct eth_ops zynq_gem_ops
|
||||
.free_pkt = zynq_gem_free_pkt,
|
||||
.stop = zynq_gem_halt,
|
||||
.write_hwaddr = zynq_gem_setup_mac,
|
||||
+ .read_rom_hwaddr = zynq_gem_read_rom_mac,
|
||||
};
|
||||
|
||||
static int zynq_gem_of_to_plat(struct udevice *dev)
|
||||
-103
@@ -1,103 +0,0 @@
|
||||
From 67db0da72eb7ed87ebaaeb8a26891cb2cf916500 Mon Sep 17 00:00:00 2001
|
||||
From: Luis Araneda <luaraneda@gmail.com>
|
||||
Date: Sun, 21 Jul 2019 23:24:12 -0400
|
||||
Subject: [U-Boot] [PATCH] arm: zynq: read mac address from SPI flash memory
|
||||
|
||||
Implement a method for reading the MAC address from an
|
||||
SPI flash memory.
|
||||
In particular, this method is used by the Zybo Z7 board
|
||||
to read the MAC address from the OTP region in the SPI NOR
|
||||
memory
|
||||
|
||||
Signed-off-by: Luis Araneda <luaraneda@gmail.com>
|
||||
---
|
||||
As of 2019-08-18, this patch has not been accepted by upstream U-Boot.
|
||||
Keep this patch until an alternative is accepted by upstream.
|
||||
---
|
||||
board/xilinx/common/board.c | 28 ++++++++++++++++++++++++++++
|
||||
configs/zynq_zybo_z7_defconfig | 3 +++
|
||||
drivers/misc/Kconfig | 17 +++++++++++++++++
|
||||
3 files changed, 48 insertions(+)
|
||||
|
||||
--- a/board/xilinx/common/board.c
|
||||
+++ b/board/xilinx/common/board.c
|
||||
@@ -6,7 +6,10 @@
|
||||
|
||||
#include <common.h>
|
||||
#include <dm/uclass.h>
|
||||
+#include <dm/device.h>
|
||||
+#include <dm/device-internal.h>
|
||||
#include <i2c.h>
|
||||
+#include <spi_flash.h>
|
||||
|
||||
int zynq_board_read_rom_ethaddr(unsigned char *ethaddr)
|
||||
{
|
||||
@@ -34,5 +37,30 @@ int zynq_board_read_rom_ethaddr(unsigned
|
||||
debug("%s: I2C EEPROM MAC %pM\n", __func__, ethaddr);
|
||||
#endif
|
||||
|
||||
+#if defined(CONFIG_MAC_ADDR_IN_SPI_FLASH)
|
||||
+ struct spi_flash *flash;
|
||||
+ struct udevice *dev;
|
||||
+
|
||||
+ ret = spi_flash_probe_bus_cs(CONFIG_SF_DEFAULT_BUS,
|
||||
+ CONFIG_SF_DEFAULT_CS,
|
||||
+ 0, 0, &dev);
|
||||
+ if (ret) {
|
||||
+ printf("SPI(bus:%u cs:%u) probe failed\n",
|
||||
+ CONFIG_SF_DEFAULT_BUS,
|
||||
+ CONFIG_SF_DEFAULT_CS);
|
||||
+ return 0;
|
||||
+ }
|
||||
+
|
||||
+ flash = dev_get_uclass_priv(dev);
|
||||
+ flash->read_opcode = CONFIG_MAC_ADDR_SPI_FLASH_READ_CMD;
|
||||
+
|
||||
+ if (spi_flash_read_dm(dev,
|
||||
+ CONFIG_MAC_ADDR_SPI_FLASH_DATA_OFFSET,
|
||||
+ 6, ethaddr))
|
||||
+ printf("SPI MAC address read failed\n");
|
||||
+
|
||||
+ device_remove(dev, DM_REMOVE_NORMAL);
|
||||
+#endif
|
||||
+
|
||||
return ret;
|
||||
}
|
||||
--- a/configs/zynq_zybo_z7_defconfig
|
||||
+++ b/configs/zynq_zybo_z7_defconfig
|
||||
@@ -42,6 +42,9 @@ CONFIG_DFU_RAM=y
|
||||
CONFIG_FPGA_XILINX=y
|
||||
CONFIG_FPGA_ZYNQPL=y
|
||||
CONFIG_DM_GPIO=y
|
||||
+CONFIG_MAC_ADDR_IN_SPI_FLASH=y
|
||||
+CONFIG_MAC_ADDR_SPI_FLASH_READ_CMD=0x4b
|
||||
+CONFIG_MAC_ADDR_SPI_FLASH_DATA_OFFSET=0x20
|
||||
CONFIG_MMC_SDHCI=y
|
||||
CONFIG_MMC_SDHCI_ZYNQ=y
|
||||
CONFIG_SPI_FLASH=y
|
||||
--- a/drivers/misc/Kconfig
|
||||
+++ b/drivers/misc/Kconfig
|
||||
@@ -366,6 +366,23 @@ config SYS_I2C_EEPROM_ADDR_OVERFLOW
|
||||
|
||||
endif
|
||||
|
||||
+config MAC_ADDR_IN_SPI_FLASH
|
||||
+ bool "MAC address in SPI flash"
|
||||
+ help
|
||||
+ Read MAC address from an SPI flash memory
|
||||
+
|
||||
+if MAC_ADDR_IN_SPI_FLASH
|
||||
+
|
||||
+config MAC_ADDR_SPI_FLASH_READ_CMD
|
||||
+ hex "Read command for the SPI flash memory"
|
||||
+ default 0
|
||||
+
|
||||
+config MAC_ADDR_SPI_FLASH_DATA_OFFSET
|
||||
+ hex "Offset of MAC data in SPI flash memory"
|
||||
+ default 0
|
||||
+
|
||||
+endif
|
||||
+
|
||||
config GDSYS_RXAUI_CTRL
|
||||
bool "Enable gdsys RXAUI control driver"
|
||||
depends on MISC
|
||||
+97
@@ -0,0 +1,97 @@
|
||||
From 7c3fc243b9eb1ff5bea421b6d7923007f323b194 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Ionel=20B=C4=83di=C8=99or?= <ionel.badisor@gmail.com>
|
||||
Date: Thu, 29 Feb 2024 00:29:38 +0200
|
||||
Subject: [PATCH 111/115] digilent: net: Set QSPI read settings via Kconfig
|
||||
|
||||
ZYNQ_GEM_MAC_FROM_QSPI:
|
||||
Enable reading MAC address form QSPI flash
|
||||
|
||||
ZYNQ_GEM_MAC_IN_OTP:
|
||||
Read MAC address QSPI flash region to OTP if not set read
|
||||
form regular region
|
||||
|
||||
QSPI_IS_SM:
|
||||
Set SPI read operation code for Spansion Micron QSPI flash
|
||||
|
||||
QSPI_IS_WB:
|
||||
Set SPI read operation code for Winbond QSPI flash
|
||||
|
||||
ZYNQ_GEM_ETH_MAC_QSPI_OFFSET:
|
||||
Offset in QSPI flash (form bosh regular or OTP region)
|
||||
---
|
||||
arch/arm/mach-zynq/Kconfig | 1 +
|
||||
arch/arm/mach-zynqmp/Kconfig | 1 +
|
||||
board/digilent/Kconfig | 48 ++++++++++++++++++++++++++++++++++++
|
||||
3 files changed, 50 insertions(+)
|
||||
create mode 100644 board/digilent/Kconfig
|
||||
|
||||
--- a/arch/arm/mach-zynq/Kconfig
|
||||
+++ b/arch/arm/mach-zynq/Kconfig
|
||||
@@ -57,6 +57,7 @@ config ZYNQ_SDHCI_MAX_FREQ
|
||||
default 52000000
|
||||
|
||||
source "board/xilinx/Kconfig"
|
||||
+source "board/digilent/Kconfig"
|
||||
source "board/xilinx/zynq/Kconfig"
|
||||
source "board/BuR/zynq/Kconfig"
|
||||
|
||||
--- a/arch/arm/mach-zynqmp/Kconfig
|
||||
+++ b/arch/arm/mach-zynqmp/Kconfig
|
||||
@@ -213,5 +213,6 @@ config CMD_ZYNQMP
|
||||
BOOT.BIN using Xilinx bootgen tool.
|
||||
|
||||
source "board/xilinx/Kconfig"
|
||||
+source "board/digilent/Kconfig"
|
||||
|
||||
endif
|
||||
--- /dev/null
|
||||
+++ b/board/digilent/Kconfig
|
||||
@@ -0,0 +1,48 @@
|
||||
+# SPDX-License-Identifier: GPL-2.0
|
||||
+#
|
||||
+# Copyright (c) 2023, Ionel Bădișor <ionel.badisor@digilent.ro>
|
||||
+
|
||||
+
|
||||
+if ARCH_ZYNQ || ARCH_ZYNQMP
|
||||
+
|
||||
+config ZYNQ_GEM_MAC_FROM_QSPI
|
||||
+ bool "Read MAC address form QSPI"
|
||||
+ help
|
||||
+ Enable to read MAC address from mac
|
||||
+
|
||||
+ if ZYNQ_GEM_MAC_FROM_QSPI
|
||||
+
|
||||
+ config ZYNQ_GEM_MAC_IN_OTP
|
||||
+ bool "Read MAC address form QSPI OTP section"
|
||||
+ help
|
||||
+ Specify OTP section of QPSI for reading
|
||||
+ This requires custom read operation code to be set
|
||||
+ according to used IC.
|
||||
+
|
||||
+ if ZYNQ_GEM_MAC_IN_OTP
|
||||
+
|
||||
+ config QSPI_IS_SM
|
||||
+ bool "Read MAC address form Spansion Micron QSPI flash "
|
||||
+ help
|
||||
+ QSPI IC is Spanssion
|
||||
+
|
||||
+ config QSPI_IS_WB
|
||||
+ bool "Read MAC address form Winbond QSPI flash"
|
||||
+ depends on !QPSI_IS_SM
|
||||
+ help
|
||||
+ QSPI IC is Winbond
|
||||
+
|
||||
+ endif
|
||||
+
|
||||
+ config ZYNQ_GEM_ETH_MAC_QSPI_OFFSET
|
||||
+ hex "Ethernet mac offset in QSPI"
|
||||
+ #default 0x20 if QSPI_IS_SM
|
||||
+ #default 0x1000 if QSPI_IS_WB
|
||||
+ #default 0x1fff000 if genesyszu
|
||||
+ depends on DM_SPI
|
||||
+ help
|
||||
+ Set MAC offset for QSPI (regular or OTP address space)
|
||||
+
|
||||
+ endif
|
||||
+
|
||||
+endif
|
||||
+142
@@ -0,0 +1,142 @@
|
||||
From 91a2231d2d2de6f721918d6c336683c1ce9bd698 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Ionel=20B=C4=83di=C8=99or?= <ionel.badisor@gmail.com>
|
||||
Date: Thu, 29 Feb 2024 13:12:34 +0200
|
||||
Subject: [PATCH 112/115] digilent: net: Set MAC address from QPSI flash
|
||||
|
||||
---
|
||||
board/digilent/common/eth_mac_from_qspi.c | 113 ++++++++++++++++++++++
|
||||
board/xilinx/common/Makefile | 3 +
|
||||
2 files changed, 116 insertions(+)
|
||||
create mode 100644 board/digilent/common/eth_mac_from_qspi.c
|
||||
|
||||
--- /dev/null
|
||||
+++ b/board/digilent/common/eth_mac_from_qspi.c
|
||||
@@ -0,0 +1,112 @@
|
||||
+
|
||||
+#define LOG_CATEGORY UCLASS_ETH
|
||||
+
|
||||
+#include <log.h>
|
||||
+#include <bootdev.h>
|
||||
+#include <dm/device.h>
|
||||
+#include <dm/uclass.h>
|
||||
+#include <linux/errno.h>
|
||||
+#include <i2c.h>
|
||||
+#include <net.h>
|
||||
+#include <spi.h>
|
||||
+#include <spi_flash.h>
|
||||
+
|
||||
+int zynq_board_read_rom_ethaddr(unsigned char *ethaddr)
|
||||
+{
|
||||
+ int ret = -EINVAL;
|
||||
+ u32 offset;
|
||||
+ struct spi_flash *flash;
|
||||
+ flash = spi_flash_probe(CONFIG_SF_DEFAULT_BUS, CONFIG_SF_DEFAULT_CS,
|
||||
+ CONFIG_SF_DEFAULT_SPEED, CONFIG_SF_DEFAULT_MODE);
|
||||
+
|
||||
+ if (!flash) {
|
||||
+ printf("no flash\n");
|
||||
+ printf("SPI(bus:%u cs:%u) probe failed\n", CONFIG_SF_DEFAULT_BUS,
|
||||
+ CONFIG_SF_DEFAULT_CS);
|
||||
+ return 0;
|
||||
+ }
|
||||
+
|
||||
+#if defined(ZYNQ_GEM_MAC_IN_OTP)
|
||||
+
|
||||
+ NOT VERIFIED
|
||||
+ // use #include "../../../drivers/mtd/spi/sf_internal.h" to access
|
||||
+ // flash->id
|
||||
+
|
||||
+ // or try to match flash->name instead of flash->info-> id??
|
||||
+ printf("%s: Flash Device name: %s\n", __func__, flash->name);
|
||||
+
|
||||
+ printf("%s: Flash Device ID: %02Xh %02Xh %02Xh\n", __func__,
|
||||
+ flash->info->id[0], flash->info->id[1], flash->info->id[2]);
|
||||
+
|
||||
+#define ID_S25FL128S 0x012018
|
||||
+#define ID_MT25QL128ABA_N25Q128A 0x20BA18
|
||||
+#define ID_W25Q128JV 0xEF7018
|
||||
+
|
||||
+#define CMD_OTP_SPANSION_MICRON_READ_ARRAY_FAST 0x4b
|
||||
+#define CMD_OTP_WINBOND_READ_ARRAY_FAST 0x48
|
||||
+
|
||||
+#define SPI_OTP_OFFSET_SPANSION_MICRON 0x20
|
||||
+#define SPI_OTP_OFFSET_WINBOND 0x1000
|
||||
+
|
||||
+ u32 id = ((u32)flash->info->id[0] << 16) | ((u32)flash->info->id[1] << 8) |
|
||||
+ (u32)flash->info->id[2];
|
||||
+ if (id == ID_S25FL128S) {
|
||||
+ debug("%s: SPI Flash Spansion identified. Reading SPI MAC address from "
|
||||
+ "OTP area\n",
|
||||
+ __func__);
|
||||
+ /*
|
||||
+ * Set the SPI MAC offset
|
||||
+ */
|
||||
+ offset =
|
||||
+ SPI_OTP_OFFSET_SPANSION_MICRON + CONFIG_ZYNQ_GEM_SPI_MAC_OFFSET;
|
||||
+ /*
|
||||
+ * Set the cmd to otp read
|
||||
+ */
|
||||
+ flash->read_opcode = CMD_OTP_SPANSION_MICRON_READ_ARRAY_FAST;
|
||||
+ } else if (id == ID_MT25QL128ABA_N25Q128A) {
|
||||
+ debug("%s: SPI Flash Micron identified. Reading SPI MAC address from "
|
||||
+ "OTP area\n",
|
||||
+ __func__);
|
||||
+ /*
|
||||
+ * Set the SPI MAC offset
|
||||
+ */
|
||||
+ offset =
|
||||
+ SPI_OTP_OFFSET_SPANSION_MICRON + CONFIG_ZYNQ_GEM_SPI_MAC_OFFSET;
|
||||
+ /*
|
||||
+ * Set the cmd to otp read
|
||||
+ */
|
||||
+ flash->read_opcode = CMD_OTP_SPANSION_MICRON_READ_ARRAY_FAST;
|
||||
+ } else if (id == ID_W25Q128JV) {
|
||||
+ debug("%s: SPI Flash Winbond identified. Reading SPI MAC address from "
|
||||
+ "OTP area\n",
|
||||
+ __func__);
|
||||
+ /*
|
||||
+ * Set the SPI MAC offset
|
||||
+ */
|
||||
+ offset = SPI_OTP_OFFSET_WINBOND + CONFIG_ZYNQ_GEM_SPI_MAC_OFFSET;
|
||||
+ /*
|
||||
+ * Set the cmd to otp read
|
||||
+ */
|
||||
+ flash->read_opcode = CMD_OTP_WINBOND_READ_ARRAY_FAST;
|
||||
+ } else {
|
||||
+ printf("%s: Reading SPI MAC address from OTP area is not supported on "
|
||||
+ "this flash\n",
|
||||
+ __func__);
|
||||
+ return -EINVAL;
|
||||
+ }
|
||||
+#else
|
||||
+ printf("%s: Reading SPI MAC address from offset %08lxh\n", __func__,
|
||||
+ CONFIG_ZYNQ_GEM_ETH_MAC_QSPI_OFFSET);
|
||||
+ /*
|
||||
+ * Set the SPI MAC offset
|
||||
+ */
|
||||
+ offset = CONFIG_ZYNQ_GEM_ETH_MAC_QSPI_OFFSET;
|
||||
+#endif
|
||||
+
|
||||
+ if ((ret = spi_flash_read(flash, offset, 6, ethaddr)))
|
||||
+ printf("%s:SPI MAC address read failed\n", __func__);
|
||||
+ else
|
||||
+ printf("%s: SPI ethaddr: %pM\n", __func__, ethaddr);
|
||||
+
|
||||
+ return ret;
|
||||
+}
|
||||
--- a/board/xilinx/common/Makefile
|
||||
+++ b/board/xilinx/common/Makefile
|
||||
@@ -4,6 +4,7 @@
|
||||
# Michal Simek <michal.simek@amd.com>
|
||||
#
|
||||
|
||||
+
|
||||
obj-y += board.o
|
||||
ifndef CONFIG_ARCH_ZYNQ
|
||||
obj-$(CONFIG_DISPLAY_CPUINFO) += cpu-info.o
|
||||
@@ -11,3 +12,5 @@ endif
|
||||
ifndef CONFIG_XPL_BUILD
|
||||
obj-$(CONFIG_CMD_FRU) += fru.o fru_ops.o
|
||||
endif
|
||||
+
|
||||
+obj-$(CONFIG_ZYNQ_GEM_MAC_FROM_QSPI) += ../../digilent/common/eth_mac_from_qspi.o
|
||||
+54
@@ -0,0 +1,54 @@
|
||||
From b679bae8cee44b076260d5f89b76f1f6b080d030 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Ionel=20B=C4=83di=C8=99or?= <ionel.badisor@gmail.com>
|
||||
Date: Tue, 5 Mar 2024 16:10:01 +0200
|
||||
Subject: [PATCH 113/115] digilent: net: Set Kconfig defaults for
|
||||
ZYNQ_GEM_MAC_QSPI_OFFSET
|
||||
|
||||
---
|
||||
board/digilent/Kconfig | 15 ++++++++-------
|
||||
1 file changed, 8 insertions(+), 7 deletions(-)
|
||||
|
||||
--- a/board/digilent/Kconfig
|
||||
+++ b/board/digilent/Kconfig
|
||||
@@ -7,6 +7,7 @@ if ARCH_ZYNQ || ARCH_ZYNQMP
|
||||
|
||||
config ZYNQ_GEM_MAC_FROM_QSPI
|
||||
bool "Read MAC address form QSPI"
|
||||
+ depends on DM_SPI
|
||||
help
|
||||
Enable to read MAC address from mac
|
||||
|
||||
@@ -15,7 +16,7 @@ config ZYNQ_GEM_MAC_FROM_QSPI
|
||||
config ZYNQ_GEM_MAC_IN_OTP
|
||||
bool "Read MAC address form QSPI OTP section"
|
||||
help
|
||||
- Specify OTP section of QPSI for reading
|
||||
+ Specify OTP section of QSPI for reading
|
||||
This requires custom read operation code to be set
|
||||
according to used IC.
|
||||
|
||||
@@ -28,18 +29,18 @@ config ZYNQ_GEM_MAC_FROM_QSPI
|
||||
|
||||
config QSPI_IS_WB
|
||||
bool "Read MAC address form Winbond QSPI flash"
|
||||
- depends on !QPSI_IS_SM
|
||||
+ depends on !QSPI_IS_SM
|
||||
help
|
||||
QSPI IC is Winbond
|
||||
|
||||
endif
|
||||
|
||||
- config ZYNQ_GEM_ETH_MAC_QSPI_OFFSET
|
||||
+ config ZYNQ_GEM_MAC_QSPI_OFFSET
|
||||
hex "Ethernet mac offset in QSPI"
|
||||
- #default 0x20 if QSPI_IS_SM
|
||||
- #default 0x1000 if QSPI_IS_WB
|
||||
- #default 0x1fff000 if genesyszu
|
||||
- depends on DM_SPI
|
||||
+ depends on ZYNQ_GEM_MAC_FROM_QSPI || ZYNQ_GEM_MAC_IN_OTP || QSPI_IS_SM || QSPI_IS_WB
|
||||
+ default 0x20 if ZYNQ_GEM_MAC_IN_OTP && QSPI_IS_SM && !QSPI_IS_WB
|
||||
+ default 0x1000 if ZYNQ_GEM_MAC_IN_OTP && !QSPI_IS_SM && QSPI_IS_WB
|
||||
+ default 0x0 if ZYNQ_GEM_MAC_FROM_QSPI && !ZYNQ_GEM_MAC_IN_OTP
|
||||
help
|
||||
Set MAC offset for QSPI (regular or OTP address space)
|
||||
|
||||
+114
@@ -0,0 +1,114 @@
|
||||
From b5462bb0714194d34e5395ad690ba7a91636cf11 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Ionel=20B=C4=83di=C8=99or?= <ionel.badisor@gmail.com>
|
||||
Date: Tue, 5 Mar 2024 17:14:22 +0200
|
||||
Subject: [PATCH 114/115] digilent: net: Read MAC address from OTP section of
|
||||
QSPI flash
|
||||
|
||||
---
|
||||
board/digilent/common/eth_mac_from_qspi.c | 86 ++++-------------------
|
||||
1 file changed, 15 insertions(+), 71 deletions(-)
|
||||
|
||||
--- a/board/digilent/common/eth_mac_from_qspi.c
|
||||
+++ b/board/digilent/common/eth_mac_from_qspi.c
|
||||
@@ -26,83 +26,27 @@ int zynq_board_read_rom_ethaddr(unsigned
|
||||
return 0;
|
||||
}
|
||||
|
||||
-#if defined(ZYNQ_GEM_MAC_IN_OTP)
|
||||
+ printf("%s: Flash Device name: %s\n", __func__, flash->name);
|
||||
|
||||
- NOT VERIFIED
|
||||
- // use #include "../../../drivers/mtd/spi/sf_internal.h" to access
|
||||
- // flash->id
|
||||
-
|
||||
- // or try to match flash->name instead of flash->info-> id??
|
||||
- printf("%s: Flash Device name: %s\n", __func__, flash->name);
|
||||
-
|
||||
- printf("%s: Flash Device ID: %02Xh %02Xh %02Xh\n", __func__,
|
||||
- flash->info->id[0], flash->info->id[1], flash->info->id[2]);
|
||||
-
|
||||
-#define ID_S25FL128S 0x012018
|
||||
-#define ID_MT25QL128ABA_N25Q128A 0x20BA18
|
||||
-#define ID_W25Q128JV 0xEF7018
|
||||
-
|
||||
-#define CMD_OTP_SPANSION_MICRON_READ_ARRAY_FAST 0x4b
|
||||
-#define CMD_OTP_WINBOND_READ_ARRAY_FAST 0x48
|
||||
-
|
||||
-#define SPI_OTP_OFFSET_SPANSION_MICRON 0x20
|
||||
-#define SPI_OTP_OFFSET_WINBOND 0x1000
|
||||
-
|
||||
- u32 id = ((u32)flash->info->id[0] << 16) | ((u32)flash->info->id[1] << 8) |
|
||||
- (u32)flash->info->id[2];
|
||||
- if (id == ID_S25FL128S) {
|
||||
- debug("%s: SPI Flash Spansion identified. Reading SPI MAC address from "
|
||||
- "OTP area\n",
|
||||
- __func__);
|
||||
- /*
|
||||
- * Set the SPI MAC offset
|
||||
- */
|
||||
- offset =
|
||||
- SPI_OTP_OFFSET_SPANSION_MICRON + CONFIG_ZYNQ_GEM_SPI_MAC_OFFSET;
|
||||
- /*
|
||||
- * Set the cmd to otp read
|
||||
- */
|
||||
- flash->read_opcode = CMD_OTP_SPANSION_MICRON_READ_ARRAY_FAST;
|
||||
- } else if (id == ID_MT25QL128ABA_N25Q128A) {
|
||||
- debug("%s: SPI Flash Micron identified. Reading SPI MAC address from "
|
||||
- "OTP area\n",
|
||||
- __func__);
|
||||
- /*
|
||||
- * Set the SPI MAC offset
|
||||
- */
|
||||
- offset =
|
||||
- SPI_OTP_OFFSET_SPANSION_MICRON + CONFIG_ZYNQ_GEM_SPI_MAC_OFFSET;
|
||||
- /*
|
||||
- * Set the cmd to otp read
|
||||
- */
|
||||
- flash->read_opcode = CMD_OTP_SPANSION_MICRON_READ_ARRAY_FAST;
|
||||
- } else if (id == ID_W25Q128JV) {
|
||||
- debug("%s: SPI Flash Winbond identified. Reading SPI MAC address from "
|
||||
- "OTP area\n",
|
||||
- __func__);
|
||||
- /*
|
||||
- * Set the SPI MAC offset
|
||||
- */
|
||||
- offset = SPI_OTP_OFFSET_WINBOND + CONFIG_ZYNQ_GEM_SPI_MAC_OFFSET;
|
||||
- /*
|
||||
- * Set the cmd to otp read
|
||||
- */
|
||||
- flash->read_opcode = CMD_OTP_WINBOND_READ_ARRAY_FAST;
|
||||
- } else {
|
||||
- printf("%s: Reading SPI MAC address from OTP area is not supported on "
|
||||
- "this flash\n",
|
||||
- __func__);
|
||||
- return -EINVAL;
|
||||
- }
|
||||
-#else
|
||||
- printf("%s: Reading SPI MAC address from offset %08lxh\n", __func__,
|
||||
- CONFIG_ZYNQ_GEM_ETH_MAC_QSPI_OFFSET);
|
||||
- /*
|
||||
- * Set the SPI MAC offset
|
||||
- */
|
||||
- offset = CONFIG_ZYNQ_GEM_ETH_MAC_QSPI_OFFSET;
|
||||
+#if defined (CONFIG_ZYNQ_GEM_MAC_IN_OTP)
|
||||
+
|
||||
+ #if defined (CONFIG_QSPI_IS_SM) // For Spansion and Micron OPCODE
|
||||
+ #define CMD_OTP_READ_ARRAY_FAST 0x4b
|
||||
+ #elif defined (CONFIG_QSPI_IS_WB) // For Winbond OPCODE
|
||||
+ #define CMD_OTP_READ_ARRAY_FAST 0x48
|
||||
+ #else
|
||||
+ #define CMD_OTP_READ_ARRAY_FAST "NOT IMPLEMENTED"
|
||||
+ #endif
|
||||
+
|
||||
+ //change read opcode only when OTP is used
|
||||
+ flash->read_opcode = CMD_OTP_READ_ARRAY_FAST;
|
||||
#endif
|
||||
|
||||
+ printf("%s: Reading SPI MAC address from offset %08lxh\n", __func__,
|
||||
+ CONFIG_ZYNQ_GEM_MAC_QSPI_OFFSET);
|
||||
+
|
||||
+ offset = CONFIG_ZYNQ_GEM_MAC_QSPI_OFFSET;
|
||||
+
|
||||
if ((ret = spi_flash_read(flash, offset, 6, ethaddr)))
|
||||
printf("%s:SPI MAC address read failed\n", __func__);
|
||||
else
|
||||
@@ -0,0 +1,7 @@
|
||||
--- a/configs/xilinx_zynq_virt_defconfig
|
||||
+++ b/configs/xilinx_zynq_virt_defconfig
|
||||
@@ -156,3 +156,4 @@ CONFIG_USB_GADGET_DOWNLOAD=y
|
||||
CONFIG_SYS_TIMER_COUNTS_DOWN=y
|
||||
CONFIG_MBEDTLS_LIB=y
|
||||
CONFIG_SPL_GZIP=y
|
||||
+CONFIG_ZYNQ_GEM_MAC_FROM_QSPI=y
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/include/configs/bitmain_antminer_s9.h
|
||||
+++ b/include/configs/bitmain_antminer_s9.h
|
||||
@@ -20,6 +20,34 @@
|
||||
@@ -17,6 +17,34 @@
|
||||
"initrd_high=0xefff000\0" \
|
||||
"devnum=0\0" \
|
||||
"wdstop=mw f8005000 ABC000\0" \
|
||||
|
||||
Reference in new issue
Block a user