Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch Switch to armv7_generic bus_space.
details: https://anonhg.NetBSD.org/src/rev/516a1a144179
branches: trunk
changeset: 337563:516a1a144179
user: matt <matt%NetBSD.org@localhost>
date: Mon Apr 20 01:33:22 2015 +0000
description:
Switch to armv7_generic bus_space.
diffstat:
sys/arch/arm/allwinner/awin_board.c | 55 ++--
sys/arch/arm/allwinner/awin_gpio.c | 8 +-
sys/arch/arm/allwinner/awin_io.c | 6 +-
sys/arch/arm/allwinner/awin_space.c | 416 ------------------------------------
sys/arch/arm/allwinner/awin_var.h | 6 +-
sys/arch/arm/allwinner/awin_wdt.c | 11 +-
sys/arch/arm/allwinner/files.awin | 4 +-
sys/arch/evbarm/awin/awin_machdep.c | 8 +-
8 files changed, 51 insertions(+), 463 deletions(-)
diffs (truncated from 814 to 300 lines):
diff -r 70c234f3ab01 -r 516a1a144179 sys/arch/arm/allwinner/awin_board.c
--- a/sys/arch/arm/allwinner/awin_board.c Mon Apr 20 00:11:27 2015 +0000
+++ b/sys/arch/arm/allwinner/awin_board.c Mon Apr 20 01:33:22 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: awin_board.c,v 1.34 2014/12/22 00:07:24 jmcneill Exp $ */
+/* $NetBSD: awin_board.c,v 1.35 2015/04/20 01:33:22 matt Exp $ */
/*-
* Copyright (c) 2012 The NetBSD Foundation, Inc.
* All rights reserved.
@@ -36,7 +36,7 @@
#include <sys/cdefs.h>
-__KERNEL_RCSID(1, "$NetBSD: awin_board.c,v 1.34 2014/12/22 00:07:24 jmcneill Exp $");
+__KERNEL_RCSID(1, "$NetBSD: awin_board.c,v 1.35 2015/04/20 01:33:22 matt Exp $");
#include <sys/param.h>
#include <sys/bus.h>
@@ -128,9 +128,10 @@
awin_cpu_clk(void)
{
struct cpu_info * const ci = curcpu();
+ bus_space_tag_t bst = &armv7_generic_bs_tag;
#if defined(ALLWINNER_A80)
- const uint32_t c0cpux = bus_space_read_4(&awin_bs_tag, awin_core_bsh,
+ const uint32_t c0cpux = bus_space_read_4(bst, awin_core_bsh,
AWIN_A80_CCU_OFFSET + AWIN_A80_CCU_PLL_C0CPUX_CTRL_REG);
const u_int p = (c0cpux & AWIN_A80_CCU_PLL_CxCPUX_OUT_EXT_DIVP) ? 4 : 1;
const u_int n = __SHIFTOUT(c0cpux, AWIN_A80_CCU_PLL_CxCPUX_FACTOR_N);
@@ -140,7 +141,7 @@
u_int reg = awin_chip_id() == AWIN_CHIP_ID_A31 ?
AWIN_A31_CPU_AXI_CFG_REG :
AWIN_CPU_AHB_APB0_CFG_REG;
- const uint32_t cpu0_cfg = bus_space_read_4(&awin_bs_tag, awin_core_bsh,
+ const uint32_t cpu0_cfg = bus_space_read_4(bst, awin_core_bsh,
AWIN_CCM_OFFSET + reg);
const u_int cpu_clk_sel = __SHIFTIN(cpu0_cfg, AWIN_CPU_CLK_SRC_SEL);
switch (__SHIFTOUT(cpu_clk_sel, AWIN_CPU_CLK_SRC_SEL)) {
@@ -151,7 +152,7 @@
ci->ci_data.cpu_cc_freq = AWIN_REF_FREQ;
break;
case AWIN_CPU_CLK_SRC_SEL_PLL1: {
- const uint32_t pll1_cfg = bus_space_read_4(&awin_bs_tag,
+ const uint32_t pll1_cfg = bus_space_read_4(bst,
awin_core_bsh, AWIN_CCM_OFFSET + AWIN_PLL1_CFG_REG);
u_int p, n, k, m;
if (awin_chip_id() == AWIN_CHIP_ID_A31) {
@@ -180,6 +181,7 @@
awin_bootstrap(vaddr_t iobase, vaddr_t uartbase)
{
int error;
+ bus_space_tag_t bst = &armv7_generic_bs_tag;
#ifdef AWIN_CONSOLE_EARLY
uart_base = (volatile uint32_t *)uartbase;
@@ -187,21 +189,21 @@
printf("Early console started\n");
#endif
- error = bus_space_map(&awin_bs_tag, AWIN_CORE_PBASE,
- AWIN_CORE_SIZE, 0, &awin_core_bsh);
+ error = bus_space_map(bst, AWIN_CORE_PBASE, AWIN_CORE_SIZE,
+ 0, &awin_core_bsh);
if (error)
panic("%s: failed to map awin %s registers: %d",
__func__, "io", error);
KASSERT(awin_core_bsh == iobase);
#ifdef ALLWINNER_A80
- error = bus_space_map(&awin_bs_tag, AWIN_A80_CORE2_PBASE,
- AWIN_A80_CORE2_SIZE, 0, &awin_core2_bsh);
+ error = bus_space_map(bst, AWIN_A80_CORE2_PBASE, AWIN_A80_CORE2_SIZE,
+ 0, &awin_core2_bsh);
if (error)
panic("%s: failed to map awin %s registers: %d",
__func__, "core2", error);
- error = bus_space_map(&awin_bs_tag, AWIN_A80_RCPUS_PBASE,
- AWIN_A80_RCPUS_SIZE, 0, &awin_rcpus_bsh);
+ error = bus_space_map(bst, AWIN_A80_RCPUS_PBASE, AWIN_A80_RCPUS_SIZE,
+ 0, &awin_rcpus_bsh);
if (error)
panic("%s: failed to map awin %s registers: %d",
__func__, "rcpus", error);
@@ -228,16 +230,16 @@
uint32_t s[4];
unsigned int cpuno;
for (cpuno = 0; cpuno < 4; cpuno++) {
- s[cpuno] = bus_space_read_4(&awin_bs_tag, awin_core_bsh,
+ s[cpuno] = bus_space_read_4(bst, awin_core_bsh,
AWIN_A31_CPUCFG_OFFSET +
AWIN_A31_CPUCFG_STATUS_REG(cpuno));
}
printf("%s: cpu status: 0=%#x 1=%#x 2=%#x 3=%#x\n", __func__,
s[0], s[1], s[2], s[3]);
} else if (awin_chip_id() == AWIN_CHIP_ID_A20) {
- uint32_t s0 = bus_space_read_4(&awin_bs_tag, awin_core_bsh,
+ uint32_t s0 = bus_space_read_4(bst, awin_core_bsh,
AWIN_CPUCFG_OFFSET + AWIN_CPUCFG_CPU0_STATUS_REG);
- uint32_t s1 = bus_space_read_4(&awin_bs_tag, awin_core_bsh,
+ uint32_t s1 = bus_space_read_4(bst, awin_core_bsh,
AWIN_CPUCFG_OFFSET + AWIN_CPUCFG_CPU1_STATUS_REG);
printf("%s: cpu status: 0=%#x 1=%#x\n", __func__, s0, s1);
}
@@ -287,7 +289,7 @@
#endif
memsize = 0;
} else {
- const uint32_t dcr = bus_space_read_4(&awin_bs_tag,
+ const uint32_t dcr = bus_space_read_4(&armv7_generic_bs_tag,
awin_core_bsh,
AWIN_DRAM_OFFSET + AWIN_DRAM_DCR_REG);
@@ -306,6 +308,7 @@
uint16_t
awin_chip_id(void)
{
+ bus_space_tag_t bst = &armv7_generic_bs_tag;
#if defined(ALLWINNER_A80)
bus_space_handle_t bsh = awin_core2_bsh;
#else
@@ -315,12 +318,12 @@
uint32_t ver;
if (!chip_id) {
- ver = bus_space_read_4(&awin_bs_tag, bsh,
+ ver = bus_space_read_4(bst, bsh,
AWIN_SRAM_OFFSET + AWIN_SRAM_VER_REG);
ver |= AWIN_SRAM_VER_R_EN;
- bus_space_write_4(&awin_bs_tag, bsh,
+ bus_space_write_4(bst, bsh,
AWIN_SRAM_OFFSET + AWIN_SRAM_VER_REG, ver);
- ver = bus_space_read_4(&awin_bs_tag, bsh,
+ ver = bus_space_read_4(bst, bsh,
AWIN_SRAM_OFFSET + AWIN_SRAM_VER_REG);
chip_id = __SHIFTOUT(ver, AWIN_SRAM_VER_KEY_FIELD);
@@ -348,7 +351,7 @@
void
awin_pll6_enable(void)
{
- bus_space_tag_t bst = &awin_bs_tag;
+ bus_space_tag_t bst = &armv7_generic_bs_tag;
bus_space_handle_t bsh = awin_core_bsh;
KASSERT(awin_chip_id() != AWIN_CHIP_ID_A80);
@@ -400,7 +403,7 @@
void
awin_pll2_enable(void)
{
- bus_space_tag_t bst = &awin_bs_tag;
+ bus_space_tag_t bst = &armv7_generic_bs_tag;
bus_space_handle_t bsh = awin_core_bsh;
/*
@@ -445,7 +448,7 @@
void
awin_pll3_enable(void)
{
- bus_space_tag_t bst = &awin_bs_tag;
+ bus_space_tag_t bst = &armv7_generic_bs_tag;
bus_space_handle_t bsh = awin_core_bsh;
/*
@@ -483,7 +486,7 @@
void
awin_pll7_enable(void)
{
- bus_space_tag_t bst = &awin_bs_tag;
+ bus_space_tag_t bst = &armv7_generic_bs_tag;
bus_space_handle_t bsh = awin_core_bsh;
/*
@@ -521,7 +524,7 @@
void
awin_pll3_set_rate(uint32_t rate)
{
- bus_space_tag_t bst = &awin_bs_tag;
+ bus_space_tag_t bst = &armv7_generic_bs_tag;
bus_space_handle_t bsh = awin_core_bsh;
const uint32_t ocfg = bus_space_read_4(bst, bsh,
@@ -564,7 +567,7 @@
uint32_t
awin_pll5x_get_rate(void)
{
- bus_space_tag_t bst = &awin_bs_tag;
+ bus_space_tag_t bst = &armv7_generic_bs_tag;
bus_space_handle_t bsh = awin_core_bsh;
unsigned int n, k, p;
@@ -584,7 +587,7 @@
uint32_t
awin_pll6_get_rate(void)
{
- bus_space_tag_t bst = &awin_bs_tag;
+ bus_space_tag_t bst = &armv7_generic_bs_tag;
bus_space_handle_t bsh = awin_core_bsh;
unsigned int n, k, m;
@@ -609,7 +612,7 @@
uint32_t
awin_periph0_get_rate(void)
{
- bus_space_tag_t bst = &awin_bs_tag;
+ bus_space_tag_t bst = &armv7_generic_bs_tag;
bus_space_handle_t bsh = awin_core_bsh;
unsigned int n, idiv, odiv;
diff -r 70c234f3ab01 -r 516a1a144179 sys/arch/arm/allwinner/awin_gpio.c
--- a/sys/arch/arm/allwinner/awin_gpio.c Mon Apr 20 00:11:27 2015 +0000
+++ b/sys/arch/arm/allwinner/awin_gpio.c Mon Apr 20 01:33:22 2015 +0000
@@ -35,7 +35,7 @@
#include <sys/cdefs.h>
-__KERNEL_RCSID(1, "$NetBSD: awin_gpio.c,v 1.17 2015/03/15 13:15:26 jmcneill Exp $");
+__KERNEL_RCSID(1, "$NetBSD: awin_gpio.c,v 1.18 2015/04/20 01:33:22 matt Exp $");
#include <sys/param.h>
#include <sys/bus.h>
@@ -245,7 +245,7 @@
bus_space_tag_t sc_bst;
bus_space_handle_t sc_bsh;
} awin_gpio_sc = {
- .sc_bst = &awin_bs_tag,
+ .sc_bst = &armv7_generic_bs_tag,
};
CFATTACH_DECL_NEW(awin_gpio, sizeof(struct awin_gpio_softc),
@@ -660,7 +660,7 @@
/*
* Now update any config register that changed.
*/
- awin_gpio_update_cfg_regs(&awin_bs_tag, grp, &ncfg);
+ awin_gpio_update_cfg_regs(&armv7_generic_bs_tag, grp, &ncfg);
/*
* Mark all these pins as in use.
@@ -754,7 +754,7 @@
/*
* Now update any config register that changed.
*/
- awin_gpio_update_cfg_regs(&awin_bs_tag, grp, &ncfg);
+ awin_gpio_update_cfg_regs(&armv7_generic_bs_tag, grp, &ncfg);
}
bool
diff -r 70c234f3ab01 -r 516a1a144179 sys/arch/arm/allwinner/awin_io.c
--- a/sys/arch/arm/allwinner/awin_io.c Mon Apr 20 00:11:27 2015 +0000
+++ b/sys/arch/arm/allwinner/awin_io.c Mon Apr 20 01:33:22 2015 +0000
@@ -31,7 +31,7 @@
#include <sys/cdefs.h>
-__KERNEL_RCSID(1, "$NetBSD: awin_io.c,v 1.42 2014/12/23 13:34:40 jmcneill Exp $");
+__KERNEL_RCSID(1, "$NetBSD: awin_io.c,v 1.43 2015/04/20 01:33:22 matt Exp $");
#include <sys/param.h>
#include <sys/bus.h>
@@ -219,8 +219,8 @@
sc->sc_dev = self;
- sc->sc_bst = &awin_bs_tag;
- sc->sc_a4x_bst = &awin_a4x_bs_tag;
+ sc->sc_bst = &armv7_generic_bs_tag;
+ sc->sc_a4x_bst = &armv7_generic_a4x_bs_tag;
sc->sc_bsh = awin_core_bsh;
sc->sc_dmat = &awin_dma_tag;
sc->sc_coherent_dmat = &awin_coherent_dma_tag;
diff -r 70c234f3ab01 -r 516a1a144179 sys/arch/arm/allwinner/awin_space.c
--- a/sys/arch/arm/allwinner/awin_space.c Mon Apr 20 00:11:27 2015 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,416 +0,0 @@
-/* $NetBSD: awin_space.c,v 1.4 2015/02/25 13:52:42 joerg Exp $ */
-
-/*-
- * Copyright (c) 2012 The NetBSD Foundation, Inc.
- * All rights reserved.
- *
- * This code is derived from software contributed to The NetBSD Foundation
- * by Nick Hudson
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
- * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
- * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
Home |
Main Index |
Thread Index |
Old Index