AMD/Xilinx changes for v2025.01-rc3

microblaze:
 - Disable JFFS2
 
 fpga:
 - pass compatible flag to fpga_load()
 
 zynqmp:
 - SOM RTC fix
 - SC(system controller) PMW polarity fix
 - Fix ram_top calculation with introducing XILINX_MINI
 - Fix RPU release command
 
 versal:
 - Enable capsule update
 - Enable soft reset and Micron octal flashes
 
 xilinx:
 - Align Kconfig regarding SPI_STACKED_PARALLEL
 
 bootcount:
 - Add new zynqmp driver
 -----BEGIN PGP SIGNATURE-----
 
 iF0EABECAB0WIQQbPNTMvXmYlBPRwx7KSWXLKUoMIQUCZzyoqgAKCRDKSWXLKUoM
 IapRAJ43XGmKG7VAzbf/i39GUmCaSgMBswCfRsyWtnhaUFC9qo/WfZN2+C6QkEU=
 =1LxQ
 -----END PGP SIGNATURE-----

Merge tag 'xilinx-for-v2025.01-rc3-v2' of https://source.denx.de/u-boot/custodians/u-boot-microblaze

AMD/Xilinx changes for v2025.01-rc3:

- microblaze:
  - Disable JFFS2
- fpga:
  - pass compatible flag to fpga_load()
- zynqmp:
  - SOM RTC fix
  - SC(system controller) PMW polarity fix
  - Fix ram_top calculation with introducing XILINX_MINI
  - Fix RPU release command
- versal:
  - Enable capsule update
  - Enable soft reset and Micron octal flashes
- xilinx:
  - Align Kconfig regarding SPI_STACKED_PARALLEL
- bootcount:
  - Add new zynqmp driver
This commit is contained in:
Tom Rini 2024-11-19 12:58:05 -06:00
commit 7fe55182d9
43 changed files with 387 additions and 17 deletions

View File

@ -860,6 +860,7 @@ M: Michal Simek <michal.simek@amd.com>
S: Maintained
T: git https://source.denx.de/u-boot/custodians/u-boot-microblaze.git
F: arch/arm/mach-zynqmp/
F: drivers/bootcount/bootcount_zynqmp.c
F: drivers/clk/clk_zynqmp.c
F: driver/firmware/firmware-zynqmp.c
F: drivers/fpga/zynqpl.c

View File

@ -3,7 +3,7 @@
* dts file for Xilinx ZynqMP Generic System Controller
*
* (C) Copyright 2021 - 2022, Xilinx, Inc.
* (C) Copyright 2022 - 2023, Advanced Micro Devices, Inc.
* (C) Copyright 2022 - 2024, Advanced Micro Devices, Inc.
*
* Michal Simek <michal.simek@amd.com>
*/
@ -80,7 +80,7 @@
pwm-fan {
compatible = "pwm-fan";
status = "okay";
pwms = <&ttc0 2 40000 1>;
pwms = <&ttc0 2 40000 0>;
};
};

View File

