~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/arch/arm/mach-socfpga/socfpga.c

Version: ~ [ linux-6.11.5 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.58 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.114 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.169 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.228 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.284 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.322 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 // SPDX-License-Identifier: GPL-2.0-or-later
  2 /*
  3  *  Copyright (C) 2012-2015 Altera Corporation
  4  */
  5 #include <linux/irqchip.h>
  6 #include <linux/of.h>
  7 #include <linux/of_address.h>
  8 #include <linux/reboot.h>
  9 #include <linux/reset/socfpga.h>
 10 
 11 #include <asm/mach/arch.h>
 12 #include <asm/mach/map.h>
 13 #include <asm/cacheflush.h>
 14 
 15 #include "core.h"
 16 
 17 void __iomem *sys_manager_base_addr;
 18 void __iomem *rst_manager_base_addr;
 19 void __iomem *sdr_ctl_base_addr;
 20 unsigned long socfpga_cpu1start_addr;
 21 
 22 static void __init socfpga_sysmgr_init(void)
 23 {
 24         struct device_node *np;
 25 
 26         np = of_find_compatible_node(NULL, NULL, "altr,sys-mgr");
 27 
 28         if (of_property_read_u32(np, "cpu1-start-addr",
 29                         (u32 *) &socfpga_cpu1start_addr))
 30                 pr_err("SMP: Need cpu1-start-addr in device tree.\n");
 31 
 32         /* Ensure that socfpga_cpu1start_addr is visible to other CPUs */
 33         smp_wmb();
 34         sync_cache_w(&socfpga_cpu1start_addr);
 35 
 36         sys_manager_base_addr = of_iomap(np, 0);
 37 
 38         np = of_find_compatible_node(NULL, NULL, "altr,rst-mgr");
 39         rst_manager_base_addr = of_iomap(np, 0);
 40 
 41         np = of_find_compatible_node(NULL, NULL, "altr,sdr-ctl");
 42         sdr_ctl_base_addr = of_iomap(np, 0);
 43 }
 44 
 45 static void __init socfpga_init_irq(void)
 46 {
 47         irqchip_init();
 48         socfpga_sysmgr_init();
 49         if (IS_ENABLED(CONFIG_EDAC_ALTERA_L2C))
 50                 socfpga_init_l2_ecc();
 51 
 52         if (IS_ENABLED(CONFIG_EDAC_ALTERA_OCRAM))
 53                 socfpga_init_ocram_ecc();
 54         socfpga_reset_init();
 55 }
 56 
 57 static void __init socfpga_arria10_init_irq(void)
 58 {
 59         irqchip_init();
 60         socfpga_sysmgr_init();
 61         if (IS_ENABLED(CONFIG_EDAC_ALTERA_L2C))
 62                 socfpga_init_arria10_l2_ecc();
 63         if (IS_ENABLED(CONFIG_EDAC_ALTERA_OCRAM))
 64                 socfpga_init_arria10_ocram_ecc();
 65         socfpga_reset_init();
 66 }
 67 
 68 static void socfpga_cyclone5_restart(enum reboot_mode mode, const char *cmd)
 69 {
 70         u32 temp;
 71 
 72         temp = readl(rst_manager_base_addr + SOCFPGA_RSTMGR_CTRL);
 73 
 74         if (mode == REBOOT_WARM)
 75                 temp |= RSTMGR_CTRL_SWWARMRSTREQ;
 76         else
 77                 temp |= RSTMGR_CTRL_SWCOLDRSTREQ;
 78         writel(temp, rst_manager_base_addr + SOCFPGA_RSTMGR_CTRL);
 79 }
 80 
 81 static void socfpga_arria10_restart(enum reboot_mode mode, const char *cmd)
 82 {
 83         u32 temp;
 84 
 85         temp = readl(rst_manager_base_addr + SOCFPGA_A10_RSTMGR_CTRL);
 86 
 87         if (mode == REBOOT_WARM)
 88                 temp |= RSTMGR_CTRL_SWWARMRSTREQ;
 89         else
 90                 temp |= RSTMGR_CTRL_SWCOLDRSTREQ;
 91         writel(temp, rst_manager_base_addr + SOCFPGA_A10_RSTMGR_CTRL);
 92 }
 93 
 94 static const char *altera_dt_match[] = {
 95         "altr,socfpga",
 96         NULL
 97 };
 98 
 99 DT_MACHINE_START(SOCFPGA, "Altera SOCFPGA")
100         .l2c_aux_val    = 0,
101         .l2c_aux_mask   = ~0,
102         .init_irq       = socfpga_init_irq,
103         .restart        = socfpga_cyclone5_restart,
104         .dt_compat      = altera_dt_match,
105 MACHINE_END
106 
107 static const char *altera_a10_dt_match[] = {
108         "altr,socfpga-arria10",
109         NULL
110 };
111 
112 DT_MACHINE_START(SOCFPGA_A10, "Altera SOCFPGA Arria10")
113         .l2c_aux_val    = 0,
114         .l2c_aux_mask   = ~0,
115         .init_irq       = socfpga_arria10_init_irq,
116         .restart        = socfpga_arria10_restart,
117         .dt_compat      = altera_a10_dt_match,
118 MACHINE_END
119 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php