Xilinx changes for v2021.07-rc2

xilinx:
- Enable saving variables based on bootmode
- Cleanup usb dfu setup and wire it up with usb bootmode
- Fix bootscript address logic
- Remove GD references (spi, Versal)
- Enable capsule update

clk:
- Small Kconfig fix

net:
- Fix gmii2rgmii bridge binding

usb:
- Propagate error (dfu gadget)
This commit is contained in:
Tom Rini
2021-04-29 11:31:06 -04:00
19 changed files with 189 additions and 95 deletions

View File

@@ -378,14 +378,12 @@ int board_late_init_xilinx(void)
int i, id, macid = 0;
struct xilinx_board_description *desc;
phys_size_t bootm_size = gd->ram_size;
struct bd_info *bd = gd->bd;
if (!CONFIG_IS_ENABLED(MICROBLAZE) && bd->bi_dram[0].start) {
if (!CONFIG_IS_ENABLED(MICROBLAZE)) {
ulong scriptaddr;
scriptaddr = env_get_hex("scriptaddr", 0);
ret |= env_set_hex("scriptaddr",
bd->bi_dram[0].start + scriptaddr);
ret |= env_set_hex("scriptaddr", gd->ram_base + scriptaddr);
}
if (CONFIG_IS_ENABLED(ARCH_ZYNQ) || CONFIG_IS_ENABLED(MICROBLAZE))

View File

@@ -9,6 +9,7 @@
#include <env.h>
#include <fdtdec.h>
#include <init.h>
#include <env_internal.h>
#include <log.h>
#include <malloc.h>
#include <time.h>
@@ -129,7 +130,7 @@ int board_late_init(void)
switch (bootmode) {
case USB_MODE:
puts("USB_MODE\n");
mode = "dfu_usb";
mode = "usb_dfu0 usb_dfu1";
break;
case JTAG_MODE:
puts("JTAG_MODE\n");
@@ -245,3 +246,32 @@ int dram_init(void)
void reset_cpu(void)
{
}
enum env_location env_get_location(enum env_operation op, int prio)
{
u32 bootmode = versal_get_bootmode();
if (prio)
return ENVL_UNKNOWN;
switch (bootmode) {
case EMMC_MODE:
case SD_MODE:
case SD1_LSHFT_MODE:
case SD_MODE1:
if (IS_ENABLED(CONFIG_ENV_IS_IN_FAT))
return ENVL_FAT;
if (IS_ENABLED(CONFIG_ENV_IS_IN_EXT4))
return ENVL_EXT4;
return ENVL_UNKNOWN;
case OSPI_MODE:
case QSPI_MODE_24BIT:
case QSPI_MODE_32BIT:
if (IS_ENABLED(CONFIG_ENV_IS_IN_SPI_FLASH))
return ENVL_SPI_FLASH;
return ENVL_UNKNOWN;
case JTAG_MODE:
default:
return ENVL_NOWHERE;
}
}

View File

@@ -9,6 +9,7 @@
#include <log.h>
#include <dm/uclass.h>
#include <env.h>
#include <env_internal.h>
#include <fdtdec.h>
#include <fpga.h>
#include <malloc.h>
@@ -119,3 +120,34 @@ int dram_init(void)
return 0;
}
#endif
enum env_location env_get_location(enum env_operation op, int prio)
{
u32 bootmode = zynq_slcr_get_boot_mode() & ZYNQ_BM_MASK;
if (prio)
return ENVL_UNKNOWN;
switch (bootmode) {
case ZYNQ_BM_SD:
if (IS_ENABLED(CONFIG_ENV_IS_IN_FAT))
return ENVL_FAT;
if (IS_ENABLED(CONFIG_ENV_IS_IN_EXT4))
return ENVL_EXT4;
return ENVL_UNKNOWN;
case ZYNQ_BM_NAND:
if (IS_ENABLED(CONFIG_ENV_IS_IN_NAND))
return ENVL_NAND;
if (IS_ENABLED(CONFIG_ENV_IS_IN_UBI))
return ENVL_UBI;
return ENVL_UNKNOWN;
case ZYNQ_BM_NOR:
case ZYNQ_BM_QSPI:
if (IS_ENABLED(CONFIG_ENV_IS_IN_SPI_FLASH))
return ENVL_SPI_FLASH;
return ENVL_UNKNOWN;
case ZYNQ_BM_JTAG:
default:
return ENVL_NOWHERE;
}
}

View File

@@ -571,7 +571,7 @@ int board_late_init(void)
switch (bootmode) {
case USB_MODE:
puts("USB_MODE\n");
mode = "usb";
mode = "usb_dfu0 usb_dfu1";
env_set("modeboot", "usb_dfu_spl");
break;
case JTAG_MODE: