Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 638e2226 authored by Abhimanyu Kapur's avatar Abhimanyu Kapur
Browse files

hvc_dcc: Add support for arm64 cpus



Split out the architecture debug channel register
reads/writes to arch specifc header files and add
support for arm64 dcc operations.

Change-Id: I48df3a1470760ebaa57eafd5a1f3e8cc9c7bd826
Signed-off-by: default avatarAbhimanyu Kapur <abhimany@codeaurora.org>
parent 609c8181
Loading
Loading
Loading
Loading
+42 −0
Original line number Original line Diff line number Diff line
/* Copyright (c) 2012-2014 The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
 * only version 2 as published by the Free Software Foundation.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 */

#include <asm/barrier.h>

static inline u32 __dcc_getstatus(void)
{
	u32 __ret;
	asm volatile("mrc p14, 0, %0, c0, c1, 0	@ read comms ctrl reg"
		: "=r" (__ret) : : "cc");

	return __ret;
}


static inline char __dcc_getchar(void)
{
	char __c;

	asm volatile("mrc p14, 0, %0, c0, c5, 0	@ read comms data reg"
		: "=r" (__c));
	isb();

	return __c;
}

static inline void __dcc_putchar(char c)
{
	asm volatile("mcr p14, 0, %0, c0, c5, 0	@ write a char"
		: /* no output register */
		: "r" (c));
	isb();
}
+41 −0
Original line number Original line Diff line number Diff line
/* Copyright (c) 2014 The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
 * only version 2 as published by the Free Software Foundation.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 */

#include <asm/barrier.h>

static inline u32 __dcc_getstatus(void)
{
	u32 __ret;
	asm volatile("mrs %0, mdccsr_el0" : "=r" (__ret)
			: : "cc");

	return __ret;
}


static inline char __dcc_getchar(void)
{
	char __c;

	asm volatile("mrs %0, dbgdtrrx_el0" : "=r" (__c));
	isb();

	return __c;
}

static inline void __dcc_putchar(char c)
{
	asm volatile("msr dbgdtrtx_el0, %0"
		: /* No output register */
		: "r" (c));
	isb();
}
+7 −5
Original line number Original line Diff line number Diff line
@@ -87,13 +87,15 @@ config HVC_UDBG
	 console for userspace. Do NOT enable in production kernels. 
	 console for userspace. Do NOT enable in production kernels. 


config HVC_DCC
config HVC_DCC
       bool "ARM JTAG DCC console"
       bool "ARM/ARM64 JTAG DCC console"
       depends on ARM
       depends on ARM || ARM64
       select HVC_DRIVER
       select HVC_DRIVER
       help
       help
         This console uses the JTAG DCC on ARM to create a console under the HVC
         This console uses the JTAG DCC on ARM/ARM64
	 driver. This console is used through a JTAG only on ARM. If you don't have
	 to create a console under the HVC
	 a JTAG then you probably don't want this option.
	 driver. This console is used through a JTAG
	 only on ARM/ARM64. If you don't have a JTAG then
	 you probably don't want this option.


config HVC_BFIN_JTAG
config HVC_BFIN_JTAG
	bool "Blackfin JTAG console"
	bool "Blackfin JTAG console"
+2 −34
Original line number Original line Diff line number Diff line
/* Copyright (c) 2010, The Linux Foundation. All rights reserved.
/* Copyright (c) 2010, 2014 The Linux Foundation. All rights reserved.
 *
 *
 * This program is free software; you can redistribute it and/or modify
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
 * it under the terms of the GNU General Public License version 2 and
@@ -11,12 +11,9 @@
 */
 */


#include <linux/console.h>
#include <linux/console.h>
#include <linux/delay.h>
#include <linux/err.h>
#include <linux/init.h>
#include <linux/init.h>
#include <linux/moduleparam.h>
#include <linux/types.h>


#include <asm/dcc.h>
#include <asm/processor.h>
#include <asm/processor.h>


#include "hvc_console.h"
#include "hvc_console.h"
@@ -25,35 +22,6 @@
#define DCC_STATUS_RX		(1 << 30)
#define DCC_STATUS_RX		(1 << 30)
#define DCC_STATUS_TX		(1 << 29)
#define DCC_STATUS_TX		(1 << 29)


static inline u32 __dcc_getstatus(void)
{
	u32 __ret;
	asm volatile("mrc p14, 0, %0, c0, c1, 0	@ read comms ctrl reg"
		: "=r" (__ret) : : "cc");

	return __ret;
}


static inline char __dcc_getchar(void)
{
	char __c;

	asm volatile("mrc p14, 0, %0, c0, c5, 0	@ read comms data reg"
		: "=r" (__c));
	isb();

	return __c;
}

static inline void __dcc_putchar(char c)
{
	asm volatile("mcr p14, 0, %0, c0, c5, 0	@ write a char"
		: /* no output register */
		: "r" (c));
	isb();
}

static int hvc_dcc_put_chars(uint32_t vt, const char *buf, int count)
static int hvc_dcc_put_chars(uint32_t vt, const char *buf, int count)
{
{
	int i;
	int i;