Back to home page

OSCL-LXR

 
 

    


0001 // SPDX-License-Identifier: GPL-2.0-or-later
0002 /*
0003  *  Setup code for SAMA5
0004  *
0005  *  Copyright (C) 2013 Atmel,
0006  *                2013 Ludovic Desroches <ludovic.desroches@atmel.com>
0007  */
0008 
0009 #include <linux/of.h>
0010 #include <linux/of_platform.h>
0011 
0012 #include <asm/hardware/cache-l2x0.h>
0013 #include <asm/mach/arch.h>
0014 #include <asm/mach/map.h>
0015 #include <asm/outercache.h>
0016 #include <asm/system_misc.h>
0017 
0018 #include "generic.h"
0019 #include "sam_secure.h"
0020 
0021 static void sama5_l2c310_write_sec(unsigned long val, unsigned reg)
0022 {
0023     /* OP-TEE configures the L2 cache and does not allow modifying it yet */
0024 }
0025 
0026 static void __init sama5_secure_cache_init(void)
0027 {
0028     sam_secure_init();
0029     if (sam_linux_is_optee_available())
0030         outer_cache.write_sec = sama5_l2c310_write_sec;
0031 }
0032 
0033 static void __init sama5_dt_device_init(void)
0034 {
0035     of_platform_default_populate(NULL, NULL, NULL);
0036     sama5_pm_init();
0037 }
0038 
0039 static const char *const sama5_dt_board_compat[] __initconst = {
0040     "atmel,sama5",
0041     NULL
0042 };
0043 
0044 DT_MACHINE_START(sama5_dt, "Atmel SAMA5")
0045     /* Maintainer: Atmel */
0046     .init_machine   = sama5_dt_device_init,
0047     .dt_compat  = sama5_dt_board_compat,
0048 MACHINE_END
0049 
0050 static const char *const sama5_alt_dt_board_compat[] __initconst = {
0051     "atmel,sama5d4",
0052     NULL
0053 };
0054 
0055 DT_MACHINE_START(sama5_alt_dt, "Atmel SAMA5")
0056     /* Maintainer: Atmel */
0057     .init_machine   = sama5_dt_device_init,
0058     .dt_compat  = sama5_alt_dt_board_compat,
0059     .l2c_aux_mask   = ~0UL,
0060 MACHINE_END
0061 
0062 static void __init sama5d2_init(void)
0063 {
0064     of_platform_default_populate(NULL, NULL, NULL);
0065     sama5d2_pm_init();
0066 }
0067 
0068 static const char *const sama5d2_compat[] __initconst = {
0069     "atmel,sama5d2",
0070     NULL
0071 };
0072 
0073 DT_MACHINE_START(sama5d2, "Atmel SAMA5")
0074     /* Maintainer: Atmel */
0075     .init_machine   = sama5d2_init,
0076     .init_early = sama5_secure_cache_init,
0077     .dt_compat  = sama5d2_compat,
0078     .l2c_aux_mask   = ~0UL,
0079 MACHINE_END