@ -387,6 +387,7 @@
&rtc {
status = "okay";
calibration = <0x7fff>;
};
&lpd_dma_chan1 {

View File

@ -188,6 +188,8 @@ struct pmu_regs {
u32 gen_storage4; /* 0x40 */
u32 reserved1[1];
u32 gen_storage6; /* 0x48 */
u32 reserved2[3];
u32 pers_gen_storage2; /* 0x58 */
};
#define pmu_base ((struct pmu_regs *)ZYNQMP_PMU_BASEADDR)

View File

@ -352,7 +352,7 @@ int cpu_release(u32 nr, int argc, char *const argv[])
*/
flush_dcache_all();
if (!strncmp(argv[1], "lockstep", 8)) {
if (!strcmp(argv[1], "lockstep") || !strcmp(argv[1], "0")) {
if (nr != ZYNQMP_CORE_RPU0) {
printf("Lockstep mode should run on ZYNQMP_CORE_RPU0\n");
return 1;
@ -369,7 +369,7 @@ int cpu_release(u32 nr, int argc, char *const argv[])
dcache_enable();
set_r5_halt_mode(nr, RELEASE, LOCK);
mark_r5_used(nr, LOCK);
} else if (!strncmp(argv[1], "split", 5)) {
} else if (!strcmp(argv[1], "split") || !strcmp(argv[1], "1")) {
printf("R5 split mode\n");
set_r5_reset(nr, SPLIT);
set_r5_tcm_mode(SPLIT);

View File

@ -40,6 +40,15 @@ config XILINX_PS_INIT_FILE
endif
config XILINX_MINI
bool "Mini configuration"
depends on ARCH_ZYNQMP || ARCH_VERSAL || ARCH_VERSAL_NET || ARCH_VERSAL2
help
This option disables features which are not needed for Mini U-Boot
configurations. Mini U-Boot is running in EL3 mostly on size contrained
systems. It's purpose is to program non volatile memories or running
initial memory tests.
config XILINX_OF_BOARD_DTB_ADDR
hex "Default DTB pickup address"
default 0x1000 if ARCH_VERSAL || ARCH_VERSAL_NET || ARCH_VERSAL2

View File

@ -19,6 +19,7 @@
#include <i2c.h>
#include <linux/sizes.h>
#include <malloc.h>
#include <memtop.h>
#include <mtd_node.h>
#include "board.h"
#include <dm.h>
@ -676,3 +677,31 @@ int ft_board_setup(void *blob, struct bd_info *bd)
return 0;
}
#endif
#ifndef CONFIG_XILINX_MINI
#ifndef MMU_SECTION_SIZE
#define MMU_SECTION_SIZE (1 * 1024 * 1024)
#endif
phys_addr_t board_get_usable_ram_top(phys_size_t total_size)
{
phys_size_t size;
phys_addr_t reg;
if (!total_size)
return gd->ram_top;
if (!IS_ALIGNED((ulong)gd->fdt_blob, 0x8))
panic("Not 64bit aligned DT location: %p\n", gd->fdt_blob);
size = ALIGN(CONFIG_SYS_MALLOC_LEN + total_size, MMU_SECTION_SIZE);
reg = get_mem_top(gd->ram_base, gd->ram_size, size,
(void *)gd->fdt_blob);
if (!reg)
reg = gd->ram_top - size;
return reg + size;
}
#endif

View File

@ -12,12 +12,15 @@
#include <env_internal.h>
#include <log.h>
#include <malloc.h>
#include <memalign.h>
#include <mmc.h>
#include <time.h>
#include <asm/cache.h>
#include <asm/global_data.h>
#include <asm/io.h>
#include <asm/arch/hardware.h>
#include <asm/arch/sys_proto.h>
#include <linux/sizes.h>
#include <dm/device.h>
#include <dm/uclass.h>
#include <versalpl.h>
@ -301,9 +304,11 @@ int dram_init(void)
return 0;
}
#if !CONFIG_IS_ENABLED(SYSRESET)
void reset_cpu(void)
{
}
#endif
#if defined(CONFIG_ENV_IS_NOWHERE)
enum env_location env_get_location(enum env_operation op, int prio)
@ -336,3 +341,41 @@ enum env_location env_get_location(enum env_operation op, int prio)
}
}
#endif
#if defined(CONFIG_SET_DFU_ALT_INFO)
#define DFU_ALT_BUF_LEN SZ_1K
void set_dfu_alt_info(char *interface, char *devstr)
{
int bootseq = 0, len = 0;
u32 bootmode = versal_get_bootmode();
ALLOC_CACHE_ALIGN_BUFFER(char, buf, DFU_ALT_BUF_LEN);
if (env_get("dfu_alt_info"))
return;
memset(buf, 0, sizeof(buf));
switch (bootmode) {
case EMMC_MODE:
case SD_MODE:
case SD1_LSHFT_MODE:
case SD_MODE1:
bootseq = mmc_get_env_dev();
len += snprintf(buf + len, DFU_ALT_BUF_LEN, "mmc %d=boot",
bootseq);
len += snprintf(buf + len, DFU_ALT_BUF_LEN, ".bin fat %d 1",
bootseq);
break;
default:
return;
}
env_set("dfu_alt_info", buf);
puts("DFU alt info setting: done\n");
}
#endif

View File

