1*4ec2faa4Skettenis /* $OpenBSD: starfire.c,v 1.1 2008/03/16 22:18:53 kettenis Exp $ */
2*4ec2faa4Skettenis
3*4ec2faa4Skettenis /*
4*4ec2faa4Skettenis * Copyright (c) 2008 Mark Kettenis
5*4ec2faa4Skettenis *
6*4ec2faa4Skettenis * Permission to use, copy, modify, and distribute this software for any
7*4ec2faa4Skettenis * purpose with or without fee is hereby granted, provided that the above
8*4ec2faa4Skettenis * copyright notice and this permission notice appear in all copies.
9*4ec2faa4Skettenis *
10*4ec2faa4Skettenis * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11*4ec2faa4Skettenis * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12*4ec2faa4Skettenis * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13*4ec2faa4Skettenis * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14*4ec2faa4Skettenis * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15*4ec2faa4Skettenis * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16*4ec2faa4Skettenis * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17*4ec2faa4Skettenis */
18*4ec2faa4Skettenis
19*4ec2faa4Skettenis #include <sys/param.h>
20*4ec2faa4Skettenis
21*4ec2faa4Skettenis #include <sparc64/dev/starfire.h>
22*4ec2faa4Skettenis
23*4ec2faa4Skettenis void
starfire_pc_ittrans_init(int upaid)24*4ec2faa4Skettenis starfire_pc_ittrans_init(int upaid)
25*4ec2faa4Skettenis {
26*4ec2faa4Skettenis paddr_t pa;
27*4ec2faa4Skettenis
28*4ec2faa4Skettenis pa = STARFIRE_UPAID2UPS(upaid) | STARFIRE_PSI_BASE;
29*4ec2faa4Skettenis pa |= (STARFIRE_PSI_PCREG_OFF | STARFIRE_PC_INT_MAP);
30*4ec2faa4Skettenis
31*4ec2faa4Skettenis /*
32*4ec2faa4Skettenis * Since we direct all interrupts to the boot processor, we
33*4ec2faa4Skettenis * simply program the port controller ITTR hardware with a
34*4ec2faa4Skettenis * single mapping.
35*4ec2faa4Skettenis */
36*4ec2faa4Skettenis pa += CPU_UPAID * 0x10;
37*4ec2faa4Skettenis stwa(pa, ASI_PHYS_NON_CACHED, STARFIRE_UPAID2HWMID(cpu_myid()));
38*4ec2faa4Skettenis }
39