1*716aae48Sjmcneill /* $NetBSD: tegra_soc.c,v 1.16 2018/09/24 22:22:16 jmcneill Exp $ */
2d4fd1143Sjmcneill
3d4fd1143Sjmcneill /*-
4d4fd1143Sjmcneill * Copyright (c) 2015 Jared D. McNeill <jmcneill@invisible.ca>
5d4fd1143Sjmcneill * All rights reserved.
6d4fd1143Sjmcneill *
7d4fd1143Sjmcneill * Redistribution and use in source and binary forms, with or without
8d4fd1143Sjmcneill * modification, are permitted provided that the following conditions
9d4fd1143Sjmcneill * are met:
10d4fd1143Sjmcneill * 1. Redistributions of source code must retain the above copyright
11d4fd1143Sjmcneill * notice, this list of conditions and the following disclaimer.
12d4fd1143Sjmcneill * 2. Redistributions in binary form must reproduce the above copyright
13d4fd1143Sjmcneill * notice, this list of conditions and the following disclaimer in the
14d4fd1143Sjmcneill * documentation and/or other materials provided with the distribution.
15d4fd1143Sjmcneill *
16d4fd1143Sjmcneill * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
17d4fd1143Sjmcneill * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
18d4fd1143Sjmcneill * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
19d4fd1143Sjmcneill * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
20d4fd1143Sjmcneill * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
21d4fd1143Sjmcneill * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22d4fd1143Sjmcneill * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
23d4fd1143Sjmcneill * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
24d4fd1143Sjmcneill * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25d4fd1143Sjmcneill * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26d4fd1143Sjmcneill * SUCH DAMAGE.
27d4fd1143Sjmcneill */
28d4fd1143Sjmcneill
29d4fd1143Sjmcneill #include "opt_tegra.h"
30d4fd1143Sjmcneill #include "opt_multiprocessor.h"
31d4fd1143Sjmcneill
32d4fd1143Sjmcneill #include <sys/cdefs.h>
33*716aae48Sjmcneill __KERNEL_RCSID(0, "$NetBSD: tegra_soc.c,v 1.16 2018/09/24 22:22:16 jmcneill Exp $");
34d4fd1143Sjmcneill
35d4fd1143Sjmcneill #include <sys/param.h>
36d4fd1143Sjmcneill #include <sys/bus.h>
37d4fd1143Sjmcneill #include <sys/cpu.h>
38d4fd1143Sjmcneill #include <sys/device.h>
39d4fd1143Sjmcneill
40d4fd1143Sjmcneill #include <uvm/uvm_extern.h>
41d4fd1143Sjmcneill
42d4fd1143Sjmcneill #include <arm/bootconfig.h>
43d4fd1143Sjmcneill #include <arm/cpufunc.h>
44d4fd1143Sjmcneill
45d4fd1143Sjmcneill #include <arm/nvidia/tegra_reg.h>
46d4fd1143Sjmcneill #include <arm/nvidia/tegra_apbreg.h>
47d4fd1143Sjmcneill #include <arm/nvidia/tegra_mcreg.h>
48d4fd1143Sjmcneill #include <arm/nvidia/tegra_var.h>
49d4fd1143Sjmcneill
5019d924bcSjmcneill bus_space_handle_t tegra_ppsb_bsh;
51d4fd1143Sjmcneill bus_space_handle_t tegra_apb_bsh;
52d4fd1143Sjmcneill
53d4fd1143Sjmcneill void
tegra_bootstrap(void)54d4fd1143Sjmcneill tegra_bootstrap(void)
55d4fd1143Sjmcneill {
56fe33aa27Sryo extern struct bus_space arm_generic_bs_tag;
57fe33aa27Sryo bus_space_tag_t bst = &arm_generic_bs_tag;
58fe33aa27Sryo
59fe33aa27Sryo if (bus_space_map(bst, TEGRA_PPSB_BASE, TEGRA_PPSB_SIZE, 0,
6019d924bcSjmcneill &tegra_ppsb_bsh) != 0)
6119d924bcSjmcneill panic("couldn't map PPSB");
62fe33aa27Sryo if (bus_space_map(bst, TEGRA_APB_BASE, TEGRA_APB_SIZE, 0,
6319d924bcSjmcneill &tegra_apb_bsh) != 0)
6419d924bcSjmcneill panic("couldn't map APB");
65d4fd1143Sjmcneill }
66