@ -77,6 +77,7 @@ tpm_kv260=if test ${card1_rev} = A -o ${card1_rev} = B -o ${card1_rev} = Y -o ${
tpm_kd240=if test ${card1_rev} = A; then run tpm_reset; fi
board_setup=\
rtc dev 0; \
zynqmp mmio_write 0xFFCA0010 0xfff 0; \
if test ${card1_name} = SCK-KV-G; then run kv260_setup; run tpm_kv260; fi;\
if test ${card1_name} = SCK-KR-G; then run kr260_setup; run tpm_reset; fi;\

View File

@ -624,9 +624,10 @@ int boot_get_fpga(struct bootm_headers *images)
void *buf;
int conf_noffset;
int fit_img_result;
const char *uname, *name;
const char *uname, *name, *compatible;
int err;
int devnum = 0; /* TODO support multi fpga platforms */
int flags = 0;
if (!IS_ENABLED(CONFIG_FPGA))
return -ENOSYS;
@ -674,20 +675,29 @@ int boot_get_fpga(struct bootm_headers *images)
return fit_img_result;
}
conf_noffset = fit_image_get_node(buf, uname);
compatible = fdt_getprop(buf, conf_noffset, "compatible", NULL);
if (!compatible) {
printf("'fpga' image without 'compatible' property\n");
} else {
if (CONFIG_IS_ENABLED(FPGA_LOAD_SECURE))
flags = fpga_compatible2flag(devnum, compatible);
}
if (!fpga_is_partial_data(devnum, img_len)) {
name = "full";
err = fpga_loadbitstream(devnum, (char *)img_data,
img_len, BIT_FULL);
if (err)
err = fpga_load(devnum, (const void *)img_data,
img_len, BIT_FULL, 0);
img_len, BIT_FULL, flags);
} else {
name = "partial";
err = fpga_loadbitstream(devnum, (char *)img_data,
img_len, BIT_PARTIAL);
if (err)
err = fpga_load(devnum, (const void *)img_data,
img_len, BIT_PARTIAL, 0);
img_len, BIT_PARTIAL, flags);
}
if (err)

View File

@ -7,6 +7,7 @@
ifndef CONFIG_XPL_BUILD
obj-y += init/
obj-y += main.o
obj-y += memtop.o
obj-y += exports.o
obj-y += cli_getch.o cli_simple.o cli_readline.o
obj-$(CONFIG_HUSH_OLD_PARSER) += cli_hush.o

171
common/memtop.c Normal file
View File

