mirror of
https://github.com/u-boot/u-boot.git
synced 2025-05-08 19:11:53 +00:00
ARM: uniphier: add PSCI support for UniPhier ARMv7 SoCs
Currently, only the CPU_ON function is supported. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
This commit is contained in:
parent
ee9bc77f3a
commit
e8a9293295
8 changed files with 275 additions and 3 deletions
68
arch/arm/mach-uniphier/debug.h
Normal file
68
arch/arm/mach-uniphier/debug.h
Normal file
|
@ -0,0 +1,68 @@
|
|||
/*
|
||||
* Copyright (C) 2016 Socionext Inc.
|
||||
* Author: Masahiro Yamada <yamada.masahiro@socionext.com>
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
|
||||
#ifndef __DEBUG_H__
|
||||
#define __DEBUG_H__
|
||||
|
||||
#include <linux/io.h>
|
||||
#include <linux/serial_reg.h>
|
||||
|
||||
#define DEBUG_UART_BASE 0x54006800
|
||||
#define UART_SHIFT 2
|
||||
|
||||
#define UNIPHIER_UART_TX 0
|
||||
#define UNIPHIER_UART_LSR (5 * 4)
|
||||
|
||||
/* All functions are inline so that they can be called from .secure section. */
|
||||
|
||||
#ifdef DEBUG
|
||||
static inline void debug_putc(int c)
|
||||
{
|
||||
void __iomem *base = (void __iomem *)DEBUG_UART_BASE;
|
||||
|
||||
while (!(readl(base + UNIPHIER_UART_LSR) & UART_LSR_THRE))
|
||||
;
|
||||
|
||||
writel(c, base + UNIPHIER_UART_TX);
|
||||
}
|
||||
|
||||
static inline void debug_puts(const char *s)
|
||||
{
|
||||
while (*s) {
|
||||
if (*s == '\n')
|
||||
debug_putc('\r');
|
||||
|
||||
debug_putc(*s++);
|
||||
}
|
||||
}
|
||||
|
||||
static inline void debug_puth(unsigned long val)
|
||||
{
|
||||
int i;
|
||||
unsigned char c;
|
||||
|
||||
for (i = 8; i--; ) {
|
||||
c = ((val >> (i * 4)) & 0xf);
|
||||
c += (c >= 10) ? 'a' - 10 : '0';
|
||||
debug_putc(c);
|
||||
}
|
||||
}
|
||||
#else
|
||||
static inline void debug_putc(int c)
|
||||
{
|
||||
}
|
||||
|
||||
static inline void debug_puts(const char *s)
|
||||
{
|
||||
}
|
||||
|
||||
static inline void debug_puth(unsigned long val)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __DEBUG_H__ */
|
Loading…
Add table
Add a link
Reference in a new issue