mirror of
https://github.com/ARM-software/arm-trusted-firmware.git
synced 2025-04-17 01:54:22 +00:00
fix(allwinner): check RSB availability in DT on H6
At the moment we access the RSB bus on all Allwinner H6 boards unconditionally, even though some boards do not have any PMIC at all, while others have some I2C devices connected to the same pins. The latter case is just fragile, but the first case leads to a hang on at least one board, as reported by Jernej. Scan the devicetree, to check for the availability of the RSB bus node. Proceed only if the RSB DT node is actually enabled. Change-Id: Iea7dcfe3e085e173334d098ec4ddcb6c4b085771 Signed-off-by: Andre Przywara <andre.przywara@arm.com> Reported-by: Jernej Skrabec <jernej.skrabec@gmail.com>
This commit is contained in:
parent
49b268ce30
commit
658b3154d5
1 changed files with 8 additions and 1 deletions
|
@ -8,8 +8,10 @@
|
|||
#include <errno.h>
|
||||
|
||||
#include <common/debug.h>
|
||||
#include <common/fdt_wrappers.h>
|
||||
#include <drivers/allwinner/axp.h>
|
||||
#include <drivers/allwinner/sunxi_rsb.h>
|
||||
#include <libfdt.h>
|
||||
#include <lib/mmio.h>
|
||||
|
||||
#include <sunxi_cpucfg.h>
|
||||
|
@ -63,7 +65,12 @@ static int rsb_init(void)
|
|||
|
||||
int sunxi_pmic_setup(uint16_t socid, const void *fdt)
|
||||
{
|
||||
int ret;
|
||||
int node, ret;
|
||||
|
||||
node = fdt_node_offset_by_compatible(fdt, 0, "allwinner,sun8i-a23-rsb");
|
||||
if ((node < 0) || !fdt_node_is_enabled(fdt, node)) {
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
INFO("PMIC: Probing AXP805 on RSB\n");
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue