Release 4.14 arch/ia64/sn/pci/pcibr/pcibr_reg.c
/*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file "COPYING" in the main directory of this archive
* for more details.
*
* Copyright (C) 2004 Silicon Graphics, Inc. All rights reserved.
*/
#include <linux/interrupt.h>
#include <linux/types.h>
#include <asm/sn/io.h>
#include <asm/sn/pcibr_provider.h>
#include <asm/sn/pcibus_provider_defs.h>
#include <asm/sn/pcidev.h>
#include <asm/sn/pic.h>
#include <asm/sn/tiocp.h>
union br_ptr {
struct tiocp tio;
struct pic pic;
};
/*
* Control Register Access -- Read/Write 0000_0020
*/
void pcireg_control_bit_clr(struct pcibus_info *pcibus_info, u64 bits)
{
union br_ptr __iomem *ptr = (union br_ptr __iomem *)pcibus_info->pbi_buscommon.bs_base;
if (pcibus_info) {
switch (pcibus_info->pbi_bridge_type) {
case PCIBR_BRIDGETYPE_TIOCP:
__sn_clrq_relaxed(&ptr->tio.cp_control, bits);
break;
case PCIBR_BRIDGETYPE_PIC:
__sn_clrq_relaxed(&ptr->pic.p_wid_control, bits);
break;
default:
panic
("pcireg_control_bit_clr: unknown bridgetype bridge 0x%p",
ptr);
}
}
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Patrick Gefre | 72 | 84.71% | 1 | 25.00% |
Mark Maule | 10 | 11.76% | 1 | 25.00% |
Al Viro | 2 | 2.35% | 1 | 25.00% |
Prarit Bhargava | 1 | 1.18% | 1 | 25.00% |
Total | 85 | 100.00% | 4 | 100.00% |
void pcireg_control_bit_set(struct pcibus_info *pcibus_info, u64 bits)
{
union br_ptr __iomem *ptr = (union br_ptr __iomem *)pcibus_info->pbi_buscommon.bs_base;
if (pcibus_info) {
switch (pcibus_info->pbi_bridge_type) {
case PCIBR_BRIDGETYPE_TIOCP:
__sn_setq_relaxed(&ptr->tio.cp_control, bits);
break;
case PCIBR_BRIDGETYPE_PIC:
__sn_setq_relaxed(&ptr->pic.p_wid_control, bits);
break;
default:
panic
("pcireg_control_bit_set: unknown bridgetype bridge 0x%p",
ptr);
}
}
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Patrick Gefre | 72 | 84.71% | 1 | 25.00% |
Mark Maule | 10 | 11.76% | 1 | 25.00% |
Al Viro | 2 | 2.35% | 1 | 25.00% |
Prarit Bhargava | 1 | 1.18% | 1 | 25.00% |
Total | 85 | 100.00% | 4 | 100.00% |
/*
* PCI/PCIX Target Flush Register Access -- Read Only 0000_0050
*/
u64 pcireg_tflush_get(struct pcibus_info *pcibus_info)
{
union br_ptr __iomem *ptr = (union br_ptr __iomem *)pcibus_info->pbi_buscommon.bs_base;
u64 ret = 0;
if (pcibus_info) {
switch (pcibus_info->pbi_bridge_type) {
case PCIBR_BRIDGETYPE_TIOCP:
ret = __sn_readq_relaxed(&ptr->tio.cp_tflush);
break;
case PCIBR_BRIDGETYPE_PIC:
ret = __sn_readq_relaxed(&ptr->pic.p_wid_tflush);
break;
default:
panic
("pcireg_tflush_get: unknown bridgetype bridge 0x%p",
ptr);
}
}
/* Read of the Target Flush should always return zero */
if (ret != 0)
panic("pcireg_tflush_get:Target Flush failed\n");
return ret;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Patrick Gefre | 90 | 88.24% | 1 | 25.00% |
Mark Maule | 8 | 7.84% | 1 | 25.00% |
Prarit Bhargava | 2 | 1.96% | 1 | 25.00% |
Al Viro | 2 | 1.96% | 1 | 25.00% |
Total | 102 | 100.00% | 4 | 100.00% |
/*
* Interrupt Status Register Access -- Read Only 0000_0100
*/
u64 pcireg_intr_status_get(struct pcibus_info * pcibus_info)
{
union br_ptr __iomem *ptr = (union br_ptr __iomem *)pcibus_info->pbi_buscommon.bs_base;
u64 ret = 0;
if (pcibus_info) {
switch (pcibus_info->pbi_bridge_type) {
case PCIBR_BRIDGETYPE_TIOCP:
ret = __sn_readq_relaxed(&ptr->tio.cp_int_status);
break;
case PCIBR_BRIDGETYPE_PIC:
ret = __sn_readq_relaxed(&ptr->pic.p_int_status);
break;
default:
panic
("pcireg_intr_status_get: unknown bridgetype bridge 0x%p",
ptr);
}
}
return ret;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Patrick Gefre | 78 | 86.67% | 1 | 25.00% |
Mark Maule | 8 | 8.89% | 1 | 25.00% |
Al Viro | 2 | 2.22% | 1 | 25.00% |
Prarit Bhargava | 2 | 2.22% | 1 | 25.00% |
Total | 90 | 100.00% | 4 | 100.00% |
/*
* Interrupt Enable Register Access -- Read/Write 0000_0108
*/
void pcireg_intr_enable_bit_clr(struct pcibus_info *pcibus_info, u64 bits)
{
union br_ptr __iomem *ptr = (union br_ptr __iomem *)pcibus_info->pbi_buscommon.bs_base;
if (pcibus_info) {
switch (pcibus_info->pbi_bridge_type) {
case PCIBR_BRIDGETYPE_TIOCP:
__sn_clrq_relaxed(&ptr->tio.cp_int_enable, bits);
break;
case PCIBR_BRIDGETYPE_PIC:
__sn_clrq_relaxed(&ptr->pic.p_int_enable, bits);
break;
default:
panic
("pcireg_intr_enable_bit_clr: unknown bridgetype bridge 0x%p",
ptr);
}
}
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Patrick Gefre | 72 | 84.71% | 1 | 25.00% |
Mark Maule | 10 | 11.76% | 1 | 25.00% |
Al Viro | 2 | 2.35% | 1 | 25.00% |
Prarit Bhargava | 1 | 1.18% | 1 | 25.00% |
Total | 85 | 100.00% | 4 | 100.00% |
void pcireg_intr_enable_bit_set(struct pcibus_info *pcibus_info, u64 bits)
{
union br_ptr __iomem *ptr = (union br_ptr __iomem *)pcibus_info->pbi_buscommon.bs_base;
if (pcibus_info) {
switch (pcibus_info->pbi_bridge_type) {
case PCIBR_BRIDGETYPE_TIOCP:
__sn_setq_relaxed(&ptr->tio.cp_int_enable, bits);
break;
case PCIBR_BRIDGETYPE_PIC:
__sn_setq_relaxed(&ptr->pic.p_int_enable, bits);
break;
default:
panic
("pcireg_intr_enable_bit_set: unknown bridgetype bridge 0x%p",
ptr);
}
}
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Patrick Gefre | 72 | 84.71% | 1 | 25.00% |
Mark Maule | 10 | 11.76% | 1 | 25.00% |
Al Viro | 2 | 2.35% | 1 | 25.00% |
Prarit Bhargava | 1 | 1.18% | 1 | 25.00% |
Total | 85 | 100.00% | 4 | 100.00% |
/*
* Intr Host Address Register (int_addr) -- Read/Write 0000_0130 - 0000_0168
*/
void pcireg_intr_addr_addr_set(struct pcibus_info *pcibus_info, int int_n,
u64 addr)
{
union br_ptr __iomem *ptr = (union br_ptr __iomem *)pcibus_info->pbi_buscommon.bs_base;
if (pcibus_info) {
switch (pcibus_info->pbi_bridge_type) {
case PCIBR_BRIDGETYPE_TIOCP:
__sn_clrq_relaxed(&ptr->tio.cp_int_addr[int_n],
TIOCP_HOST_INTR_ADDR);
__sn_setq_relaxed(&ptr->tio.cp_int_addr[int_n],
(addr & TIOCP_HOST_INTR_ADDR));
break;
case PCIBR_BRIDGETYPE_PIC:
__sn_clrq_relaxed(&ptr->pic.p_int_addr[int_n],
PIC_HOST_INTR_ADDR);
__sn_setq_relaxed(&ptr->pic.p_int_addr[int_n],
(addr & PIC_HOST_INTR_ADDR));
break;
default:
panic
("pcireg_intr_addr_addr_get: unknown bridgetype bridge 0x%p",
ptr);
}
}
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Patrick Gefre | 109 | 82.58% | 1 | 25.00% |
Mark Maule | 20 | 15.15% | 1 | 25.00% |
Al Viro | 2 | 1.52% | 1 | 25.00% |
Prarit Bhargava | 1 | 0.76% | 1 | 25.00% |
Total | 132 | 100.00% | 4 | 100.00% |
/*
* Force Interrupt Register Access -- Write Only 0000_01C0 - 0000_01F8
*/
void pcireg_force_intr_set(struct pcibus_info *pcibus_info, int int_n)
{
union br_ptr __iomem *ptr = (union br_ptr __iomem *)pcibus_info->pbi_buscommon.bs_base;
if (pcibus_info) {
switch (pcibus_info->pbi_bridge_type) {
case PCIBR_BRIDGETYPE_TIOCP:
writeq(1, &ptr->tio.cp_force_pin[int_n]);
break;
case PCIBR_BRIDGETYPE_PIC:
writeq(1, &ptr->pic.p_force_pin[int_n]);
break;
default:
panic
("pcireg_force_intr_set: unknown bridgetype bridge 0x%p",
ptr);
}
}
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Patrick Gefre | 77 | 84.62% | 1 | 33.33% |
Mark Maule | 12 | 13.19% | 1 | 33.33% |
Al Viro | 2 | 2.20% | 1 | 33.33% |
Total | 91 | 100.00% | 3 | 100.00% |
/*
* Device(x) Write Buffer Flush Reg Access -- Read Only 0000_0240 - 0000_0258
*/
u64 pcireg_wrb_flush_get(struct pcibus_info *pcibus_info, int device)
{
union br_ptr __iomem *ptr = (union br_ptr __iomem *)pcibus_info->pbi_buscommon.bs_base;
u64 ret = 0;
if (pcibus_info) {
switch (pcibus_info->pbi_bridge_type) {
case PCIBR_BRIDGETYPE_TIOCP:
ret =
__sn_readq_relaxed(&ptr->tio.cp_wr_req_buf[device]);
break;
case PCIBR_BRIDGETYPE_PIC:
ret =
__sn_readq_relaxed(&ptr->pic.p_wr_req_buf[device]);
break;
default:
panic("pcireg_wrb_flush_get: unknown bridgetype bridge 0x%p", ptr);
}
}
/* Read of the Write Buffer Flush should always return zero */
return ret;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Patrick Gefre | 88 | 88.00% | 1 | 25.00% |
Mark Maule | 8 | 8.00% | 1 | 25.00% |
Prarit Bhargava | 2 | 2.00% | 1 | 25.00% |
Al Viro | 2 | 2.00% | 1 | 25.00% |
Total | 100 | 100.00% | 4 | 100.00% |
void pcireg_int_ate_set(struct pcibus_info *pcibus_info, int ate_index,
u64 val)
{
union br_ptr __iomem *ptr = (union br_ptr __iomem *)pcibus_info->pbi_buscommon.bs_base;
if (pcibus_info) {
switch (pcibus_info->pbi_bridge_type) {
case PCIBR_BRIDGETYPE_TIOCP:
writeq(val, &ptr->tio.cp_int_ate_ram[ate_index]);
break;
case PCIBR_BRIDGETYPE_PIC:
writeq(val, &ptr->pic.p_int_ate_ram[ate_index]);
break;
default:
panic
("pcireg_int_ate_set: unknown bridgetype bridge 0x%p",
ptr);
}
}
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Patrick Gefre | 79 | 84.04% | 1 | 25.00% |
Mark Maule | 12 | 12.77% | 1 | 25.00% |
Al Viro | 2 | 2.13% | 1 | 25.00% |
Prarit Bhargava | 1 | 1.06% | 1 | 25.00% |
Total | 94 | 100.00% | 4 | 100.00% |
u64 __iomem *pcireg_int_ate_addr(struct pcibus_info *pcibus_info, int ate_index)
{
union br_ptr __iomem *ptr = (union br_ptr __iomem *)pcibus_info->pbi_buscommon.bs_base;
u64 __iomem *ret = NULL;
if (pcibus_info) {
switch (pcibus_info->pbi_bridge_type) {
case PCIBR_BRIDGETYPE_TIOCP:
ret = &ptr->tio.cp_int_ate_ram[ate_index];
break;
case PCIBR_BRIDGETYPE_PIC:
ret = &ptr->pic.p_int_ate_ram[ate_index];
break;
default:
panic
("pcireg_int_ate_addr: unknown bridgetype bridge 0x%p",
ptr);
}
}
return ret;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Patrick Gefre | 90 | 92.78% | 1 | 33.33% |
Al Viro | 5 | 5.15% | 1 | 33.33% |
Prarit Bhargava | 2 | 2.06% | 1 | 33.33% |
Total | 97 | 100.00% | 3 | 100.00% |
Overall Contributors
Person | Tokens | Prop | Commits | CommitProp |
Patrick Gefre | 934 | 85.61% | 1 | 16.67% |
Mark Maule | 108 | 9.90% | 1 | 16.67% |
Al Viro | 25 | 2.29% | 1 | 16.67% |
Prarit Bhargava | 21 | 1.92% | 2 | 33.33% |
Tony Luck | 3 | 0.27% | 1 | 16.67% |
Total | 1091 | 100.00% | 6 | 100.00% |
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.