@ -0,0 +1,171 @@
// SPDX-License-Identifier: GPL-2.0+
/*
* Copyright (c) 2024, Linaro Limited
*/
#include <fdt_support.h>
#include <fdtdec.h>
#include <memtop.h>
#include <asm/types.h>
#define MEM_RGN_COUNT 16
struct region {
phys_addr_t base;
phys_size_t size;
};
struct mem_region {
struct region rgn[MEM_RGN_COUNT];
uint count;
};
static void add_mem_region(struct mem_region *mem_rgn, phys_addr_t base,
phys_size_t size)
{
long i;
for (i = mem_rgn->count; i >= 0; i--) {
if (i && base < mem_rgn->rgn[i - 1].base) {
mem_rgn->rgn[i] = mem_rgn->rgn[i - 1];
} else {
mem_rgn->rgn[i].base = base;
mem_rgn->rgn[i].size = size;
break;
}
}
mem_rgn->count++;
}
static void mem_regions_init(struct mem_region *mem)
{
uint i;
mem->count = 0;
for (i = 0; i < MEM_RGN_COUNT; i++) {
mem->rgn[i].base = 0;
mem->rgn[i].size = 0;
}
}
static int fdt_add_reserved_regions(struct mem_region *free_mem,
struct mem_region *reserved_mem,
void *fdt_blob)
{
u64 addr, size;
int i, total, ret;
int nodeoffset, subnode;
struct fdt_resource res;
if (fdt_check_header(fdt_blob) != 0)
return -1;
/* process memreserve sections */
total = fdt_num_mem_rsv(fdt_blob);
assert_noisy(total < MEM_RGN_COUNT);
for (i = 0; i < total; i++) {
if (fdt_get_mem_rsv(fdt_blob, i, &addr, &size) != 0)
continue;
add_mem_region(reserved_mem, addr, size);
}
i = 0;
/* process reserved-memory */
nodeoffset = fdt_subnode_offset(fdt_blob, 0, "reserved-memory");
if (nodeoffset >= 0) {
subnode = fdt_first_subnode(fdt_blob, nodeoffset);
while (subnode >= 0) {
/* check if this subnode has a reg property */
ret = fdt_get_resource(fdt_blob, subnode, "reg", 0,
&res);
if (!ret && fdtdec_get_is_enabled(fdt_blob, subnode)) {
addr = res.start;
size = res.end - res.start + 1;
assert_noisy(i < MEM_RGN_COUNT);
add_mem_region(reserved_mem, addr, size);
}
subnode = fdt_next_subnode(fdt_blob, subnode);
++i;
}
}
return 0;
}
static long addrs_overlap(phys_addr_t base1, phys_size_t size1,
phys_addr_t base2, phys_size_t size2)
{
const phys_addr_t base1_end = base1 + size1 - 1;
const phys_addr_t base2_end = base2 + size2 - 1;
return ((base1 <= base2_end) && (base2 <= base1_end));
}
static long region_overlap_check(struct mem_region *mem_rgn, phys_addr_t base,
phys_size_t size)
{
unsigned long i;
struct region *rgn = mem_rgn->rgn;
for (i = 0; i < mem_rgn->count; i++) {
phys_addr_t rgnbase = rgn[i].base;
phys_size_t rgnsize = rgn[i].size;
if (addrs_overlap(base, size, rgnbase, rgnsize))
break;
}
return (i < mem_rgn->count) ? i : -1;
}
static int find_ram_top(struct mem_region *free_mem,
struct mem_region *reserved_mem, phys_size_t size)
{
long i, rgn;
phys_addr_t base = 0;
phys_addr_t res_base;
for (i = free_mem->count - 1; i >= 0; i--) {
phys_addr_t rgnbase = free_mem->rgn[i].base;
phys_size_t rgnsize = free_mem->rgn[i].size;
if (rgnsize < size)
continue;
base = rgnbase + rgnsize - size;
while (base && rgnbase <= base) {
rgn = region_overlap_check(reserved_mem, base, size);
if (rgn < 0)
return base;
res_base = reserved_mem->rgn[rgn].base;
if (res_base < size)
break;
base = res_base - size;
}
}
return 0;
}
phys_addr_t get_mem_top(phys_addr_t ram_start, phys_size_t ram_size,
phys_size_t size, void *fdt)
{
int i;
struct mem_region free_mem;
struct mem_region reserved_mem;
mem_regions_init(&free_mem);
mem_regions_init(&reserved_mem);
add_mem_region(&free_mem, ram_start, ram_size);
i = fdt_add_reserved_regions(&free_mem, &reserved_mem, fdt);
if (i < 0)
return 0;
return find_ram_top(&free_mem, &reserved_mem, size);
}

View File

@ -15,6 +15,7 @@ CONFIG_DEFAULT_DEVICE_TREE="amd-versal2-mini"
CONFIG_SYS_LOAD_ADDR=0xBBF80000
CONFIG_DEBUG_UART_BASE=0xf1920000
CONFIG_DEBUG_UART_CLOCK=100000000
CONFIG_XILINX_MINI=y
CONFIG_SYS_MEM_RSVD_FOR_MMU=y
# CONFIG_PSCI_RESET is not set
CONFIG_DEBUG_UART=y

View File

@ -12,6 +12,7 @@ CONFIG_DEFAULT_DEVICE_TREE="amd-versal2-mini"
CONFIG_SYS_LOAD_ADDR=0x8000000
CONFIG_DEBUG_UART_BASE=0xf1920000
CONFIG_DEBUG_UART_CLOCK=100000000
CONFIG_XILINX_MINI=y
# CONFIG_PSCI_RESET is not set
CONFIG_DEBUG_UART=y
# CONFIG_EXPERT is not set

View File

@ -15,6 +15,7 @@ CONFIG_DEFAULT_DEVICE_TREE="amd-versal2-mini"
CONFIG_SYS_LOAD_ADDR=0xBBF80000
CONFIG_DEBUG_UART_BASE=0xf1920000
CONFIG_DEBUG_UART_CLOCK=100000000
CONFIG_XILINX_MINI=y
CONFIG_SYS_MEM_RSVD_FOR_MMU=y
# CONFIG_PSCI_RESET is not set
CONFIG_DEBUG_UART=y

View File

