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 -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEbcT5xx8ppvoGt20zxIHbvCwFGsQFAmSgZtUACgkQxIHbvCwF GsS7sQ//UWy9Cv8Mmq/1AfLYoxhkyxaTEDlQZPWqrBzkuY5BIKIkmwy9z0gnEHEK q/qJKCOZqfNiJ0jmqvLf4R+cytq3Lk8g096DrtKGgyZXuHofUnNqdXNVkEzfxVDv /36OuKkphHY11RFdC4FvCJIyI8nYQ9R1z1WnzNMn05mjyGnpKAIpYUrny6OQIcbD yffzxKirDNtbctjdtcLNRQ2H2B1dssORJJM0MV+84jatYkMvknfgd6yPxEP7C8DK f5/LwbY+fHQcT+JYCbz9mA/D9OaSWEkCcSueoEuphUPm6x62W+LDrezQ9va7P/oS /8/zLCN9bEtcqu2s7BB+NjbXNC7YXbzIUfLWaMvlt4l/k4gPoKDg+LzyvwUrpfXS kPy+03zBFcUvrbIBUG3UUhPSsaULUTqQJaxpsZ0U3VyJeGEJNoRi7V7QvLspSRQB dmJPwvQMIxjRA4WnOqzOUwYn4qqWdgpIFJi44ceE12Ptke7ZV4OlFw+mKaT2LvX/ hpVt7S/zjuadv0S1EHclJY+FqZzs8i05LYXf5JxbT+8BeIx9QFgUvIex6KJVt4LX PHL5PFRwdxG7cfs498/ZaRRSIWEUdfeqj3ycV0f+Yjw1PJ+gW8csDrJYRoI6UQMf lTO8U0kJO6TFlAySy9R1u1eIZucL/d02dNDDaHMe9iJG6xoypQc= =ufws -----END PGP SIGNATURE----- Merge tag 'efi-2023-07-rc6' of https://source.denx.de/u-boot/custodians/u-boot-efi 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
This commit is contained in:
commit
ac29400f1f
10 changed files with 217 additions and 7 deletions
|
@ -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;
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
|
|
@ -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)
|
||||
|
|
12
arch/arm/include/asm/arm11.h
Normal file
12
arch/arm/include/asm/arm11.h
Normal file
|
@ -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 */
|
|
@ -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
|
||||
|
|
|
@ -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.
|
||||
|
|
96
doc/usage/cmd/loads.rst
Normal file
96
doc/usage/cmd/loads.rst
Normal file
|
@ -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.
|
88
doc/usage/cmd/saves.rst
Normal file
88
doc/usage/cmd/saves.rst
Normal file
|
@ -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.
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue