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

TOMOYO Linux Cross Reference
Linux/arch/arm/mach-integrator/core.c

Version: ~ [ linux-5.2-rc6 ] ~ [ linux-5.1.15 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.56 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.130 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.183 ] ~ [ linux-4.8.17 ] ~ [ linux-4.7.10 ] ~ [ linux-4.6.7 ] ~ [ linux-4.5.7 ] ~ [ linux-4.4.183 ] ~ [ linux-4.3.6 ] ~ [ linux-4.2.8 ] ~ [ linux-4.1.52 ] ~ [ linux-4.0.9 ] ~ [ linux-3.19.8 ] ~ [ linux-3.18.140 ] ~ [ linux-3.17.8 ] ~ [ linux-3.16.69 ] ~ [ linux-3.15.10 ] ~ [ linux-3.14.79 ] ~ [ linux-3.13.11 ] ~ [ linux-3.12.74 ] ~ [ linux-3.11.10 ] ~ [ linux-3.10.108 ] ~ [ linux-3.9.11 ] ~ [ linux-3.8.13 ] ~ [ linux-3.7.10 ] ~ [ linux-3.6.11 ] ~ [ linux-3.5.7 ] ~ [ linux-3.4.113 ] ~ [ linux-3.3.8 ] ~ [ linux-3.2.102 ] ~ [ linux-3.1.10 ] ~ [ linux-3.0.101 ] ~ [ linux-2.6.39.4 ] ~ [ linux-2.6.38.8 ] ~ [ linux-2.6.37.6 ] ~ [ linux-2.6.36.4 ] ~ [ linux-2.6.35.14 ] ~ [ linux-2.6.34.15 ] ~ [ linux-2.6.33.20 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.5 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

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

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

kernel.org | git.kernel.org | LWN.net | Project Home | Wiki (Japanese) | Wiki (English) | 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.

osdn.jp