]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - arch/arm/lib/bootm-fdt.c
ARM: PSCI: Rework the DT handler slightly
[karo-tx-uboot.git] / arch / arm / lib / bootm-fdt.c
index 93888f8db89bff6d41c3793a17b0e5b0b749ae07..665a3bc37fadb7c42fe6981f6f7bcf4b1360362a 100644 (file)
  *
  * Copyright (C) 2001  Erik Mouw (J.A.K.Mouw@its.tudelft.nl)
  *
- * See file CREDITS for list of people who contributed to this
- * project.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
+ * SPDX-License-Identifier:    GPL-2.0+
  */
 
 #include <common.h>
 #include <fdt_support.h>
+#include <asm/psci.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
-int arch_fixup_memory_node(void *blob)
+int arch_fixup_fdt(void *blob)
 {
        bd_t *bd = gd->bd;
-       int bank;
+       int bank, ret;
        u64 start[CONFIG_NR_DRAM_BANKS];
        u64 size[CONFIG_NR_DRAM_BANKS];
 
@@ -48,5 +33,12 @@ int arch_fixup_memory_node(void *blob)
                size[bank] = bd->bi_dram[bank].size;
        }
 
-       return fdt_fixup_memory_banks(blob, start, size, CONFIG_NR_DRAM_BANKS);
+       ret = fdt_fixup_memory_banks(blob, start, size, CONFIG_NR_DRAM_BANKS);
+#if defined(CONFIG_ARMV7_NONSEC) || defined(CONFIG_ARMV7_VIRT)
+       if (ret)
+               return ret;
+
+       ret = psci_update_dt(blob);
+#endif
+       return ret;
 }