uboot/arch/arm/cpu/arm920t/ep93xx/cpu.c
<<
>>
Prefs
   1// SPDX-License-Identifier: GPL-2.0+
   2/*
   3 * Cirrus Logic EP93xx CPU-specific support.
   4 *
   5 * Copyright (C) 2009 Matthias Kaehlcke <matthias@kaehlcke.net>
   6 *
   7 * Copyright (C) 2004, 2005
   8 * Cory T. Tusar, Videon Central, Inc., <ctusar@videon-central.com>
   9 */
  10
  11#include <common.h>
  12#include <cpu_func.h>
  13#include <asm/arch/ep93xx.h>
  14#include <asm/io.h>
  15
  16/* We reset the CPU by generating a 1-->0 transition on DeviceCfg bit 31. */
  17extern void reset_cpu(void)
  18{
  19        struct syscon_regs *syscon = (struct syscon_regs *)SYSCON_BASE;
  20        uint32_t value;
  21
  22        /* Unlock DeviceCfg and set SWRST */
  23        writel(0xAA, &syscon->sysswlock);
  24        value = readl(&syscon->devicecfg);
  25        value |= SYSCON_DEVICECFG_SWRST;
  26        writel(value, &syscon->devicecfg);
  27
  28        /* Unlock DeviceCfg and clear SWRST */
  29        writel(0xAA, &syscon->sysswlock);
  30        value = readl(&syscon->devicecfg);
  31        value &= ~SYSCON_DEVICECFG_SWRST;
  32        writel(value, &syscon->devicecfg);
  33
  34        /* Dying... */
  35        while (1)
  36                ; /* noop */
  37}
  38