summaryrefslogtreecommitdiff
path: root/include/env/tq/spi.env
blob: 242aa4da784953e1fc9dd885da8ef5f3f6c4fb02 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
/*
 * Copyright (c) 2024-2026 TQ-Systems GmbH <u-boot@ew.tq-group.com>,
 * D-82229 Seefeld, Germany.
 * Author: Max Merchel
 *
 * shared spi environment for TQ boards
 */

update_uboot_spi=
	run check_ipaddr;
	if tftp ${uboot}; then
		if itest "${filesize}" >= "${uboot_spi_size}"; then
			echo "ERROR: size to large ...";
			exit;
		fi;
		echo "Write u-boot image to SPI NOR ...";
		if sf probe; then
			run write_uboot_spi;
		fi;
	fi;

#ifdef CONFIG_CMD_QSPIHDR
write_uboot_spi=qspihdr init ${loadaddr} ${filesize} safe;
#else
write_uboot_spi=sf update "${loadaddr}" "${uboot_spi_start}" "${filesize}"
#endif