@ -15,6 +15,7 @@ CONFIG_DEFAULT_DEVICE_TREE="amd-versal2-mini"
CONFIG_SYS_LOAD_ADDR=0xBBF80000
CONFIG_DEBUG_UART_BASE=0xf1920000
CONFIG_DEBUG_UART_CLOCK=100000000
CONFIG_XILINX_MINI=y
CONFIG_SYS_MEM_RSVD_FOR_MMU=y
# CONFIG_PSCI_RESET is not set
CONFIG_DEBUG_UART=y

View File

@ -47,7 +47,6 @@ CONFIG_CMD_SAVES=y
CONFIG_BOOTP_BOOTFILESIZE=y
CONFIG_CMD_TFTPPUT=y
CONFIG_CMD_CACHE=y
CONFIG_CMD_JFFS2=y
CONFIG_SPL_OF_CONTROL=y
CONFIG_OF_EMBED=y
CONFIG_SYS_REDUNDAND_ENVIRONMENT=y

View File

@ -12,6 +12,7 @@ CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0xfffe0000
CONFIG_ENV_SIZE=0x80
CONFIG_DEFAULT_DEVICE_TREE="versal-mini"
CONFIG_SYS_LOAD_ADDR=0x8000000
CONFIG_XILINX_MINI=y
CONFIG_SYS_MEM_RSVD_FOR_MMU=y
# CONFIG_PSCI_RESET is not set
CONFIG_SYS_MEMTEST_START=0x00000000

View File

@ -12,6 +12,7 @@ CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0x10000
CONFIG_ENV_SIZE=0x80
CONFIG_DEFAULT_DEVICE_TREE="versal-mini-emmc0"
CONFIG_SYS_LOAD_ADDR=0x8000000
CONFIG_XILINX_MINI=y
# CONFIG_PSCI_RESET is not set
# CONFIG_EXPERT is not set
CONFIG_REMAKE_ELF=y

View File

@ -12,6 +12,7 @@ CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0x10000
CONFIG_ENV_SIZE=0x80
CONFIG_DEFAULT_DEVICE_TREE="versal-mini-emmc1"
CONFIG_SYS_LOAD_ADDR=0x8000000
CONFIG_XILINX_MINI=y
# CONFIG_PSCI_RESET is not set
# CONFIG_EXPERT is not set
CONFIG_REMAKE_ELF=y

View File

@ -13,6 +13,7 @@ CONFIG_ENV_SIZE=0x80
# CONFIG_DM_GPIO is not set
CONFIG_DEFAULT_DEVICE_TREE="versal-mini-ospi-single"
CONFIG_SYS_LOAD_ADDR=0x8000000
CONFIG_XILINX_MINI=y
CONFIG_SYS_MEM_RSVD_FOR_MMU=y
CONFIG_VERSAL_NO_DDR=y
# CONFIG_PSCI_RESET is not set

View File

@ -11,6 +11,7 @@ CONFIG_SF_DEFAULT_SPEED=30000000
CONFIG_ENV_SIZE=0x80
CONFIG_DEFAULT_DEVICE_TREE="versal-mini-qspi-single"
CONFIG_SYS_LOAD_ADDR=0x8000000
CONFIG_XILINX_MINI=y
CONFIG_SYS_MEM_RSVD_FOR_MMU=y
CONFIG_VERSAL_NO_DDR=y
# CONFIG_PSCI_RESET is not set

View File

@ -14,6 +14,7 @@ CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0xBBF10000
CONFIG_ENV_SIZE=0x80
CONFIG_DEFAULT_DEVICE_TREE="versal-net-mini"
CONFIG_SYS_LOAD_ADDR=0xBBF00000
CONFIG_XILINX_MINI=y
CONFIG_SYS_MEM_RSVD_FOR_MMU=y
# CONFIG_PSCI_RESET is not set
CONFIG_SYS_MEMTEST_START=0x00000000

View File

@ -10,6 +10,7 @@ CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0x10000
CONFIG_ENV_SIZE=0x80
CONFIG_DEFAULT_DEVICE_TREE="versal-net-mini-emmc"
CONFIG_SYS_LOAD_ADDR=0x8000000
CONFIG_XILINX_MINI=y
# CONFIG_PSCI_RESET is not set
# CONFIG_EXPERT is not set
CONFIG_REMAKE_ELF=y

View File

