diff options
author | Patrick Delaunay | 2019-07-05 17:20:14 +0200 |
---|---|---|
committer | Patrick Delaunay | 2019-07-12 11:18:53 +0200 |
commit | 05d36936880d77e39dfd5978094d016a6f6c1808 (patch) | |
tree | 6a8c9eecd8ac49d263e000e1733f70a6a08228c1 /arch/arm/mach-stm32mp/fdt.c | |
parent | 24cb4587f48f5b88efc497baa6e010f6fd4f4825 (diff) |
stm32mp1: update package information in device tree
Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Diffstat (limited to 'arch/arm/mach-stm32mp/fdt.c')
-rw-r--r-- | arch/arm/mach-stm32mp/fdt.c | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/arch/arm/mach-stm32mp/fdt.c b/arch/arm/mach-stm32mp/fdt.c new file mode 100644 index 00000000000..c635353e339 --- /dev/null +++ b/arch/arm/mach-stm32mp/fdt.c @@ -0,0 +1,45 @@ +// SPDX-License-Identifier: GPL-2.0+ OR BSD-3-Clause +/* + * Copyright (C) 2019, STMicroelectronics - All Rights Reserved + */ + +#include <common.h> +#include <fdt_support.h> +#include <asm/arch/sys_proto.h> +#include <dt-bindings/pinctrl/stm32-pinfunc.h> + +/* + * This function is called right before the kernel is booted. "blob" is the + * device tree that will be passed to the kernel. + */ +int ft_system_setup(void *blob, bd_t *bd) +{ + int ret = 0; + u32 pkg; + + switch (get_cpu_package()) { + case PKG_AA_LBGA448: + pkg = STM32MP_PKG_AA; + break; + case PKG_AB_LBGA354: + pkg = STM32MP_PKG_AB; + break; + case PKG_AC_TFBGA361: + pkg = STM32MP_PKG_AC; + break; + case PKG_AD_TFBGA257: + pkg = STM32MP_PKG_AD; + break; + default: + pkg = 0; + break; + } + if (pkg) { + do_fixup_by_compat_u32(blob, "st,stm32mp157-pinctrl", + "st,package", pkg, false); + do_fixup_by_compat_u32(blob, "st,stm32mp157-z-pinctrl", + "st,package", pkg, false); + } + + return ret; +} |