From 0d3d2465d648ffac520ff38eb5bef3513c208d83 Mon Sep 17 00:00:00 2001 From: Jouni Ukkonen Date: Wed, 16 Oct 2024 13:13:44 +0300 Subject: [PATCH] arch/arm64/imx9: reset when psci not available Provide up_systemreset when psci is disabled Signed-off-by: Jouni Ukkonen --- arch/arm64/src/imx9/Make.defs | 4 +++ arch/arm64/src/imx9/imx9_reset.c | 50 ++++++++++++++++++++++++++++++++ 2 files changed, 54 insertions(+) create mode 100644 arch/arm64/src/imx9/imx9_reset.c diff --git a/arch/arm64/src/imx9/Make.defs b/arch/arm64/src/imx9/Make.defs index 6aff9fb68ecf2..8810f150010d4 100644 --- a/arch/arm64/src/imx9/Make.defs +++ b/arch/arm64/src/imx9/Make.defs @@ -87,3 +87,7 @@ ifeq ($(CONFIG_IMX9_BOOTLOADER), y) CHIP_CSRCS += $(DDR_CSRCS) endif endif + +ifneq ($(CONFI_IMX9_HAVE_ATF_FIRMWARE), y) + CHIP_CSRCS += imx9_reset.c +endif \ No newline at end of file diff --git a/arch/arm64/src/imx9/imx9_reset.c b/arch/arm64/src/imx9/imx9_reset.c new file mode 100644 index 0000000000000..48da1c06639be --- /dev/null +++ b/arch/arm64/src/imx9/imx9_reset.c @@ -0,0 +1,50 @@ +/**************************************************************************** + * arch/arm64/src/imx9/imx9_reset.c + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "imx9_pmic.h" + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +void up_systemreset(void) +{ + imx9_pmic_reset(); + + /* Wait for the reset */ + + while (1); +} +