@ -13,6 +13,7 @@ CONFIG_ENV_SIZE=0x80
# CONFIG_DM_GPIO is not set
CONFIG_DEFAULT_DEVICE_TREE="versal-net-mini-ospi-single"
CONFIG_SYS_LOAD_ADDR=0xBBF80000
CONFIG_XILINX_MINI=y
CONFIG_SYS_MEM_RSVD_FOR_MMU=y
# CONFIG_PSCI_RESET is not set
CONFIG_LTO=y

View File

@ -11,6 +11,7 @@ CONFIG_SF_DEFAULT_SPEED=30000000
CONFIG_ENV_SIZE=0x80
CONFIG_DEFAULT_DEVICE_TREE="versal-net-mini-qspi-single"
CONFIG_SYS_LOAD_ADDR=0xBBF80000
CONFIG_XILINX_MINI=y
CONFIG_SYS_MEM_RSVD_FOR_MMU=y
# CONFIG_PSCI_RESET is not set
CONFIG_LTO=y

View File

@ -133,6 +133,7 @@ CONFIG_CADENCE_QSPI=y
CONFIG_CADENCE_OSPI_VERSAL=y
CONFIG_ZYNQ_SPI=y
CONFIG_ZYNQMP_GQSPI=y
CONFIG_SPI_STACKED_PARALLEL=y
CONFIG_TPM2_TIS_SPI=y
CONFIG_USB=y
CONFIG_DM_USB_GADGET=y

View File

@ -4,6 +4,7 @@ CONFIG_POSITION_INDEPENDENT=y
CONFIG_SYS_INIT_SP_BSS_OFFSET=1572864
CONFIG_ARCH_VERSAL=y
CONFIG_TEXT_BASE=0x8000000
CONFIG_SYS_MALLOC_LEN=0x4000000
CONFIG_SYS_MALLOC_F_LEN=0x100000
CONFIG_NR_DRAM_BANKS=36
CONFIG_SF_DEFAULT_SPEED=30000000
@ -18,6 +19,10 @@ CONFIG_DEFINE_TCM_OCM_MMAP=y
CONFIG_SYS_MEMTEST_START=0x00000000
CONFIG_SYS_MEMTEST_END=0x00001000
CONFIG_REMAKE_ELF=y
CONFIG_EFI_RUNTIME_UPDATE_CAPSULE=y
CONFIG_EFI_CAPSULE_ON_DISK=y
CONFIG_EFI_CAPSULE_ON_DISK_EARLY=y
CONFIG_EFI_CAPSULE_FIRMWARE_RAW=y
CONFIG_EFI_HTTP_BOOT=y
CONFIG_FIT=y
CONFIG_FIT_VERBOSE=y
@ -76,6 +81,7 @@ CONFIG_TFTP_BLOCKSIZE=4096
CONFIG_SIMPLE_PM_BUS=y
CONFIG_CLK_VERSAL=y
CONFIG_DFU_TIMEOUT=y
CONFIG_DFU_MMC=y
CONFIG_DFU_RAM=y
CONFIG_SYS_DFU_DATA_BUF_SIZE=0x1800000
CONFIG_ARM_FFA_TRANSPORT=y
@ -99,11 +105,14 @@ CONFIG_MMC_SDHCI_ZYNQ=y
CONFIG_ZYNQ_SDHCI_MIN_FREQ=100000
CONFIG_MTD=y
CONFIG_DM_SPI_FLASH=y
CONFIG_SPI_FLASH_SOFT_RESET=y
CONFIG_SPI_FLASH_SOFT_RESET_ON_BOOT=y
CONFIG_SPI_FLASH_GIGADEVICE=y
CONFIG_SPI_FLASH_ISSI=y
CONFIG_SPI_FLASH_MACRONIX=y
CONFIG_SPI_FLASH_SPANSION=y
CONFIG_SPI_FLASH_STMICRO=y
CONFIG_SPI_FLASH_MT35XU=y
CONFIG_SPI_FLASH_SST=y
CONFIG_SPI_FLASH_WINBOND=y
# CONFIG_SPI_FLASH_USE_4K_SECTORS is not set
@ -136,6 +145,9 @@ CONFIG_CQSPI_REF_CLK=200000000
CONFIG_CADENCE_OSPI_VERSAL=y
CONFIG_ZYNQ_SPI=y
CONFIG_ZYNQMP_GQSPI=y
CONFIG_SPI_STACKED_PARALLEL=y
CONFIG_SYSRESET=y
CONFIG_SYSRESET_PSCI=y
CONFIG_TPM2_TIS_SPI=y
CONFIG_USB=y
CONFIG_DM_USB_GADGET=y

