Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch Move Misc Registers from mvsocreg.h to armadaxpreg....
details: https://anonhg.NetBSD.org/src/rev/0813814f8d4b
branches: trunk
changeset: 325403:0813814f8d4b
user: kiyohara <kiyohara%NetBSD.org@localhost>
date: Mon Dec 23 03:19:43 2013 +0000
description:
Move Misc Registers from mvsocreg.h to armadaxpreg.h. These registers only
Armada XP. The misc_base initializes in initarm() instead of mvsoc_bootstrap().
diffstat:
sys/arch/arm/marvell/armadaxp.c | 6 +++-
sys/arch/arm/marvell/armadaxpreg.h | 9 +++++++-
sys/arch/arm/marvell/mvsoc.c | 6 +---
sys/arch/arm/marvell/mvsocreg.h | 12 +----------
sys/arch/arm/marvell/mvsocvar.h | 6 +----
sys/arch/evbarm/armadaxp/armadaxp_machdep.c | 16 ++++++++++----
sys/arch/evbarm/marvell/marvell_machdep.c | 31 ++++++++++++++++------------
7 files changed, 45 insertions(+), 41 deletions(-)
diffs (295 lines):
diff -r f02fbe9ddae1 -r 0813814f8d4b sys/arch/arm/marvell/armadaxp.c
--- a/sys/arch/arm/marvell/armadaxp.c Mon Dec 23 02:52:47 2013 +0000
+++ b/sys/arch/arm/marvell/armadaxp.c Mon Dec 23 03:19:43 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: armadaxp.c,v 1.4 2013/11/20 12:16:47 kiyohara Exp $ */
+/* $NetBSD: armadaxp.c,v 1.5 2013/12/23 03:19:43 kiyohara Exp $ */
/*******************************************************************************
Copyright (C) Marvell International Ltd. and its affiliates
@@ -37,7 +37,7 @@
*******************************************************************************/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: armadaxp.c,v 1.4 2013/11/20 12:16:47 kiyohara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: armadaxp.c,v 1.5 2013/12/23 03:19:43 kiyohara Exp $");
#define _INTR_PRIVATE
@@ -84,6 +84,8 @@
static bus_space_handle_t mpic_handle, l2_handle;
int l2cache_state = 0;
int iocc_state = 0;
+#define read_miscreg(r) (*(volatile uint32_t *)(misc_base + (r)))
+vaddr_t misc_base;
extern void (*mvsoc_intr_init)(void);
static void armadaxp_intr_init(void);
diff -r f02fbe9ddae1 -r 0813814f8d4b sys/arch/arm/marvell/armadaxpreg.h
--- a/sys/arch/arm/marvell/armadaxpreg.h Mon Dec 23 02:52:47 2013 +0000
+++ b/sys/arch/arm/marvell/armadaxpreg.h Mon Dec 23 03:19:43 2013 +0000
@@ -180,10 +180,17 @@
#define ARMADAXP_PMU_BASE (MVSOC_DEVBUS_BASE + 0xc000)
/*
- * SoC MISC Registers
+ * Miscellanseous Register
*/
+#define ARMADAXP_MISC_BASE (MVSOC_DEVBUS_BASE + 0x8200)
+
+#define ARMADAXP_MISC_PMCGC 0x20 /* PM Clock Gating Control */
#define ARMADAXP_MISC_SAR_LO 0x30 /* Sample At Reset Low */
#define ARMADAXP_MISC_SAR_HI 0x34 /* Sample At Reset High */
+#define ARMADAXP_MISC_RSTOUTNMASKR 0x60 /* RSTOUTn Mask Register */
+#define ARMADAXP_MISC_RSTOUTNMASKR_GLOBALSOFTRSTOUTEN (1 << 0)
+#define ARMADAXP_MISC_SSRR 0x64 /* System Soft Reset Register */
+#define ARMADAXP_MISC_SSRR_GLOBALSOFTRST (1 << 0)
/* Multiprocessor Interrupt Controller Registers */
#define ARMADAXP_MLMB_MPIC_BASE 0x20a00
diff -r f02fbe9ddae1 -r 0813814f8d4b sys/arch/arm/marvell/mvsoc.c
--- a/sys/arch/arm/marvell/mvsoc.c Mon Dec 23 02:52:47 2013 +0000
+++ b/sys/arch/arm/marvell/mvsoc.c Mon Dec 23 03:19:43 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: mvsoc.c,v 1.14 2013/12/23 02:52:47 kiyohara Exp $ */
+/* $NetBSD: mvsoc.c,v 1.15 2013/12/23 03:19:43 kiyohara Exp $ */
/*
* Copyright (c) 2007, 2008 KIYOHARA Takashi
* All rights reserved.
@@ -26,7 +26,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: mvsoc.c,v 1.14 2013/12/23 02:52:47 kiyohara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mvsoc.c,v 1.15 2013/12/23 03:19:43 kiyohara Exp $");
#include "opt_cputypes.h"
#include "opt_mvsoc.h"
@@ -67,7 +67,6 @@
uint32_t mvPclk, mvSysclk, mvTclk = 0;
int nwindow = 0, nremap = 0;
static vaddr_t regbase = 0xffffffff, dsc_base, pex_base;
-vaddr_t misc_base;
vaddr_t mlmb_base;
void (*mvsoc_intr_init)(void);
@@ -846,7 +845,6 @@
regbase = iobase;
dsc_base = iobase + MVSOC_DSC_BASE;
- misc_base = iobase + MVSOC_MISC_BASE;
mlmb_base = iobase + MVSOC_MLMB_BASE;
pex_base = iobase + MVSOC_PEX_BASE;
#ifdef MVSOC_CONSOLE_EARLY
diff -r f02fbe9ddae1 -r 0813814f8d4b sys/arch/arm/marvell/mvsocreg.h
--- a/sys/arch/arm/marvell/mvsocreg.h Mon Dec 23 02:52:47 2013 +0000
+++ b/sys/arch/arm/marvell/mvsocreg.h Mon Dec 23 03:19:43 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: mvsocreg.h,v 1.6 2013/11/20 12:36:16 kiyohara Exp $ */
+/* $NetBSD: mvsocreg.h,v 1.7 2013/12/23 03:19:43 kiyohara Exp $ */
/*
* Copyright (c) 2007, 2008 KIYOHARA Takashi
* All rights reserved.
@@ -78,16 +78,6 @@
#define MVSOC_COM1_BASE (MVSOC_DEVBUS_BASE + 0x2100)
/*
- * Miscellanseous Register
- */
-#define MVSOC_MISC_BASE (MVSOC_DEVBUS_BASE + 0x8200) /* For Armada XP */
-
-#define MVSOC_MISC_RSTOUTNMASKR 0x60 /* RSTOUTn Mask Register */
-#define MVSOC_MISC_RSTOUTNMASKR_GLOBALSOFTRSTOUTEN (1 << 0)
-#define MVSOC_MISC_SSRR 0x64 /* System Soft Reset Register */
-#define MVSOC_MISC_SSRR_GLOBALSOFTRST (1 << 0)
-
-/*
* Mbus-L to Mbus Bridge Registers
*/
#define MVSOC_MLMB_BASE (UNITID2PHYS(MLMB)) /* 0x20000 */
diff -r f02fbe9ddae1 -r 0813814f8d4b sys/arch/arm/marvell/mvsocvar.h
--- a/sys/arch/arm/marvell/mvsocvar.h Mon Dec 23 02:52:47 2013 +0000
+++ b/sys/arch/arm/marvell/mvsocvar.h Mon Dec 23 03:19:43 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: mvsocvar.h,v 1.5 2013/09/30 13:12:56 kiyohara Exp $ */
+/* $NetBSD: mvsocvar.h,v 1.6 2013/12/23 03:19:43 kiyohara Exp $ */
/*
* Copyright (c) 2007, 2010 KIYOHARA Takashi
* All rights reserved.
@@ -42,16 +42,12 @@
typedef int (*mvsoc_irq_handler_t)(void *);
extern uint32_t mvPclk, mvSysclk, mvTclk;
-extern vaddr_t misc_base;
extern vaddr_t mlmb_base;
extern int nwindow, nremap;
extern int gpp_npins, gpp_irqbase;
extern struct bus_space mvsoc_bs_tag;
extern struct arm32_bus_dma_tag mvsoc_bus_dma_tag;
-#define read_miscreg(o) (*(volatile uint32_t *)(misc_base + (o)))
-#define write_miscreg(o, v) (*(volatile uint32_t *)(misc_base + (o)) = (v))
-
#define read_mlmbreg(o) (*(volatile uint32_t *)(mlmb_base + (o)))
#define write_mlmbreg(o, v) (*(volatile uint32_t *)(mlmb_base + (o)) = (v))
diff -r f02fbe9ddae1 -r 0813814f8d4b sys/arch/evbarm/armadaxp/armadaxp_machdep.c
--- a/sys/arch/evbarm/armadaxp/armadaxp_machdep.c Mon Dec 23 02:52:47 2013 +0000
+++ b/sys/arch/evbarm/armadaxp/armadaxp_machdep.c Mon Dec 23 03:19:43 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: armadaxp_machdep.c,v 1.4 2013/11/20 12:36:16 kiyohara Exp $ */
+/* $NetBSD: armadaxp_machdep.c,v 1.5 2013/12/23 03:19:43 kiyohara Exp $ */
/*******************************************************************************
Copyright (C) Marvell International Ltd. and its affiliates
@@ -37,7 +37,7 @@
*******************************************************************************/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: armadaxp_machdep.c,v 1.4 2013/11/20 12:36:16 kiyohara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: armadaxp_machdep.c,v 1.5 2013/12/23 03:19:43 kiyohara Exp $");
#include "opt_machdep.h"
#include "opt_mvsoc.h"
@@ -163,13 +163,17 @@
static void
axp_system_reset(void)
{
+ extern vaddr_t misc_base;
+
+#define write_miscreg(r, v) (*(volatile uint32_t *)(misc_base + (r)) = (v))
+
cpu_reset_address = 0;
/* Unmask soft reset */
- write_miscreg(MVSOC_MISC_RSTOUTNMASKR,
- MVSOC_MISC_RSTOUTNMASKR_GLOBALSOFTRSTOUTEN);
+ write_miscreg(ARMADAXP_MISC_RSTOUTNMASKR,
+ ARMADAXP_MISC_RSTOUTNMASKR_GLOBALSOFTRSTOUTEN);
/* Assert soft reset */
- write_miscreg(MVSOC_MISC_SSRR, MVSOC_MISC_SSRR_GLOBALSOFTRST);
+ write_miscreg(ARMADAXP_MISC_SSRR, ARMADAXP_MISC_SSRR_GLOBALSOFTRST);
while (1);
}
@@ -349,6 +353,8 @@
reset_axp_pcie_win();
/* Get CPU, system and timebase frequencies */
+ extern vaddr_t misc_base;
+ misc_base = MARVELL_INTERREGS_VBASE + ARMADAXP_MISC_BASE;
armadaxp_getclks();
/* Preconfigure interrupts */
diff -r f02fbe9ddae1 -r 0813814f8d4b sys/arch/evbarm/marvell/marvell_machdep.c
--- a/sys/arch/evbarm/marvell/marvell_machdep.c Mon Dec 23 02:52:47 2013 +0000
+++ b/sys/arch/evbarm/marvell/marvell_machdep.c Mon Dec 23 03:19:43 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: marvell_machdep.c,v 1.24 2013/11/20 12:59:21 kiyohara Exp $ */
+/* $NetBSD: marvell_machdep.c,v 1.25 2013/12/23 03:19:43 kiyohara Exp $ */
/*
* Copyright (c) 2007, 2008, 2010 KIYOHARA Takashi
* All rights reserved.
@@ -25,7 +25,7 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: marvell_machdep.c,v 1.24 2013/11/20 12:59:21 kiyohara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: marvell_machdep.c,v 1.25 2013/12/23 03:19:43 kiyohara Exp $");
#include "opt_evbarm_boardtype.h"
#include "opt_ddb.h"
@@ -134,7 +134,7 @@
#if defined(ORION) || defined(KIRKWOOD) || defined(MV78XX0)
static void
-marvell_system_reset_old(void)
+marvell_system_reset(void)
{
/* unmask soft reset */
write_mlmbreg(MVSOC_MLMB_RSTOUTNMASKR,
@@ -152,14 +152,17 @@
#if defined(ARMADAXP)
static void
-marvell_system_reset(void)
+armadaxp_system_reset(void)
{
+ extern vaddr_t misc_base;
+
+#define write_miscreg(r, v) (*(volatile uint32_t *)(misc_base + (r)) = (v))
/* Unmask soft reset */
- write_miscreg(MVSOC_MISC_RSTOUTNMASKR,
- MVSOC_MISC_RSTOUTNMASKR_GLOBALSOFTRSTOUTEN);
+ write_miscreg(ARMADAXP_MISC_RSTOUTNMASKR,
+ ARMADAXP_MISC_RSTOUTNMASKR_GLOBALSOFTRSTOUTEN);
/* Assert soft reset */
- write_miscreg(MVSOC_MISC_SSRR, MVSOC_MISC_SSRR_GLOBALSOFTRST);
+ write_miscreg(ARMADAXP_MISC_SSRR, ARMADAXP_MISC_SSRR_GLOBALSOFTRST);
while (1);
@@ -283,7 +286,7 @@
case MARVELL_ORION_1_88W8660:
case MARVELL_ORION_2_88F1281:
case MARVELL_ORION_2_88F5281:
- cpu_reset_address = marvell_system_reset_old;
+ cpu_reset_address = marvell_system_reset;
orion_intr_bootstrap();
@@ -301,7 +304,7 @@
case MARVELL_KIRKWOOD_88F6192:
case MARVELL_KIRKWOOD_88F6281:
case MARVELL_KIRKWOOD_88F6282:
- cpu_reset_address = marvell_system_reset_old;
+ cpu_reset_address = marvell_system_reset;
kirkwood_intr_bootstrap();
@@ -317,7 +320,7 @@
#ifdef MV78XX0
case MARVELL_MV78XX0_MV78100:
case MARVELL_MV78XX0_MV78200:
- cpu_reset_address = marvell_system_reset_old;
+ cpu_reset_address = marvell_system_reset;
mv78xx0_intr_bootstrap();
@@ -336,7 +339,7 @@
case MARVELL_ARMADAXP_MV78230:
case MARVELL_ARMADAXP_MV78260:
case MARVELL_ARMADAXP_MV78460:
- cpu_reset_address = marvell_system_reset;
+ cpu_reset_address = armadaxp_system_reset;
armadaxp_intr_bootstrap(MARVELL_INTERREGS_PBASE);
@@ -345,6 +348,8 @@
nwindow = ARMADAXP_MLMB_NWINDOW;
nremap = ARMADAXP_MLMB_NREMAP;
+ extern vaddr_t misc_base;
+ misc_base = MARVELL_INTERREGS_VBASE + ARMADAXP_MISC_BASE;
armadaxp_getclks();
#ifdef L2CACHE_ENABLE
@@ -355,7 +360,7 @@
(void)armadaxp_l2_init(MARVELL_INTERREGS_PBASE);
}
#endif
-
+
#ifdef AURORA_IO_CACHE_COHERENCY
/* Initialize cache coherency */
armadaxp_io_coherency_init();
@@ -469,7 +474,7 @@
extern int mvuart_cnattach(bus_space_tag_t, bus_addr_t, int,
uint32_t, int);
- if (mvuart_cnattach(&mvsoc_bs_tag,
+ if (mvuart_cnattach(&mvsoc_bs_tag,
MARVELL_INTERREGS_PBASE + MVSOC_COM0_BASE,
comcnspeed, mvTclk, comcnmode))
panic("can't init serial console");
Home |
Main Index |
Thread Index |
Old Index