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

TOMOYO Linux Cross Reference
Linux/arch/arm/mach-versatile/integrator.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-only
  2 /*
  3  *  Copyright (C) 2000-2003 Deep Blue Solutions Ltd
  4  */
  5 #include <linux/types.h>
  6 #include <linux/kernel.h>
  7 #include <linux/init.h>
  8 #include <linux/device.h>
  9 #include <linux/export.h>
 10 #include <linux/spinlock.h>
 11 #include <linux/interrupt.h>
 12 #include <linux/irq.h>
 13 #include <linux/memblock.h>
 14 #include <linux/sched.h>
 15 #include <linux/smp.h>
 16 #include <linux/amba/bus.h>
 17 #include <linux/amba/serial.h>
 18 #include <linux/io.h>
 19 #include <linux/stat.h>
 20 #include <linux/of.h>
 21 #include <linux/of_address.h>
 22 #include <linux/pgtable.h>
 23 
 24 #include <asm/mach-types.h>
 25 #include <asm/mach/time.h>
 26 
 27 #include "integrator-hardware.h"
 28 #include "integrator-cm.h"
 29 #include "integrator.h"
 30 
 31 static DEFINE_RAW_SPINLOCK(cm_lock);
 32 static void __iomem *cm_base;
 33 
 34 /**
 35  * cm_get - get the value from the CM_CTRL register
 36  */
 37 u32 cm_get(void)
 38 {
 39         return readl(cm_base + INTEGRATOR_HDR_CTRL_OFFSET);
 40 }
 41 
 42 /**
 43  * cm_control - update the CM_CTRL register.
 44  * @mask: bits to change
 45  * @set: bits to set
 46  */
 47 void cm_control(u32 mask, u32 set)
 48 {
 49         unsigned long flags;
 50         u32 val;
 51 
 52         raw_spin_lock_irqsave(&cm_lock, flags);
 53         val = readl(cm_base + INTEGRATOR_HDR_CTRL_OFFSET) & ~mask;
 54         writel(val | set, cm_base + INTEGRATOR_HDR_CTRL_OFFSET);
 55         raw_spin_unlock_irqrestore(&cm_lock, flags);
 56 }
 57 
 58 void cm_clear_irqs(void)
 59 {
 60         /* disable core module IRQs */
 61         writel(0xffffffffU, cm_base + INTEGRATOR_HDR_IC_OFFSET +
 62                 IRQ_ENABLE_CLEAR);
 63 }
 64 
 65 static const struct of_device_id cm_match[] = {
 66         { .compatible = "arm,core-module-integrator"},
 67         { },
 68 };
 69 
 70 void cm_init(void)
 71 {
 72         struct device_node *cm = of_find_matching_node(NULL, cm_match);
 73 
 74         if (!cm) {
 75                 pr_crit("no core module node found in device tree\n");
 76                 return;
 77         }
 78         cm_base = of_iomap(cm, 0);
 79         if (!cm_base) {
 80                 pr_crit("could not remap core module\n");
 81                 return;
 82         }
 83         cm_clear_irqs();
 84 }
 85 
 86 /*
 87  * We need to stop things allocating the low memory; ideally we need a
 88  * better implementation of GFP_DMA which does not assume that DMA-able
 89  * memory starts at zero.
 90  */
 91 void __init integrator_reserve(void)
 92 {
 93         memblock_reserve(PHYS_OFFSET, __pa(swapper_pg_dir) - PHYS_OFFSET);
 94 }
 95 

~ [ 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