Merge branch '2023-11-29-assorted-platform-updates' into next

- Add a TFTP put test, a few TI Keystone 2 updates, fix stack-protector
  for PowerPC, fixes in lib/slre, timer-uclass and pvblock.
This commit is contained in:
Tom Rini 2023-11-29 11:16:13 -05:00
commit 6357cf0cc4
20 changed files with 91 additions and 41 deletions

View file

@ -750,6 +750,7 @@ endif
ifeq ($(CONFIG_STACKPROTECTOR),y)
KBUILD_CFLAGS += $(call cc-option,-fstack-protector-strong)
KBUILD_CFLAGS += $(call cc-option,-mstack-protector-guard=global)
CFLAGS_EFI += $(call cc-option,-fno-stack-protector)
else
KBUILD_CFLAGS += $(call cc-option,-fno-stack-protector)

View file

@ -6,7 +6,6 @@
* Texas Instruments Incorporated, <www.ti.com>
*/
#include <common.h>
#include <asm/arch/clock.h>
#include <asm/arch/clock_defs.h>
#include <linux/bitops.h>

View file

@ -6,7 +6,7 @@
* Texas Instruments Incorporated, <www.ti.com>
*/
#include <common.h>
#include <vsprintf.h>
#include <command.h>
#include <asm/arch/hardware.h>
#include <asm/arch/clock.h>

View file

@ -6,7 +6,6 @@
* Texas Instruments Incorporated, <www.ti.com>
*/
#include <common.h>
#include <command.h>
#include <image.h>
#include <mach/mon.h>

View file

@ -6,7 +6,6 @@
* Texas Instruments Incorporated, <www.ti.com>
*/
#include <common.h>
#include <command.h>
#include <asm/arch/mon.h>
#include <asm/arch/psc_defs.h>

View file

@ -9,7 +9,7 @@
#include <cpu_func.h>
#include <env.h>
#include <asm/io.h>
#include <common.h>
#include <vsprintf.h>
#include <asm/arch/msmc.h>
#include <asm/arch/ddr3.h>
#include <asm/arch/psc_defs.h>

View file

@ -5,8 +5,8 @@
* (C) Copyright 2015-2016 Texas Instruments Incorporated, <www.ti.com>
*/
#include <common.h>
#include <log.h>
#include <string.h>
#include <i2c.h>
#include <ddr_spd.h>

View file

@ -6,7 +6,6 @@
* Texas Instruments Incorporated, <www.ti.com>
*/
#include <common.h>
#include <cpu_func.h>
#include <init.h>
#include <ns16550.h>

View file

@ -6,7 +6,6 @@
* Texas Instruments Incorporated, <www.ti.com>
*/
#include <common.h>
#include <env.h>
#include <init.h>
#include <asm/io.h>

View file

@ -8,7 +8,6 @@
#include <hang.h>
#include <image.h>
#include <asm/unaligned.h>
#include <common.h>
#include <command.h>
#include <mach/mon.h>
#include <spl.h>

View file

@ -6,7 +6,6 @@
* Texas Instruments Incorporated, <www.ti.com>
*/
#include <common.h>
#include <asm/arch/msmc.h>
struct mpax {

View file

@ -6,7 +6,6 @@
* Texas Instruments Incorporated, <www.ti.com>
*/
#include <common.h>
#include <linux/delay.h>
#include <linux/errno.h>
#include <asm/io.h>

View file

@ -18,3 +18,8 @@ void __stack_chk_fail(void)
panic("Stack smashing detected in function:\n%p relocated from %p",
ra, ra - gd->reloc_off);
}
void __stack_chk_fail_local(void)
{
__stack_chk_fail();
}

View file

@ -7,6 +7,7 @@
*/
#include <common.h>
#include <asm/arch/hardware.h>
#include <asm/ti-common/ti-aemif.h>
#define AEMIF_WAITCYCLE_CONFIG (KS2_AEMIF_CNTRL_BASE + 0x4)

View file

@ -8,6 +8,7 @@
#include <errno.h>
#include <common.h>
#include <asm/io.h>
#include <asm/ti-common/keystone_serdes.h>
#include <linux/bitops.h>

View file

@ -66,13 +66,13 @@ static int timer_pre_probe(struct udevice *dev)
err = clk_get_by_index(dev, 0, &timer_clk);
if (!err) {
ret = clk_get_rate(&timer_clk);
if (IS_ERR_VALUE(ret))
return ret;
uc_priv->clock_rate = ret;
} else {
uc_priv->clock_rate =
dev_read_u32_default(dev, "clock-frequency", 0);
if (!IS_ERR_VALUE(ret)) {
uc_priv->clock_rate = ret;
return 0;
}
}
uc_priv->clock_rate = dev_read_u32_default(dev, "clock-frequency", 0);
}
return 0;

View file