View File

@ -146,6 +146,7 @@ CONFIG_ARM_DCC=y
CONFIG_ZYNQ_SERIAL=y
CONFIG_ZYNQ_SPI=y
CONFIG_ZYNQ_QSPI=y
CONFIG_SPI_STACKED_PARALLEL=y
CONFIG_USB=y
CONFIG_USB_EHCI_HCD=y
CONFIG_USB_ULPI_VIEWPORT=y

View File

@ -187,7 +187,6 @@ CONFIG_DM_PWM=y
CONFIG_PWM_CADENCE_TTC=y
CONFIG_RESET_ZYNQMP=y
CONFIG_DM_RTC=y
CONFIG_RTC_EMULATION=y
CONFIG_RTC_ZYNQMP=y
CONFIG_SCSI=y
CONFIG_ARM_DCC=y

View File

@ -9,6 +9,7 @@ CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0xfffe0000
CONFIG_ENV_SIZE=0x80
CONFIG_DEFAULT_DEVICE_TREE="zynqmp-mini"
CONFIG_SYS_LOAD_ADDR=0x8000000
CONFIG_XILINX_MINI=y
CONFIG_SYS_MEM_RSVD_FOR_MMU=y
CONFIG_SYS_MEMTEST_START=0x00000000
CONFIG_SYS_MEMTEST_END=0x00001000

View File

@ -15,6 +15,7 @@ CONFIG_SPL_SYS_MALLOC_F_LEN=0x600
CONFIG_SPL_BSS_MAX_SIZE=0x80000
CONFIG_SYS_LOAD_ADDR=0x8000000
CONFIG_SPL=y
CONFIG_XILINX_MINI=y
CONFIG_REMAKE_ELF=y
# CONFIG_MP is not set
# CONFIG_EFI_LOADER is not set

View File

@ -15,6 +15,7 @@ CONFIG_SPL_SYS_MALLOC_F_LEN=0x600
CONFIG_SPL_BSS_MAX_SIZE=0x80000
CONFIG_SYS_LOAD_ADDR=0x8000000
CONFIG_SPL=y
CONFIG_XILINX_MINI=y
CONFIG_REMAKE_ELF=y
# CONFIG_MP is not set
# CONFIG_EFI_LOADER is not set

View File

@ -10,6 +10,7 @@ CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0x40000
CONFIG_ENV_SIZE=0x80
CONFIG_DEFAULT_DEVICE_TREE="zynqmp-mini-nand"
CONFIG_SYS_LOAD_ADDR=0x8000000
CONFIG_XILINX_MINI=y
CONFIG_REMAKE_ELF=y
# CONFIG_MP is not set
# CONFIG_EFI_LOADER is not set

View File

@ -10,6 +10,7 @@ CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0x40000
CONFIG_ENV_SIZE=0x80
CONFIG_DEFAULT_DEVICE_TREE="zynqmp-mini-nand"
CONFIG_SYS_LOAD_ADDR=0x8000000
CONFIG_XILINX_MINI=y
CONFIG_REMAKE_ELF=y
# CONFIG_MP is not set
# CONFIG_EFI_LOADER is not set

View File

@ -15,6 +15,7 @@ CONFIG_SYS_LOAD_ADDR=0x8000000
CONFIG_SPL=y
# CONFIG_SPL_FS_FAT is not set
# CONFIG_SPL_LIBDISK_SUPPORT is not set
CONFIG_XILINX_MINI=y
CONFIG_SYS_MEM_RSVD_FOR_MMU=y
CONFIG_ZYNQMP_NO_DDR=y
# CONFIG_PSCI_RESET is not set

View File

@ -210,6 +210,7 @@ CONFIG_SOC_XILINX_ZYNQMP=y
CONFIG_SPI=y
CONFIG_ZYNQ_SPI=y
CONFIG_ZYNQMP_GQSPI=y
CONFIG_SPI_STACKED_PARALLEL=y
CONFIG_SYSRESET=y
CONFIG_SYSRESET_CMD_POWEROFF=y
CONFIG_SYSRESET_PSCI=y

View File

