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

TOMOYO Linux Cross Reference
Linux/arch/arm/mach-bcm/board_bcm281xx.c

Version: ~ [ linux-5.11-rc3 ] ~ [ linux-5.10.7 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.89 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.167 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.215 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.251 ] ~ [ linux-4.8.17 ] ~ [ linux-4.7.10 ] ~ [ linux-4.6.7 ] ~ [ linux-4.5.7 ] ~ [ linux-4.4.251 ] ~ [ 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.85 ] ~ [ 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-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  * Copyright (C) 2012-2014 Broadcom Corporation
  3  *
  4  * This program is free software; you can redistribute it and/or
  5  * modify it under the terms of the GNU General Public License as
  6  * published by the Free Software Foundation version 2.
  7  *
  8  * This program is distributed "as is" WITHOUT ANY WARRANTY of any
  9  * kind, whether express or implied; without even the implied warranty
 10  * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 11  * GNU General Public License for more details.
 12  */
 13 
 14 #include <linux/clocksource.h>
 15 #include <linux/of_address.h>
 16 
 17 #include <asm/mach/arch.h>
 18 
 19 #include "kona_l2_cache.h"
 20 
 21 #define SECWDOG_OFFSET                  0x00000000
 22 #define SECWDOG_RESERVED_MASK           0xe2000000
 23 #define SECWDOG_WD_LOAD_FLAG_MASK       0x10000000
 24 #define SECWDOG_EN_MASK                 0x08000000
 25 #define SECWDOG_SRSTEN_MASK             0x04000000
 26 #define SECWDOG_CLKS_SHIFT              20
 27 #define SECWDOG_COUNT_SHIFT             0
 28 
 29 static void bcm281xx_restart(enum reboot_mode mode, const char *cmd)
 30 {
 31         uint32_t val;
 32         void __iomem *base;
 33         struct device_node *np_wdog;
 34 
 35         np_wdog = of_find_compatible_node(NULL, NULL, "brcm,kona-wdt");
 36         if (!np_wdog) {
 37                 pr_emerg("Couldn't find brcm,kona-wdt\n");
 38                 return;
 39         }
 40         base = of_iomap(np_wdog, 0);
 41         if (!base) {
 42                 pr_emerg("Couldn't map brcm,kona-wdt\n");
 43                 return;
 44         }
 45 
 46         /* Enable watchdog with short timeout (244us). */
 47         val = readl(base + SECWDOG_OFFSET);
 48         val &= SECWDOG_RESERVED_MASK | SECWDOG_WD_LOAD_FLAG_MASK;
 49         val |= SECWDOG_EN_MASK | SECWDOG_SRSTEN_MASK |
 50                 (0x15 << SECWDOG_CLKS_SHIFT) |
 51                 (0x8 << SECWDOG_COUNT_SHIFT);
 52         writel(val, base + SECWDOG_OFFSET);
 53 
 54         /* Wait for reset */
 55         while (1);
 56 }
 57 
 58 static void __init bcm281xx_init(void)
 59 {
 60         kona_l2_cache_init();
 61 }
 62 
 63 static const char * const bcm281xx_dt_compat[] = {
 64         "brcm,bcm11351",        /* Have to use the first number upstreamed */
 65         NULL,
 66 };
 67 
 68 DT_MACHINE_START(BCM281XX_DT, "BCM281xx Broadcom Application Processor")
 69         .init_machine = bcm281xx_init,
 70         .restart = bcm281xx_restart,
 71         .dt_compat = bcm281xx_dt_compat,
 72 MACHINE_END
 73 

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