@ -632,7 +632,8 @@ static ulong pvblock_iop(struct udevice *udev, lbaint_t blknr,
memcpy(blk_dev->bounce_buffer, buffer, desc->blksz);
aiocb.aio_nbytes = unaligned ? desc->blksz :
min((size_t)(BLKIF_MAX_SEGMENTS_PER_REQUEST * PAGE_SIZE),
min((size_t)((BLKIF_MAX_SEGMENTS_PER_REQUEST - 1)
* PAGE_SIZE),
(size_t)(blocks_todo * desc->blksz));
blkfront_io(&aiocb, write);

View file

@ -9,23 +9,10 @@
#ifndef __CONFIG_KS2_EVM_H
#define __CONFIG_KS2_EVM_H
/* U-Boot Build Configuration */
/* SoC Configuration */
/* Memory Configuration */
#define CFG_SYS_LPAE_SDRAM_BASE 0x800000000
#define CFG_MAX_RAM_BANK_SIZE (2 << 30) /* 2GB */
#ifdef CONFIG_SYS_MALLOC_F_LEN
#define SPL_MALLOC_F_SIZE CONFIG_SYS_MALLOC_F_LEN
#else
#define SPL_MALLOC_F_SIZE 0
#endif
/* SPL SPI Loader Configuration */
#define KEYSTONE_SPL_STACK_SIZE (8 * 1024)
/* SRAM scratch space entries */
#define SRAM_SCRATCH_SPACE_ADDR 0xc0c23fc
@ -53,8 +40,6 @@
#define CFG_KSNET_SERDES_SGMII2_BASE KS2_SGMII_SERDES2_BASE
#define CFG_KSNET_SERDES_LANES_PER_SGMII KS2_LANES_PER_SGMII_SERDES
/* EEPROM definitions */
/* NAND Configuration */
#define CFG_SYS_NAND_MASK_CLE 0x4000
#define CFG_SYS_NAND_MASK_ALE 0x2000
@ -63,18 +48,10 @@
#define CFG_SYS_NAND_LARGEPAGE
#define CFG_SYS_NAND_BASE_LIST { 0x30000000, }
/* U-Boot general configuration */
/* EDMA3 */
/* Now for the remaining common defines */
#include <configs/ti_armv7_common.h>
/* we may include files below only after all above definitions */
#include <asm/arch/hardware.h>
#include <asm/arch/clock.h>
#ifndef CONFIG_SOC_K2G
#define CFG_SYS_HZ_CLOCK ks_clk_get_rate(KS2_CLK1_6)

View file

@ -686,6 +686,7 @@ int main(int argc, char *argv[])
}
if (!slre_compile(&slre, argv[1])) {
(void) fclose(fp);
fprintf(stderr, "Error compiling slre: %s\n", slre.err_str);
return 1;
}

View file

@ -7,6 +7,7 @@
import pytest
import u_boot_utils
import uuid
import datetime
"""
Note: This test relies on boardenv_* containing configuration values to define
@ -51,6 +52,8 @@ env__net_tftp_readable_file = {
'addr': 0x10000000,
'size': 5058624,
'crc32': 'c2244b26',
'timeout': 50000,
'fnu': 'ubtest-upload.bin',
}
# Details regarding a file that may be read from a NFS server. This variable
@ -326,3 +329,71 @@ def test_net_pxe_get(u_boot_console):
assert expected_text_default in output
assert "Config file 'default.boot' found" in output
@pytest.mark.buildconfigspec("cmd_crc32")
@pytest.mark.buildconfigspec("cmd_net")
@pytest.mark.buildconfigspec("cmd_tftpput")
def test_net_tftpput(u_boot_console):
"""Test the tftpput command.
A file is downloaded from the TFTP server and then uploaded to the TFTP
server, its size and its CRC32 are validated.
The details of the file to download are provided by the boardenv_* file;
see the comment at the beginning of this file.
"""
if not net_set_up:
pytest.skip("Network not initialized")
f = u_boot_console.config.env.get("env__net_tftp_readable_file", None)
if not f:
pytest.skip("No TFTP readable file to read")
addr = f.get("addr", None)
if not addr:
addr = u_boot_utils.find_ram_base(u_boot_console)
sz = f.get("size", None)
timeout = f.get("timeout", u_boot_console.p.timeout)
fn = f["fn"]
fnu = f.get("fnu", "_".join([datetime.datetime.now().strftime("%y%m%d%H%M%S"), fn]))
expected_text = "Bytes transferred = "
if sz:
expected_text += "%d" % sz
with u_boot_console.temporary_timeout(timeout):
output = u_boot_console.run_command("tftpboot %x %s" % (addr, fn))
assert "TIMEOUT" not in output
assert expected_text in output
expected_tftpb_crc = f.get("crc32", None)
output = u_boot_console.run_command("crc32 $fileaddr $filesize")
assert expected_tftpb_crc in output
with u_boot_console.temporary_timeout(timeout):
output = u_boot_console.run_command(
"tftpput $fileaddr $filesize $serverip:%s" % (fnu)
)
expected_text = "Bytes transferred = "
if sz:
expected_text += "%d" % sz
addr = addr + sz
assert "TIMEOUT" not in output
assert "Access violation" not in output
assert expected_text in output
with u_boot_console.temporary_timeout(timeout):
output = u_boot_console.run_command("tftpboot %x %s" % (addr, fnu))
expected_text = "Bytes transferred = "
if sz:
expected_text += "%d" % sz
assert "TIMEOUT" not in output
assert expected_text in output
output = u_boot_console.run_command("crc32 $fileaddr $filesize")
assert expected_tftpb_crc in output