Skip to content

Commit

Permalink
Merge tag 'xilinx-for-v2021.07-rc5' of https://source.denx.de/u-boot/…
Browse files Browse the repository at this point in the history
…custodians/u-boot-microblaze

Xilinx changes for v2021.07-rc5

zynqmp:
- Fix ANALOG_BUS value after powerup
- Disable EFI_CAPSULE_ON_DISK_EARLY

zynqmp-gqspi:
- Fix write issue
  • Loading branch information
trini committed Jun 11, 2021
2 parents cf066a2 + 6bb577d commit c4737cd
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 2 deletions.
5 changes: 5 additions & 0 deletions arch/arm/mach-zynqmp/include/mach/hardware.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@
#define ZYNQMP_CRL_APB_BOOT_PIN_CTRL_OUT_EN_SHIFT 0
#define ZYNQMP_CRL_APB_BOOT_PIN_CTRL_OUT_VAL_SHIFT 8

#define ZYNQMP_AMS_PS_SYSMON_BASEADDR 0XFFA50800
#define ZYNQMP_AMS_PS_SYSMON_ANALOG_BUS ((ZYNQMP_AMS_PS_SYSMON_BASEADDR) \
+ 0x00000114)
#define ZYNQMP_PS_SYSMON_ANALOG_BUS_VAL 0x00003210

#define PS_MODE0 BIT(0)
#define PS_MODE1 BIT(1)
#define PS_MODE2 BIT(2)
Expand Down
11 changes: 11 additions & 0 deletions board/xilinx/zynqmp/zynqmp.c
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,17 @@ int board_early_init_f(void)
if (ret)
return ret;

/*
* PS_SYSMON_ANALOG_BUS register determines mapping between SysMon
* supply sense channel to SysMon supply registers inside the IP.
* This register must be programmed to complete SysMon IP
* configuration. The default register configuration after
* power-up is incorrect. Hence, fix this by writing the
* correct value - 0x3210.
*/
writel(ZYNQMP_PS_SYSMON_ANALOG_BUS_VAL,
ZYNQMP_AMS_PS_SYSMON_ANALOG_BUS);

/* Delay is required for clocks to be propagated */
udelay(1000000);
#endif
Expand Down
1 change: 0 additions & 1 deletion configs/xilinx_zynqmp_virt_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,5 @@ CONFIG_OF_LIBFDT_OVERLAY=y
CONFIG_EFI_SET_TIME=y
CONFIG_EFI_RUNTIME_UPDATE_CAPSULE=y
CONFIG_EFI_CAPSULE_ON_DISK=y
CONFIG_EFI_CAPSULE_ON_DISK_EARLY=y
CONFIG_EFI_CAPSULE_FIRMWARE_FIT=y
CONFIG_EFI_CAPSULE_FIRMWARE_RAW=y
18 changes: 17 additions & 1 deletion drivers/spi/zynqmp_gqspi.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
#define GQSPI_IXR_TXFULL_MASK 0x00000008 /* QSPI TX FIFO is full */
#define GQSPI_IXR_RXNEMTY_MASK 0x00000010 /* QSPI RX FIFO Not Empty */
#define GQSPI_IXR_GFEMTY_MASK 0x00000080 /* QSPI Generic FIFO Empty */
#define GQSPI_IXR_GFNFULL_MASK 0x00000200 /* QSPI GENFIFO not full */
#define GQSPI_IXR_ALL_MASK (GQSPI_IXR_TXNFULL_MASK | \
GQSPI_IXR_RXNEMTY_MASK)

Expand Down Expand Up @@ -238,9 +239,21 @@ static void zynqmp_qspi_fill_gen_fifo(struct zynqmp_qspi_priv *priv,
u32 gqspi_fifo_reg)
{
struct zynqmp_qspi_regs *regs = priv->regs;
u32 config_reg, ier;
int ret = 0;

ret = wait_for_bit_le32(&regs->isr, GQSPI_IXR_GFEMTY_MASK, 1,
config_reg = readl(&regs->confr);
/* Manual start if needed */
config_reg |= GQSPI_STRT_GEN_FIFO;
writel(config_reg, &regs->confr);

/* Enable interrupts */
ier = readl(&regs->ier);
ier |= GQSPI_IXR_GFNFULL_MASK;
writel(ier, &regs->ier);

/* Wait until the fifo is not full to write the new command */
ret = wait_for_bit_le32(&regs->isr, GQSPI_IXR_GFNFULL_MASK, 1,
GQSPI_TIMEOUT, 1);
if (ret)
printf("%s Timeout\n", __func__);
Expand All @@ -263,6 +276,9 @@ static void zynqmp_qspi_chipselect(struct zynqmp_qspi_priv *priv, int is_on)

debug("GFIFO_CMD_CS: 0x%x\n", gqspi_fifo_reg);

/* Dummy generic FIFO entry */
zynqmp_qspi_fill_gen_fifo(priv, 0);

zynqmp_qspi_fill_gen_fifo(priv, gqspi_fifo_reg);
}

Expand Down

0 comments on commit c4737cd

Please sign in to comment.