@ -164,6 +164,13 @@ config DM_BOOTCOUNT_SYSCON
Accessing the backend is done using the regmap interface.
config DM_BOOTCOUNT_ZYNQMP
bool "Support ZynqMP PMUFW as a backing store for bootcount"
depends on ARCH_ZYNQMP
help
Enable support for the bootcount API by utilising the Persistent
Global General Storage Register 2 of the PMU.
endmenu
endif

View File

@ -16,3 +16,4 @@ obj-$(CONFIG_DM_BOOTCOUNT_I2C_EEPROM) += i2c-eeprom.o
obj-$(CONFIG_DM_BOOTCOUNT_I2C) += bootcount_dm_i2c.o
obj-$(CONFIG_DM_BOOTCOUNT_SPI_FLASH) += spi-flash.o
obj-$(CONFIG_DM_BOOTCOUNT_SYSCON) += bootcount_syscon.o
obj-$(CONFIG_DM_BOOTCOUNT_ZYNQMP) += bootcount_zynqmp.o

View File

@ -0,0 +1,47 @@
// SPDX-License-Identifier: GPL-2.0+
// SPDX-FileCopyrightText: 2024 CERN (home.cern)
#include <bootcount.h>
#include <dm.h>
#include <stdio.h>
#include <zynqmp_firmware.h>
#include <asm/arch/hardware.h>
#include <dm/platdata.h>
static int bootcount_zynqmp_set(struct udevice *dev, const u32 val)
{
int ret;
ret = zynqmp_mmio_write((ulong)&pmu_base->pers_gen_storage2, 0xFF, val);
if (ret)
pr_info("%s write fail\n", __func__);
return ret;
}
static int bootcount_zynqmp_get(struct udevice *dev, u32 *val)
{
int ret;
*val = 0;
ret = zynqmp_mmio_read((ulong)&pmu_base->pers_gen_storage2, val);
if (ret)
pr_info("%s read fail\n", __func__);
return ret;
}
U_BOOT_DRVINFO(bootcount_zynqmp) = {
.name = "bootcount_zynqmp",
};
static const struct bootcount_ops bootcount_zynqmp_ops = {
.get = bootcount_zynqmp_get,
.set = bootcount_zynqmp_set,
};
U_BOOT_DRIVER(bootcount_zynqmp) = {
.name = "bootcount_zynqmp",
.id = UCLASS_BOOTCOUNT,
.ops = &bootcount_zynqmp_ops,
};

View File

@ -251,13 +251,6 @@ static int cadence_spi_probe(struct udevice *bus)
priv->wr_delay = 50 * DIV_ROUND_UP(NSEC_PER_SEC, priv->ref_clk_hz);
/* Versal and Versal-NET use spi calibration to set read delay */
if (CONFIG_IS_ENABLED(ARCH_VERSAL) ||
CONFIG_IS_ENABLED(ARCH_VERSAL_NET) ||
CONFIG_IS_ENABLED(ARCH_VERSAL2))
if (priv->read_delay >= 0)
priv->read_delay = -1;
/* Reset ospi flash device */
return cadence_qspi_versal_flash_reset(bus);
}

View File

@ -82,7 +82,7 @@
"nor0=flash-0\0"\
"mtdparts=mtdparts=flash-0:"\
"256k(u-boot),256k(env),3m(kernel),"\
"1m(romfs),1m(cramfs),-(jffs2)\0"\
"1m(romfs),1m(cramfs),-(fs)\0"\
"nc=setenv stdout nc;"\
"setenv stdin nc\0" \
"serial=setenv stdout serial;"\

22
include/memtop.h Normal file
View File

@ -0,0 +1,22 @@
/* SPDX-License-Identifier: GPL-2.0+ */
/*
* Copyright (c) 2024, Linaro Limited
*/
/**
* get_mem_top() - Compute the value of ram_top
* @ram_start: Start of RAM
* @ram_size: RAM size
* @size: Minimum RAM size requested
* @fdt: FDT blob
*
* The function computes the top address of RAM memory that can be
* used by U-Boot. This is being done by going through the list of
* reserved memory regions specified in the devicetree blob passed
* to the function. The logic used here is derived from the lmb
* allocation function.
*
* Return: address of ram top on success, 0 on failure
*/
phys_addr_t get_mem_top(phys_addr_t ram_start, phys_size_t ram_size,
phys_size_t size, void *fdt);