xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Bamvor Jian Zhang <bjzhang@suse.com>
To: xen-devel@lists.xen.org
Cc: bjzhang@suse.com, andre.przywara@calxeda.com,
	julien.grall@linaro.org, ian.campbell@citrix.com,
	Stefano.Stabellini@eu.citrix.com
Subject: [PATCH 2/4] xen/arm: introduce Allwinner sun6i SOC basic support
Date: Fri, 31 May 2013 20:53:32 +0800	[thread overview]
Message-ID: <1370004814-30686-3-git-send-email-bjzhang@suse.com> (raw)
In-Reply-To: <1370004814-30686-1-git-send-email-bjzhang@suse.com>

Allwinner A31(code name sun6i) is a quad-core Cortex-A7 SOC. Allwinner has
released the source code in http://git.rhombus-tech.net.

This patch define registers and macros for early printk and mode switch.
kick cpu is not implemneted yet. because the secondary cpu boot up
sequence is a little bit different from exynos5.

Signed-off-by: Bamvor Jian Zhang <bjzhang@suse.com>
---
 xen/arch/arm/arm32/debug-sun6i.inc    | 50 +++++++++++++++++++++++++++++++++++
 xen/include/asm-arm/platforms/sun6i.h | 28 ++++++++++++++++++++
 2 files changed, 78 insertions(+)
 create mode 100644 xen/arch/arm/arm32/debug-sun6i.inc
 create mode 100644 xen/include/asm-arm/platforms/sun6i.h

diff --git a/xen/arch/arm/arm32/debug-sun6i.inc b/xen/arch/arm/arm32/debug-sun6i.inc
new file mode 100644
index 0000000..eaa1197
--- /dev/null
+++ b/xen/arch/arm/arm32/debug-sun6i.inc
@@ -0,0 +1,50 @@
+/*
+ * xen/arch/arm/arm32/debug-sun6i.inc
+ *
+ * Allwinner sun6i specific debug code
+ *
+ * Bamvor Jian Zhang <bjzhang@suse.com>
+ * Copyright (c) 2013 SUSE
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * 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.
+ */
+
+/* sun6i UART initialization
+ * rb: register which contains the UART base address
+ * rc: scratch register 1 (unused here)
+ * rd: scratch register 2 (unused here) */
+.macro early_uart_init rb, rc, rd
+/* assume the uart already init by bootloader */
+.endm
+
+/* sun6i UART wait UART to be ready to transmit
+ * rb: register which contains the UART base address
+ * rc: scratch register */
+.macro early_uart_ready rb, rc
+1:
+        ldr   \rc, [\rb, #0x7c]     /* <- UART_USR (Status Register) */
+        tst   \rc, #0x2             /* Check BUSY bit */
+        beq   1b                    /* Wait for the UART to be ready */
+.endm
+
+/* sun6i UART transmit character
+ * rb: register which contains the UART base address
+ * rt: register which contains the character to transmit */
+.macro early_uart_transmit rb, rt
+        str   \rt, [\rb]            /* -> UART_THR (Transmit Holding Register) */
+.endm
+
+/*
+ * Local variables:
+ * mode: ASM
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/xen/include/asm-arm/platforms/sun6i.h b/xen/include/asm-arm/platforms/sun6i.h
new file mode 100644
index 0000000..f910ad6
--- /dev/null
+++ b/xen/include/asm-arm/platforms/sun6i.h
@@ -0,0 +1,28 @@
+#ifndef __ASM_ARM_PLATFORMS_SUN6I_H
+#define __ASM_ASM_PLATFORMS_SUN6I_H
+
+/* Constants below is only used in assembly because the DTS is not yet parsed */
+#ifdef __ASSEMBLY__
+
+/* GIC Base Address */
+#define SUN6I_GIC_BASE_ADDRESS       0x01c82000
+
+/* Timer's frequency */
+/* \TODO I do not know yet, assume it 24MHz. check it later */
+#define SUN6I_TIMER_FREQUENCY       (24 * 1000 * 1000) /* 24 MHz */
+
+/* Arndale machine ID */
+/* XXX 3894 is downstream number for sun6i. 4137 is upstream number for sun6i */
+#define MACH_TYPE_SUN6I             4137
+
+#endif /* __ASSEMBLY__ */
+
+#endif /* __ASM_ARM_PLATFORMS_SUN6I_H */
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
-- 
1.8.1.4

  parent reply	other threads:[~2013-05-31 12:53 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-31 12:53 [PATCH 0/4] xen/arm: assemble support for Allwinner A31 Bamvor Jian Zhang
2013-05-31 12:53 ` [PATCH 1/4] xen/arm: introduce Cortex-A7 support Bamvor Jian Zhang
2013-06-12  9:57   ` Ian Campbell
2013-06-18  6:34     ` Bamvor Jian Zhang
2013-06-18  9:24       ` Ian Campbell
2013-05-31 12:53 ` Bamvor Jian Zhang [this message]
2013-06-12 10:17   ` [PATCH 2/4] xen/arm: introduce Allwinner sun6i SOC basic support Ian Campbell
2013-06-18  6:35     ` Bamvor Jian Zhang
2013-06-18  9:53       ` Ian Campbell
2013-06-18 10:23         ` Bamvor Jian Zhang
2013-05-31 12:53 ` [PATCH 3/4] xen/arm: enable early printk for sun6i Bamvor Jian Zhang
2013-06-12 10:17   ` Ian Campbell
2013-06-18  6:35     ` ReL " Bamvor Jian Zhang
2013-06-18  9:54       ` Ian Campbell
2013-06-18  6:49     ` Bamvor Jian Zhang
2013-05-31 12:53 ` [PATCH 4/4] xen/arm: enable switch to hyper mode " Bamvor Jian Zhang
2013-06-12 10:17   ` Ian Campbell
2013-06-18  6:38     ` Bamvor Jian Zhang
2013-06-18 10:00       ` Ian Campbell
2013-06-18 10:39         ` Bamvor Jian Zhang
2013-06-18 10:45           ` Ian Campbell
2013-05-31 15:14 ` [PATCH 0/4] xen/arm: assemble support for Allwinner A31 Ian Campbell
2013-05-31 15:49   ` Bamvor Jian Zhang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1370004814-30686-3-git-send-email-bjzhang@suse.com \
    --to=bjzhang@suse.com \
    --cc=Stefano.Stabellini@eu.citrix.com \
    --cc=andre.przywara@calxeda.com \
    --cc=ian.campbell@citrix.com \
    --cc=julien.grall@linaro.org \
    --cc=xen-devel@lists.xen.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).