mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-11-28 23:51:33 +00:00
board: ns3: Remove superfluous reset logic
The current implementation of reset_cpu() in the ns3 board code does not
archieve what it is supposed to (according to the comments), due to
a number of reasons:
1. The argument to reset_cpu() is _not_ actually passed from the
`reset` command, but is set to 0 in all call-sites (in this
specific case, see arch/arm/lib/reset.c). Thus, performing
different kinds of resets based on its value will not work as
expected.
2. Contrary to its documentation, the passed argument is not
interpreted, but a static `L3_RESET` define is used. The other
comment properly notes that this will always perform a L3 reset,
though.
3. The "parsing" of the static `L3_RESET` value is not even using the
upper and lower nibble as stated in the comment, but uses the last
two decimal digits of the value.
This is currently one of the only implementations left in U-Boot, which
make "use" of the value passed to reset_cpu(). As this is done under
false assumption (the value does not have any meaning anymore), it makes
sense to bring it into line with the rest and start ignoring the
parameter.
This is a preparation for removal of the reset_cpu() parameter across
the entire tree in a later patch.
Fixes: b5a152e7ca
("board: ns3: default reset type to L3")
Cc: Bharat Gooty <bharat.gooty@broadcom.com>
Cc: Rayagonda Kokatanur <rayagonda.kokatanur@broadcom.com>
Signed-off-by: Harald Seiler <hws@denx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
parent
5075bf28d6
commit
10b86ef9b3
1 changed files with 2 additions and 20 deletions
|
@ -15,9 +15,6 @@
|
|||
#include <dt-bindings/memory/bcm-ns3-mc.h>
|
||||
#include <broadcom/chimp.h>
|
||||
|
||||
/* Default reset-level = 3 and strap-val = 0 */
|
||||
#define L3_RESET 30
|
||||
|
||||
#define BANK_OFFSET(bank) ((u64)BCM_NS3_DDR_INFO_BASE + 8 + ((bank) * 16))
|
||||
|
||||
/*
|
||||
|
@ -190,23 +187,8 @@ ulong board_get_usable_ram_top(ulong total_size)
|
|||
|
||||
void reset_cpu(ulong level)
|
||||
{
|
||||
u32 reset_level, strap_val;
|
||||
|
||||
/* Default reset type is L3 reset */
|
||||
if (!level) {
|
||||
/*
|
||||
* Encoding: U-Boot reset command expects decimal argument,
|
||||
* Boot strap val: Bits[3:0]
|
||||
* reset level: Bits[7:4]
|
||||
*/
|
||||
strap_val = L3_RESET % 10;
|
||||
level = L3_RESET / 10;
|
||||
reset_level = level % 10;
|
||||
psci_system_reset2(reset_level, strap_val);
|
||||
} else {
|
||||
/* U-Boot cmd "reset" with any arg will trigger L1 reset */
|
||||
psci_system_reset();
|
||||
}
|
||||
/* Perform a level 3 reset */
|
||||
psci_system_reset2(3, 0);
|
||||
}
|
||||
|
||||
#ifdef CONFIG_OF_BOARD_SETUP
|
||||
|
|
Loading…
Reference in a new issue