aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2023-07-01 16:11:51 -0400
committerTom Rini <trini@konsulko.com>2023-07-01 16:11:51 -0400
commitac29400f1f4ae5df2542bacfe4c142db7824bd6c (patch)
tree48b68138529a415c4a39ef734063d3fa2ebca864
parent5fa30f2351ac3c0458069896bc868eae927df410 (diff)
parent2b17dd1d9d8ca2cfc7f5e964384d4d8418904c35 (diff)
downloadu-boot-WIP/01Jul2023.zip
u-boot-WIP/01Jul2023.tar.gz
u-boot-WIP/01Jul2023.tar.bz2
Merge tag 'efi-2023-07-rc6' of https://source.denx.de/u-boot/custodians/u-boot-efiWIP/01Jul2023
Pull request efi-2023-07-rc6 Documentation: * man-pages for the loads and saves commands UEFI: * fix implementation of allow_unaligned() for armv7 and arm11
-rw-r--r--arch/arm/cpu/arm11/cpu.c6
-rw-r--r--arch/arm/cpu/arm11/sctlr.S6
-rw-r--r--arch/arm/cpu/armv7/cpu.c5
-rw-r--r--arch/arm/cpu/armv7/sctlr.S6
-rw-r--r--arch/arm/include/asm/arm11.h12
-rw-r--r--arch/arm/include/asm/armv7.h1
-rw-r--r--doc/usage/cmd/loadb.rst2
-rw-r--r--doc/usage/cmd/loads.rst96
-rw-r--r--doc/usage/cmd/saves.rst88
-rw-r--r--doc/usage/index.rst2
10 files changed, 217 insertions, 7 deletions
diff --git a/arch/arm/cpu/arm11/cpu.c b/arch/arm/cpu/arm11/cpu.c
index ffe3511..1e16b89 100644
--- a/arch/arm/cpu/arm11/cpu.c
+++ b/arch/arm/cpu/arm11/cpu.c
@@ -20,6 +20,7 @@
#include <irq_func.h>
#include <asm/cache.h>
#include <asm/system.h>
+#include <asm/arm11.h>
static void cache_flush(void);
@@ -43,6 +44,11 @@ int cleanup_before_linux (void)
return 0;
}
+void allow_unaligned(void)
+{
+ arm11_arch_cp15_allow_unaligned();
+}
+
static void cache_flush(void)
{
unsigned long i = 0;
diff --git a/arch/arm/cpu/arm11/sctlr.S b/arch/arm/cpu/arm11/sctlr.S
index 74a7fc4..8722f83 100644
--- a/arch/arm/cpu/arm11/sctlr.S
+++ b/arch/arm/cpu/arm11/sctlr.S
@@ -8,7 +8,7 @@
#include <linux/linkage.h>
/*
- * void allow_unaligned(void) - allow unaligned access
+ * void arm11_arch_cp15_allow_unaligned(void) - allow unaligned access
*
* This routine sets the enable unaligned data support flag and clears the
* aligned flag in the system control register.
@@ -16,10 +16,10 @@
* data abort or undefined behavior but is handled by the CPU.
* For details see the "ARM Architecture Reference Manual" for ARMv6.
*/
-ENTRY(allow_unaligned)
+ENTRY(arm11_arch_cp15_allow_unaligned)
mrc p15, 0, r0, c1, c0, 0 @ load system control register
orr r0, r0, #1 << 22 @ set unaligned data support flag
bic r0, r0, #2 @ clear aligned flag
mcr p15, 0, r0, c1, c0, 0 @ write system control register
bx lr @ return
-ENDPROC(allow_unaligned)
+ENDPROC(arm11_arch_cp15_allow_unaligned)
diff --git a/arch/arm/cpu/armv7/cpu.c b/arch/arm/cpu/armv7/cpu.c
index 68807d2..6259ffa 100644
--- a/arch/arm/cpu/armv7/cpu.c
+++ b/arch/arm/cpu/armv7/cpu.c
@@ -83,3 +83,8 @@ int cleanup_before_linux(void)
{
return cleanup_before_linux_select(CBL_ALL);
}
+
+void allow_unaligned(void)
+{
+ v7_arch_cp15_allow_unaligned();
+}
diff --git a/arch/arm/cpu/armv7/sctlr.S b/arch/arm/cpu/armv7/sctlr.S
index bd56e41..d44b214 100644
--- a/arch/arm/cpu/armv7/sctlr.S
+++ b/arch/arm/cpu/armv7/sctlr.S
@@ -8,15 +8,15 @@
#include <linux/linkage.h>
/*
- * void allow_unaligned(void) - allow unaligned access
+ * void v7_arch_cp15_allow_unaligned(void) - allow unaligned access
*
* This routine clears the aligned flag in the system control register.
* After calling this routine unaligned access does no longer lead to a
* data abort but is handled by the CPU.
*/
-ENTRY(allow_unaligned)
+ENTRY(v7_arch_cp15_allow_unaligned)
mrc p15, 0, r0, c1, c0, 0 @ load system control register
bic r0, r0, #2 @ clear aligned flag
mcr p15, 0, r0, c1, c0, 0 @ write system control register
bx lr @ return
-ENDPROC(allow_unaligned)
+ENDPROC(v7_arch_cp15_allow_unaligned)
diff --git a/arch/arm/include/asm/arm11.h b/arch/arm/include/asm/arm11.h
new file mode 100644
index 0000000..5276f73
--- /dev/null
+++ b/arch/arm/include/asm/arm11.h
@@ -0,0 +1,12 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * Copyright (C) 2023 Marek Vasut <marex@denx.de>
+ */
+#ifndef ARM11_H
+#define ARM11_H
+
+#ifndef __ASSEMBLY__
+void arm11_arch_cp15_allow_unaligned(void);
+#endif /* ! __ASSEMBLY__ */
+
+#endif /* ARM11_H */
diff --git a/arch/arm/include/asm/armv7.h b/arch/arm/include/asm/armv7.h
index 2fb824b..c002998 100644
--- a/arch/arm/include/asm/armv7.h
+++ b/arch/arm/include/asm/armv7.h
@@ -156,6 +156,7 @@ void v7_arch_cp15_set_l2aux_ctrl(u32 l2auxctrl, u32 cpu_midr,
u32 cpu_rev);
void v7_arch_cp15_set_acr(u32 acr, u32 cpu_midr, u32 cpu_rev_comb,
u32 cpu_variant, u32 cpu_rev);
+void v7_arch_cp15_allow_unaligned(void);
#endif /* ! __ASSEMBLY__ */
#endif
diff --git a/doc/usage/cmd/loadb.rst b/doc/usage/cmd/loadb.rst
index b37d1d7..0464b1f 100644
--- a/doc/usage/cmd/loadb.rst
+++ b/doc/usage/cmd/loadb.rst
@@ -13,7 +13,7 @@ Synopsis
Description
-----------
-The loady command is used to transfer a file to the device via the serial line
+The loadb command is used to transfer a file to the device via the serial line
using the Kermit protocol.
The number of transferred bytes is saved in environment variable filesize.
diff --git a/doc/usage/cmd/loads.rst b/doc/usage/cmd/loads.rst
new file mode 100644
index 0000000..e4cb063
--- /dev/null
+++ b/doc/usage/cmd/loads.rst
@@ -0,0 +1,96 @@
+.. SPDX-License-Identifier: GPL-2.0+:
+
+loads command
+=============
+
+Synopsis
+--------
+
+::
+
+ loads [offset [baud]]
+
+Description
+-----------
+
+The loads command is used to transfer a file to the device via the serial line
+using the Motorola S-record file format.
+
+offset
+ offset added to the addresses in the S-record file
+
+baud
+ baud rate to use for download. This parameter is only available if
+ CONFIG_SYS_LOADS_BAUD_CHANGE=y
+
+Example
+-------
+
+As example file to be transferred we use a script printing 'hello s-record'.
+Here are the commands to create the S-record file:
+
+.. code-block:: bash
+
+ $ echo 'echo hello s-record' > script.txt
+ $ mkimage -T script -d script.txt script.scr
+ Image Name:
+ Created: Sun Jun 25 10:35:02 2023
+ Image Type: PowerPC Linux Script (gzip compressed)
+ Data Size: 28 Bytes = 0.03 KiB = 0.00 MiB
+ Load Address: 00000000
+ Entry Point: 00000000
+ Contents:
+ Image 0: 20 Bytes = 0.02 KiB = 0.00 MiB
+ $ srec_cat script.scr -binary -CRLF -Output script.srec
+ $ echo -e "S9030000FC\r" >> script.srec
+ $ cat script.srec
+ S0220000687474703A2F2F737265636F72642E736F75726365666F7267652E6E65742F1D
+ S1230000270519566D773EB6649815E30000001700000000000000003DE3D97005070601E2
+ S12300200000000000000000000000000000000000000000000000000000000000000000BC
+ S11A00400000000F0000000068656C6C6F20732D7265636F72640A39
+ S5030003F9
+ S9030000FC
+ $
+
+The load address in the first S1 record is 0x0000.
+
+The terminal emulation program picocom is invoked with *cat* as the send
+command to transfer the file.
+
+.. code-block::
+
+ picocom --send-cmd 'cat' --baud 115200 /dev/ttyUSB0
+
+After entering the *loads* command the key sequence <CTRL-A><CTRL-S> is used to
+let picocom prompt for the file name. Picocom invokes the program *cat* for the
+file transfer. The loaded script is executed using the *source* command.
+
+.. code-block::
+
+ => loads $scriptaddr
+ ## Ready for S-Record download ...
+
+ *** file: script.srec
+ $ cat script.srec
+
+ *** exit status: 0 ***
+
+ ## First Load Addr = 0x4FC00000
+ ## Last Load Addr = 0x4FC0005B
+ ## Total Size = 0x0000005C = 92 Bytes
+ ## Start Addr = 0x00000000
+ => source $scriptaddr
+ ## Executing script at 4fc00000
+ hello s-record
+ =>
+
+Configuration
+-------------
+
+The command is only available if CONFIG_CMD_LOADS=y. The parameter to set the
+baud rate is only available if CONFIG_SYS_LOADS_BAUD_CHANGE=y
+
+Return value
+------------
+
+The return value $? is 0 (true) on success, 1 (false) otherwise.
diff --git a/doc/usage/cmd/saves.rst b/doc/usage/cmd/saves.rst
new file mode 100644
index 0000000..5823f88
--- /dev/null
+++ b/doc/usage/cmd/saves.rst
@@ -0,0 +1,88 @@
+.. SPDX-License-Identifier: GPL-2.0+:
+
+saves command
+=============
+
+Synopsis
+--------
+
+::
+
+ saves [offset [size [baud]]]
+
+Description
+-----------
+
+The *saves* command is used to transfer a file from the device via the serial
+line using the Motorola S-record file format.
+
+offset
+ start address of memory area to save, defaults to 0x0
+
+size
+ size of memory area to save, defaults to 0x0
+
+baud
+ baud rate to use for upload. This parameter is only available if
+ CONFIG_SYS_LOADS_BAUD_CHANGE=y
+
+Example
+-------
+
+In the example the *screen* command is used to connect to the U-Boot serial
+console.
+
+In a first screen session a file is loaded from the SD-card and the *saves*
+command is invoked. <CTRL+A><k> is used to kill the screen session.
+
+A new screen session is started which logs the output to a file and the
+<ENTER> key is hit to start the file output. <CTRL+A><k> is issued to kill the
+screen session.
+
+The log file is converted to a binary file using the *srec_cat* command.
+A negative offset of -1337982976 (= -0x4c000000) is applied to compensate for
+the offset used in the *saves* command.
+
+.. code-block::
+
+ $ screen /dev/ttyUSB0 115200
+ => echo $scriptaddr
+ 0x4FC00000
+ => load mmc 0:1 $scriptaddr boot.txt
+ 124 bytes read in 1 ms (121.1 KiB/s)
+ => saves $scriptaddr $filesize
+ ## Ready for S-Record upload, press ENTER to proceed ...
+ Really kill this window [y/n]
+ $ screen -Logfile out.srec -L /dev/ttyUSB0 115200
+ S0030000FC
+ S3154FC00000736574656E76206175746F6C6F616420AD
+ S3154FC000106E6F0A646863700A6C6F6164206D6D633E
+ S3154FC0002020303A3120246664745F616464725F72B3
+ S3154FC00030206474620A6C6F6164206D6D6320303AC0
+ S3154FC000403120246B65726E656C5F616464725F72DA
+ S3154FC0005020736E702E6566690A626F6F74656669C6
+ S3154FC0006020246B65726E656C5F616464725F7220CB
+ S3114FC00070246664745F616464725F720A38
+ S70500000000FA
+ ## S-Record upload complete
+ =>
+ Really kill this window [y/n]
+ $ srec_cat out.srec -offset -1337982976 -Output out.txt -binary 2>/dev/null
+ $ cat out.txt
+ setenv autoload no
+ dhcp
+ load mmc 0:1 $fdt_addr_r dtb
+ load mmc 0:1 $kernel_addr_r snp.efi
+ bootefi $kernel_addr_r $fdt_addr_r
+ $
+
+Configuration
+-------------
+
+The command is only available if CONFIG_CMD_SAVES=y. The parameter to set the
+baud rate is only available if CONFIG_SYS_LOADS_BAUD_CHANGE=y
+
+Return value
+------------
+
+The return value $? is 0 (true) on success, 1 (false) otherwise.
diff --git a/doc/usage/index.rst b/doc/usage/index.rst
index 29ae8a1..388e59f 100644
--- a/doc/usage/index.rst
+++ b/doc/usage/index.rst
@@ -68,6 +68,7 @@ Shell commands
cmd/load
cmd/loadb
cmd/loadm
+ cmd/loads
cmd/loadx
cmd/loady
cmd/mbr
@@ -84,6 +85,7 @@ Shell commands
cmd/read
cmd/reset
cmd/rng
+ cmd/saves
cmd/sbi
cmd/sf
cmd/scp03