diff options
| author | Tom Rini <[email protected]> | 2022-11-22 12:33:48 -0500 |
|---|---|---|
| committer | Tom Rini <[email protected]> | 2022-11-22 12:33:48 -0500 |
| commit | 521277ec15eb794229403ec24b8c00a4ff02b0b6 (patch) | |
| tree | 7eb2da32590f4c48bc9e2ef8cde5ae85c3d9e7bf /drivers/soc | |
| parent | 536c642ffef545b4b5b02d065a0c1de9785549d7 (diff) | |
| parent | 3655dd22a4c219d0ee69dc4a29e5553c1a1bb5d7 (diff) | |
Merge tag 'xilinx-for-v2023.01-rc3' of https://source.denx.de/u-boot/custodians/u-boot-microblaze
Xilinx changes for v2023.01-rc3
microblaze:
- Enable 32 bit addressing mode for SPIs
zynq:
- Minor DT fixes (PL clock enabling)
zynqmp:
- Disable watchdog by default
- Remove unused xlnx,eeprom chosen support
- Add missing symlink for vck190 SC revB
- Use mdio bus with ethernet-phy-id description
versal:
- Add mini qspi/ospi configuration
versal-net:
- Add soc driver
- Fix Kconfig entry for SOC
- Fix loading address location for MINI configuration
- Disable LMB for mini configuration
net:
- Fix ethernet-phy-id usage in the code
pinctrl:
- Revert high impedance/output enable support
timer:
- Fix timer relocation for Microblaze
- Fix timer wrap in 32bit Xilinx timer driver
Diffstat (limited to 'drivers/soc')
| -rw-r--r-- | drivers/soc/Kconfig | 8 | ||||
| -rw-r--r-- | drivers/soc/Makefile | 1 | ||||
| -rw-r--r-- | drivers/soc/soc_xilinx_versal_net.c | 78 |
3 files changed, 87 insertions, 0 deletions
diff --git a/drivers/soc/Kconfig b/drivers/soc/Kconfig index 292dc41b6fa..acf555baaec 100644 --- a/drivers/soc/Kconfig +++ b/drivers/soc/Kconfig @@ -32,6 +32,14 @@ config SOC_XILINX_VERSAL This allows other drivers to verify the SoC familiy & revision using matching SoC attributes. +config SOC_XILINX_VERSAL_NET + bool "Enable SoC Device ID driver for Xilinx Versal NET" + depends on SOC_DEVICE && ARCH_VERSAL_NET + help + Enable this option to select SoC device id driver for Xilinx Versal NET. + This allows other drivers to verify the SoC familiy & revision using + matching SoC attributes. + source "drivers/soc/ti/Kconfig" endmenu diff --git a/drivers/soc/Makefile b/drivers/soc/Makefile index 031fa7612f4..84385650d46 100644 --- a/drivers/soc/Makefile +++ b/drivers/soc/Makefile @@ -8,3 +8,4 @@ obj-$(CONFIG_SOC_DEVICE_TI_K3) += soc_ti_k3.o obj-$(CONFIG_SANDBOX) += soc_sandbox.o obj-$(CONFIG_SOC_XILINX_ZYNQMP) += soc_xilinx_zynqmp.o obj-$(CONFIG_SOC_XILINX_VERSAL) += soc_xilinx_versal.o +obj-$(CONFIG_SOC_XILINX_VERSAL_NET) += soc_xilinx_versal_net.o diff --git a/drivers/soc/soc_xilinx_versal_net.c b/drivers/soc/soc_xilinx_versal_net.c new file mode 100644 index 00000000000..146d068bb4a --- /dev/null +++ b/drivers/soc/soc_xilinx_versal_net.c @@ -0,0 +1,78 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Xilinx Versal NET SOC driver + * + * Copyright (C) 2022, Advanced Micro Devices, Inc. + */ + +#include <common.h> +#include <dm.h> +#include <soc.h> +#include <zynqmp_firmware.h> +#include <asm/io.h> +#include <asm/arch/hardware.h> + +#include <linux/bitfield.h> + +/* + * v1 -> 0x10 - ES1 + * v2 -> 0x20 - Production + */ +static const char versal_family[] = "Versal NET"; + +struct soc_xilinx_versal_net_priv { + const char *family; + char revision; +}; + +static int soc_xilinx_versal_net_get_family(struct udevice *dev, char *buf, int size) +{ + struct soc_xilinx_versal_net_priv *priv = dev_get_priv(dev); + + return snprintf(buf, size, "%s", priv->family); +} + +static int soc_xilinx_versal_net_get_revision(struct udevice *dev, char *buf, int size) +{ + struct soc_xilinx_versal_net_priv *priv = dev_get_priv(dev); + + return snprintf(buf, size, "v%d", priv->revision); +} + +static const struct soc_ops soc_xilinx_versal_net_ops = { + .get_family = soc_xilinx_versal_net_get_family, + .get_revision = soc_xilinx_versal_net_get_revision, +}; + +static int soc_xilinx_versal_net_probe(struct udevice *dev) +{ + struct soc_xilinx_versal_net_priv *priv = dev_get_priv(dev); + u32 ret_payload[PAYLOAD_ARG_CNT]; + int ret; + + priv->family = versal_family; + + if (IS_ENABLED(CONFIG_ZYNQMP_FIRMWARE)) { + ret = xilinx_pm_request(PM_GET_CHIPID, 0, 0, 0, 0, + ret_payload); + if (ret) + return ret; + } else { + ret_payload[2] = readl(PMC_TAP_VERSION); + if (!ret_payload[2]) + return -EINVAL; + } + + priv->revision = FIELD_GET(PS_VERSION_MASK, ret_payload[2]); + + return 0; +} + +U_BOOT_DRIVER(soc_xilinx_versal_net) = { + .name = "soc_xilinx_versal_net", + .id = UCLASS_SOC, + .ops = &soc_xilinx_versal_net_ops, + .probe = soc_xilinx_versal_net_probe, + .priv_auto = sizeof(struct soc_xilinx_versal_net_priv), + .flags = DM_FLAG_PRE_RELOC, +}; |
