提交 26c5c44d 编写于 作者: F françois romieu 提交者: David S. Miller

atm/iphase : removal of PCI space dereferences.

Mostly PHY access and a few (ugly) debug statements for DMA control.
Signed-off-by: NFrancois Romieu <romieu@fr.zoreil.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 7880b72e
...@@ -818,127 +818,152 @@ static void ia_hw_type(IADEV *iadev) { ...@@ -818,127 +818,152 @@ static void ia_hw_type(IADEV *iadev) {
} }
static void IaFrontEndIntr(IADEV *iadev) { static u32 ia_phy_read32(struct iadev_priv *ia, unsigned int reg)
volatile IA_SUNI *suni; {
volatile ia_mb25_t *mb25; return readl(ia->phy + (reg >> 2));
volatile suni_pm7345_t *suni_pm7345; }
if(iadev->phy_type & FE_25MBIT_PHY) { static void ia_phy_write32(struct iadev_priv *ia, unsigned int reg, u32 val)
mb25 = (ia_mb25_t*)iadev->phy; {
iadev->carrier_detect = Boolean(mb25->mb25_intr_status & MB25_IS_GSB); writel(val, ia->phy + (reg >> 2));
} else if (iadev->phy_type & FE_DS3_PHY) { }
suni_pm7345 = (suni_pm7345_t *)iadev->phy;
/* clear FRMR interrupts */ static void ia_frontend_intr(struct iadev_priv *iadev)
(void) suni_pm7345->suni_ds3_frm_intr_stat; {
iadev->carrier_detect = u32 status;
Boolean(!(suni_pm7345->suni_ds3_frm_stat & SUNI_DS3_LOSV));
} else if (iadev->phy_type & FE_E3_PHY ) { if (iadev->phy_type & FE_25MBIT_PHY) {
suni_pm7345 = (suni_pm7345_t *)iadev->phy; status = ia_phy_read32(iadev, MB25_INTR_STATUS);
(void) suni_pm7345->suni_e3_frm_maint_intr_ind; iadev->carrier_detect = (status & MB25_IS_GSB) ? 1 : 0;
iadev->carrier_detect = } else if (iadev->phy_type & FE_DS3_PHY) {
Boolean(!(suni_pm7345->suni_e3_frm_fram_intr_ind_stat&SUNI_E3_LOS)); ia_phy_read32(iadev, SUNI_DS3_FRM_INTR_STAT);
} status = ia_phy_read32(iadev, SUNI_DS3_FRM_STAT);
else { iadev->carrier_detect = (status & SUNI_DS3_LOSV) ? 0 : 1;
suni = (IA_SUNI *)iadev->phy; } else if (iadev->phy_type & FE_E3_PHY) {
(void) suni->suni_rsop_status; ia_phy_read32(iadev, SUNI_E3_FRM_MAINT_INTR_IND);
iadev->carrier_detect = Boolean(!(suni->suni_rsop_status & SUNI_LOSV)); status = ia_phy_read32(iadev, SUNI_E3_FRM_FRAM_INTR_IND_STAT);
} iadev->carrier_detect = (status & SUNI_E3_LOS) ? 0 : 1;
if (iadev->carrier_detect) } else {
printk("IA: SUNI carrier detected\n"); status = ia_phy_read32(iadev, SUNI_RSOP_STATUS);
else iadev->carrier_detect = (status & SUNI_LOSV) ? 0 : 1;
printk("IA: SUNI carrier lost signal\n"); }
return;
printk(KERN_INFO "IA: SUNI carrier %s\n",
iadev->carrier_detect ? "detected" : "lost signal");
} }
static void ia_mb25_init (IADEV *iadev) static void ia_mb25_init(struct iadev_priv *iadev)
{ {
volatile ia_mb25_t *mb25 = (ia_mb25_t*)iadev->phy;
#if 0 #if 0
mb25->mb25_master_ctrl = MB25_MC_DRIC | MB25_MC_DREC | MB25_MC_ENABLED; mb25->mb25_master_ctrl = MB25_MC_DRIC | MB25_MC_DREC | MB25_MC_ENABLED;
#endif #endif
mb25->mb25_master_ctrl = MB25_MC_DRIC | MB25_MC_DREC; ia_phy_write32(iadev, MB25_MASTER_CTRL, MB25_MC_DRIC | MB25_MC_DREC);
mb25->mb25_diag_control = 0; ia_phy_write32(iadev, MB25_DIAG_CONTROL, 0);
/*
* Initialize carrier detect state iadev->carrier_detect =
*/ (ia_phy_read32(iadev, MB25_INTR_STATUS) & MB25_IS_GSB) ? 1 : 0;
iadev->carrier_detect = Boolean(mb25->mb25_intr_status & MB25_IS_GSB); }
return;
}
static void ia_suni_pm7345_init (IADEV *iadev) struct ia_reg {
u16 reg;
u16 val;
};
static void ia_phy_write(struct iadev_priv *iadev,
const struct ia_reg *regs, int len)
{ {
volatile suni_pm7345_t *suni_pm7345 = (suni_pm7345_t *)iadev->phy; while (len--) {
if (iadev->phy_type & FE_DS3_PHY) ia_phy_write32(iadev, regs->reg, regs->val);
{ regs++;
iadev->carrier_detect = }
Boolean(!(suni_pm7345->suni_ds3_frm_stat & SUNI_DS3_LOSV)); }
suni_pm7345->suni_ds3_frm_intr_enbl = 0x17;
suni_pm7345->suni_ds3_frm_cfg = 1; static void ia_suni_pm7345_init_ds3(struct iadev_priv *iadev)
suni_pm7345->suni_ds3_tran_cfg = 1; {
suni_pm7345->suni_config = 0; static const struct ia_reg suni_ds3_init [] = {
suni_pm7345->suni_splr_cfg = 0; { SUNI_DS3_FRM_INTR_ENBL, 0x17 },
suni_pm7345->suni_splt_cfg = 0; { SUNI_DS3_FRM_CFG, 0x01 },
} { SUNI_DS3_TRAN_CFG, 0x01 },
else { SUNI_CONFIG, 0 },
{ { SUNI_SPLR_CFG, 0 },
iadev->carrier_detect = { SUNI_SPLT_CFG, 0 }
Boolean(!(suni_pm7345->suni_e3_frm_fram_intr_ind_stat & SUNI_E3_LOS)); };
suni_pm7345->suni_e3_frm_fram_options = 0x4; u32 status;
suni_pm7345->suni_e3_frm_maint_options = 0x20;
suni_pm7345->suni_e3_frm_fram_intr_enbl = 0x1d; status = ia_phy_read32(iadev, SUNI_DS3_FRM_STAT);
suni_pm7345->suni_e3_frm_maint_intr_enbl = 0x30; iadev->carrier_detect = (status & SUNI_DS3_LOSV) ? 0 : 1;
suni_pm7345->suni_e3_tran_stat_diag_options = 0x0;
suni_pm7345->suni_e3_tran_fram_options = 0x1; ia_phy_write(iadev, suni_ds3_init, ARRAY_SIZE(suni_ds3_init));
suni_pm7345->suni_config = SUNI_PM7345_E3ENBL; }
suni_pm7345->suni_splr_cfg = 0x41;
suni_pm7345->suni_splt_cfg = 0x41; static void ia_suni_pm7345_init_e3(struct iadev_priv *iadev)
} {
/* static const struct ia_reg suni_e3_init [] = {
* Enable RSOP loss of signal interrupt. { SUNI_E3_FRM_FRAM_OPTIONS, 0x04 },
*/ { SUNI_E3_FRM_MAINT_OPTIONS, 0x20 },
suni_pm7345->suni_intr_enbl = 0x28; { SUNI_E3_FRM_FRAM_INTR_ENBL, 0x1d },
{ SUNI_E3_FRM_MAINT_INTR_ENBL, 0x30 },
/* { SUNI_E3_TRAN_STAT_DIAG_OPTIONS, 0 },
* Clear error counters { SUNI_E3_TRAN_FRAM_OPTIONS, 0x01 },
*/ { SUNI_CONFIG, SUNI_PM7345_E3ENBL },
suni_pm7345->suni_id_reset = 0; { SUNI_SPLR_CFG, 0x41 },
{ SUNI_SPLT_CFG, 0x41 }
/* };
* Clear "PMCTST" in master test register. u32 status;
*/
suni_pm7345->suni_master_test = 0; status = ia_phy_read32(iadev, SUNI_E3_FRM_FRAM_INTR_IND_STAT);
iadev->carrier_detect = (status & SUNI_E3_LOS) ? 0 : 1;
suni_pm7345->suni_rxcp_ctrl = 0x2c; ia_phy_write(iadev, suni_e3_init, ARRAY_SIZE(suni_e3_init));
suni_pm7345->suni_rxcp_fctrl = 0x81; }
suni_pm7345->suni_rxcp_idle_pat_h1 = static void ia_suni_pm7345_init(struct iadev_priv *iadev)
suni_pm7345->suni_rxcp_idle_pat_h2 = {
suni_pm7345->suni_rxcp_idle_pat_h3 = 0; static const struct ia_reg suni_init [] = {
suni_pm7345->suni_rxcp_idle_pat_h4 = 1; /* Enable RSOP loss of signal interrupt. */
{ SUNI_INTR_ENBL, 0x28 },
suni_pm7345->suni_rxcp_idle_mask_h1 = 0xff; /* Clear error counters. */
suni_pm7345->suni_rxcp_idle_mask_h2 = 0xff; { SUNI_ID_RESET, 0 },
suni_pm7345->suni_rxcp_idle_mask_h3 = 0xff; /* Clear "PMCTST" in master test register. */
suni_pm7345->suni_rxcp_idle_mask_h4 = 0xfe; { SUNI_MASTER_TEST, 0 },
suni_pm7345->suni_rxcp_cell_pat_h1 = { SUNI_RXCP_CTRL, 0x2c },
suni_pm7345->suni_rxcp_cell_pat_h2 = { SUNI_RXCP_FCTRL, 0x81 },
suni_pm7345->suni_rxcp_cell_pat_h3 = 0;
suni_pm7345->suni_rxcp_cell_pat_h4 = 1; { SUNI_RXCP_IDLE_PAT_H1, 0 },
{ SUNI_RXCP_IDLE_PAT_H2, 0 },
suni_pm7345->suni_rxcp_cell_mask_h1 = { SUNI_RXCP_IDLE_PAT_H3, 0 },
suni_pm7345->suni_rxcp_cell_mask_h2 = { SUNI_RXCP_IDLE_PAT_H4, 0x01 },
suni_pm7345->suni_rxcp_cell_mask_h3 =
suni_pm7345->suni_rxcp_cell_mask_h4 = 0xff; { SUNI_RXCP_IDLE_MASK_H1, 0xff },
{ SUNI_RXCP_IDLE_MASK_H2, 0xff },
suni_pm7345->suni_txcp_ctrl = 0xa4; { SUNI_RXCP_IDLE_MASK_H3, 0xff },
suni_pm7345->suni_txcp_intr_en_sts = 0x10; { SUNI_RXCP_IDLE_MASK_H4, 0xfe },
suni_pm7345->suni_txcp_idle_pat_h5 = 0x55;
{ SUNI_RXCP_CELL_PAT_H1, 0 },
suni_pm7345->suni_config &= ~(SUNI_PM7345_LLB | { SUNI_RXCP_CELL_PAT_H2, 0 },
SUNI_PM7345_CLB | { SUNI_RXCP_CELL_PAT_H3, 0 },
SUNI_PM7345_DLB | { SUNI_RXCP_CELL_PAT_H4, 0x01 },
SUNI_PM7345_PLB);
{ SUNI_RXCP_CELL_MASK_H1, 0xff },
{ SUNI_RXCP_CELL_MASK_H2, 0xff },
{ SUNI_RXCP_CELL_MASK_H3, 0xff },
{ SUNI_RXCP_CELL_MASK_H4, 0xff },
{ SUNI_TXCP_CTRL, 0xa4 },
{ SUNI_TXCP_INTR_EN_STS, 0x10 },
{ SUNI_TXCP_IDLE_PAT_H5, 0x55 }
};
if (iadev->phy_type & FE_DS3_PHY)
ia_suni_pm7345_init_ds3(iadev);
else
ia_suni_pm7345_init_e3(iadev);
ia_phy_write(iadev, suni_init, ARRAY_SIZE(suni_init));
ia_phy_write32(iadev, SUNI_CONFIG, ia_phy_read32(iadev, SUNI_CONFIG) &
~(SUNI_PM7345_LLB | SUNI_PM7345_CLB |
SUNI_PM7345_DLB | SUNI_PM7345_PLB));
#ifdef __SNMP__ #ifdef __SNMP__
suni_pm7345->suni_rxcp_intr_en_sts |= SUNI_OOCDE; suni_pm7345->suni_rxcp_intr_en_sts |= SUNI_OOCDE;
#endif /* __SNMP__ */ #endif /* __SNMP__ */
...@@ -1425,10 +1450,10 @@ static int rx_init(struct atm_dev *dev) ...@@ -1425,10 +1450,10 @@ static int rx_init(struct atm_dev *dev)
iadev->dma + IPHASE5575_RX_LIST_ADDR); iadev->dma + IPHASE5575_RX_LIST_ADDR);
IF_INIT(printk("Tx Dle list addr: 0x%p value: 0x%0x\n", IF_INIT(printk("Tx Dle list addr: 0x%p value: 0x%0x\n",
iadev->dma+IPHASE5575_TX_LIST_ADDR, iadev->dma+IPHASE5575_TX_LIST_ADDR,
*(u32*)(iadev->dma+IPHASE5575_TX_LIST_ADDR)); readl(iadev->dma + IPHASE5575_TX_LIST_ADDR));
printk("Rx Dle list addr: 0x%p value: 0x%0x\n", printk("Rx Dle list addr: 0x%p value: 0x%0x\n",
iadev->dma+IPHASE5575_RX_LIST_ADDR, iadev->dma+IPHASE5575_RX_LIST_ADDR,
*(u32*)(iadev->dma+IPHASE5575_RX_LIST_ADDR));) readl(iadev->dma + IPHASE5575_RX_LIST_ADDR));)
writew(0xffff, iadev->reass_reg+REASS_MASK_REG); writew(0xffff, iadev->reass_reg+REASS_MASK_REG);
writew(0, iadev->reass_reg+MODE_REG); writew(0, iadev->reass_reg+MODE_REG);
...@@ -2208,7 +2233,7 @@ static irqreturn_t ia_int(int irq, void *dev_id) ...@@ -2208,7 +2233,7 @@ static irqreturn_t ia_int(int irq, void *dev_id)
if (status & STAT_DLERINT) if (status & STAT_DLERINT)
{ {
/* Clear this bit by writing a 1 to it. */ /* Clear this bit by writing a 1 to it. */
*(u_int *)(iadev->reg+IPHASE5575_BUS_STATUS_REG) = STAT_DLERINT; writel(STAT_DLERINT, iadev->reg + IPHASE5575_BUS_STATUS_REG);
rx_dle_intr(dev); rx_dle_intr(dev);
} }
if (status & STAT_SEGINT) if (status & STAT_SEGINT)
...@@ -2219,13 +2244,13 @@ static irqreturn_t ia_int(int irq, void *dev_id) ...@@ -2219,13 +2244,13 @@ static irqreturn_t ia_int(int irq, void *dev_id)
} }
if (status & STAT_DLETINT) if (status & STAT_DLETINT)
{ {
*(u_int *)(iadev->reg+IPHASE5575_BUS_STATUS_REG) = STAT_DLETINT; writel(STAT_DLETINT, iadev->reg + IPHASE5575_BUS_STATUS_REG);
tx_dle_intr(dev); tx_dle_intr(dev);
} }
if (status & (STAT_FEINT | STAT_ERRINT | STAT_MARKINT)) if (status & (STAT_FEINT | STAT_ERRINT | STAT_MARKINT))
{ {
if (status & STAT_FEINT) if (status & STAT_FEINT)
IaFrontEndIntr(iadev); ia_frontend_intr(iadev);
} }
} }
return IRQ_RETVAL(handled); return IRQ_RETVAL(handled);
...@@ -2556,7 +2581,7 @@ static int __devinit ia_start(struct atm_dev *dev) ...@@ -2556,7 +2581,7 @@ static int __devinit ia_start(struct atm_dev *dev)
goto err_free_rx; goto err_free_rx;
} }
/* Get iadev->carrier_detect status */ /* Get iadev->carrier_detect status */
IaFrontEndIntr(iadev); ia_frontend_intr(iadev);
} }
return 0; return 0;
...@@ -2827,7 +2852,7 @@ static int ia_ioctl(struct atm_dev *dev, unsigned int cmd, void __user *arg) ...@@ -2827,7 +2852,7 @@ static int ia_ioctl(struct atm_dev *dev, unsigned int cmd, void __user *arg)
case 0xb: case 0xb:
if (!capable(CAP_NET_ADMIN)) return -EPERM; if (!capable(CAP_NET_ADMIN)) return -EPERM;
IaFrontEndIntr(iadev); ia_frontend_intr(iadev);
break; break;
case 0xa: case 0xa:
if (!capable(CAP_NET_ADMIN)) return -EPERM; if (!capable(CAP_NET_ADMIN)) return -EPERM;
......
...@@ -889,79 +889,71 @@ typedef struct ia_rtn_q { ...@@ -889,79 +889,71 @@ typedef struct ia_rtn_q {
} IARTN_Q; } IARTN_Q;
#define SUNI_LOSV 0x04 #define SUNI_LOSV 0x04
typedef struct { enum ia_suni {
u32 suni_master_reset; /* SUNI Master Reset and Identity */ SUNI_MASTER_RESET = 0x000, /* SUNI Master Reset and Identity */
u32 suni_master_config; /* SUNI Master Configuration */ SUNI_MASTER_CONFIG = 0x004, /* SUNI Master Configuration */
u32 suni_master_intr_stat; /* SUNI Master Interrupt Status */ SUNI_MASTER_INTR_STAT = 0x008, /* SUNI Master Interrupt Status */
u32 suni_reserved1; /* Reserved */ SUNI_RESERVED1 = 0x00c, /* Reserved */
u32 suni_master_clk_monitor;/* SUNI Master Clock Monitor */ SUNI_MASTER_CLK_MONITOR = 0x010, /* SUNI Master Clock Monitor */
u32 suni_master_control; /* SUNI Master Clock Monitor */ SUNI_MASTER_CONTROL = 0x014, /* SUNI Master Clock Monitor */
u32 suni_reserved2[10]; /* Reserved */ /* Reserved (10) */
SUNI_RSOP_CONTROL = 0x040, /* RSOP Control/Interrupt Enable */
u32 suni_rsop_control; /* RSOP Control/Interrupt Enable */ SUNI_RSOP_STATUS = 0x044, /* RSOP Status/Interrupt States */
u32 suni_rsop_status; /* RSOP Status/Interrupt States */ SUNI_RSOP_SECTION_BIP8L = 0x048, /* RSOP Section BIP-8 LSB */
u32 suni_rsop_section_bip8l;/* RSOP Section BIP-8 LSB */ SUNI_RSOP_SECTION_BIP8M = 0x04c, /* RSOP Section BIP-8 MSB */
u32 suni_rsop_section_bip8m;/* RSOP Section BIP-8 MSB */
SUNI_TSOP_CONTROL = 0x050, /* TSOP Control */
u32 suni_tsop_control; /* TSOP Control */ SUNI_TSOP_DIAG = 0x054, /* TSOP Disgnostics */
u32 suni_tsop_diag; /* TSOP Disgnostics */ /* Reserved (2) */
u32 suni_tsop_reserved[2]; /* TSOP Reserved */ SUNI_RLOP_CS = 0x060, /* RLOP Control/Status */
SUNI_RLOP_INTR = 0x064, /* RLOP Interrupt Enable/Status */
u32 suni_rlop_cs; /* RLOP Control/Status */ SUNI_RLOP_LINE_BIP24L = 0x068, /* RLOP Line BIP-24 LSB */
u32 suni_rlop_intr; /* RLOP Interrupt Enable/Status */ SUNI_RLOP_LINE_BIP24 = 0x06c, /* RLOP Line BIP-24 */
u32 suni_rlop_line_bip24l; /* RLOP Line BIP-24 LSB */ SUNI_RLOP_LINE_BIP24M = 0x070, /* RLOP Line BIP-24 MSB */
u32 suni_rlop_line_bip24; /* RLOP Line BIP-24 */ SUNI_RLOP_LINE_FEBEL = 0x074, /* RLOP Line FEBE LSB */
u32 suni_rlop_line_bip24m; /* RLOP Line BIP-24 MSB */ SUNI_RLOP_LINE_FEBE = 0x078, /* RLOP Line FEBE */
u32 suni_rlop_line_febel; /* RLOP Line FEBE LSB */ SUNI_RLOP_LINE_FEBEM = 0x07c, /* RLOP Line FEBE MSB */
u32 suni_rlop_line_febe; /* RLOP Line FEBE */
u32 suni_rlop_line_febem; /* RLOP Line FEBE MSB */ SUNI_TLOP_CONTROL = 0x080, /* TLOP Control */
SUNI_TLOP_DISG = 0x084, /* TLOP Disgnostics */
u32 suni_tlop_control; /* TLOP Control */ /* Reserved (14) */
u32 suni_tlop_disg; /* TLOP Disgnostics */ SUNI_RPOP_CS = 0x0c0, /* RPOP Status/Control */
u32 suni_tlop_reserved[14]; /* TLOP Reserved */ SUNI_RPOP_INTR = 0x0c4, /* RPOP Interrupt/Status */
SUNI_RPOP_RESERVED = 0x0c8, /* RPOP Reserved */
u32 suni_rpop_cs; /* RPOP Status/Control */ SUNI_RPOP_INTR_ENA = 0x0cc, /* RPOP Interrupt Enable */
u32 suni_rpop_intr; /* RPOP Interrupt/Status */ /* Reserved (3) */
u32 suni_rpop_reserved; /* RPOP Reserved */ SUNI_RPOP_PATH_SIG = 0x0dc, /* RPOP Path Signal Label */
u32 suni_rpop_intr_ena; /* RPOP Interrupt Enable */ SUNI_RPOP_BIP8L = 0x0e0, /* RPOP Path BIP-8 LSB */
u32 suni_rpop_reserved1[3]; /* RPOP Reserved */ SUNI_RPOP_BIP8M = 0x0e4, /* RPOP Path BIP-8 MSB */
u32 suni_rpop_path_sig; /* RPOP Path Signal Label */ SUNI_RPOP_FEBEL = 0x0e8, /* RPOP Path FEBE LSB */
u32 suni_rpop_bip8l; /* RPOP Path BIP-8 LSB */ SUNI_RPOP_FEBEM = 0x0ec, /* RPOP Path FEBE MSB */
u32 suni_rpop_bip8m; /* RPOP Path BIP-8 MSB */ /* Reserved (4) */
u32 suni_rpop_febel; /* RPOP Path FEBE LSB */ SUNI_TPOP_CNTRL_DAIG = 0x100, /* TPOP Control/Disgnostics */
u32 suni_rpop_febem; /* RPOP Path FEBE MSB */ SUNI_TPOP_POINTER_CTRL = 0x104, /* TPOP Pointer Control */
u32 suni_rpop_reserved2[4]; /* RPOP Reserved */ SUNI_TPOP_SOURCER_CTRL = 0x108, /* TPOP Source Control */
/* Reserved (2) */
u32 suni_tpop_cntrl_daig; /* TPOP Control/Disgnostics */ SUNI_TPOP_ARB_PRTL = 0x114, /* TPOP Arbitrary Pointer LSB */
u32 suni_tpop_pointer_ctrl; /* TPOP Pointer Control */ SUNI_TPOP_ARB_PRTM = 0x118, /* TPOP Arbitrary Pointer MSB */
u32 suni_tpop_sourcer_ctrl; /* TPOP Source Control */ SUNI_TPOP_RESERVED2 = 0x11c, /* TPOP Reserved */
u32 suni_tpop_reserved1[2]; /* TPOP Reserved */ SUNI_TPOP_PATH_SIG = 0x120, /* TPOP Path Signal Lable */
u32 suni_tpop_arb_prtl; /* TPOP Arbitrary Pointer LSB */ SUNI_TPOP_PATH_STATUS = 0x124, /* TPOP Path Status */
u32 suni_tpop_arb_prtm; /* TPOP Arbitrary Pointer MSB */ /* Reserved (6) */
u32 suni_tpop_reserved2; /* TPOP Reserved */ SUNI_RACP_CS = 0x140, /* RACP Control/Status */
u32 suni_tpop_path_sig; /* TPOP Path Signal Lable */ SUNI_RACP_INTR = 0x144, /* RACP Interrupt Enable/Status */
u32 suni_tpop_path_status; /* TPOP Path Status */ SUNI_RACP_HDR_PATTERN = 0x148, /* RACP Match Header Pattern */
u32 suni_tpop_reserved3[6]; /* TPOP Reserved */ SUNI_RACP_HDR_MASK = 0x14c, /* RACP Match Header Mask */
SUNI_RACP_CORR_HCS = 0x150, /* RACP Correctable HCS Error Count */
u32 suni_racp_cs; /* RACP Control/Status */ SUNI_RACP_UNCORR_HCS = 0x154, /* RACP Uncorrectable HCS Err Count */
u32 suni_racp_intr; /* RACP Interrupt Enable/Status */ /* Reserved (10) */
u32 suni_racp_hdr_pattern; /* RACP Match Header Pattern */ SUNI_TACP_CONTROL = 0x180, /* TACP Control */
u32 suni_racp_hdr_mask; /* RACP Match Header Mask */ SUNI_TACP_IDLE_HDR_PAT = 0x184, /* TACP Idle Cell Header Pattern */
u32 suni_racp_corr_hcs; /* RACP Correctable HCS Error Count */ SUNI_TACP_IDLE_PAY_PAY = 0x188, /* TACP Idle Cell Payld Octet Patrn */
u32 suni_racp_uncorr_hcs; /* RACP Uncorrectable HCS Error Count */ /* Reserved (5) */
u32 suni_racp_reserved[10]; /* RACP Reserved */ /* Reserved (24) */
/* FIXME: unused but name conflicts.
u32 suni_tacp_control; /* TACP Control */ * SUNI_MASTER_TEST = 0x200, SUNI Master Test */
u32 suni_tacp_idle_hdr_pat; /* TACP Idle Cell Header Pattern */ SUNI_RESERVED_TEST = 0x204 /* SUNI Reserved for Test */
u32 suni_tacp_idle_pay_pay; /* TACP Idle Cell Payld Octet Pattern */ };
u32 suni_tacp_reserved[5]; /* TACP Reserved */
u32 suni_reserved3[24]; /* Reserved */
u32 suni_master_test; /* SUNI Master Test */
u32 suni_reserved_test; /* SUNI Reserved for Test */
} IA_SUNI;
typedef struct _SUNI_STATS_ typedef struct _SUNI_STATS_
{ {
...@@ -993,13 +985,11 @@ typedef struct _SUNI_STATS_ ...@@ -993,13 +985,11 @@ typedef struct _SUNI_STATS_
u32 racp_uchcs_count; // uncorrectable HCS error count u32 racp_uchcs_count; // uncorrectable HCS error count
} IA_SUNI_STATS; } IA_SUNI_STATS;
typedef struct iadev_t { typedef struct iadev_priv {
/*-----base pointers into (i)chipSAR+ address space */ /*-----base pointers into (i)chipSAR+ address space */
u32 __iomem *phy; /* base pointer into phy(SUNI) */ u32 __iomem *phy; /* Base pointer into phy (SUNI). */
u32 __iomem *dma; /* base pointer into DMA control u32 __iomem *dma; /* Base pointer into DMA control registers. */
registers */ u32 __iomem *reg; /* Base pointer to SAR registers. */
u32 __iomem *reg; /* base pointer to SAR registers
- Bus Interface Control Regs */
u32 __iomem *seg_reg; /* base pointer to segmentation engine u32 __iomem *seg_reg; /* base pointer to segmentation engine
internal registers */ internal registers */
u32 __iomem *reass_reg; /* base pointer to reassemble engine u32 __iomem *reass_reg; /* base pointer to reassemble engine
...@@ -1071,14 +1061,14 @@ typedef struct iadev_t { ...@@ -1071,14 +1061,14 @@ typedef struct iadev_t {
#define INPH_IA_VCC(v) ((struct ia_vcc *) (v)->dev_data) #define INPH_IA_VCC(v) ((struct ia_vcc *) (v)->dev_data)
/******************* IDT77105 25MB/s PHY DEFINE *****************************/ /******************* IDT77105 25MB/s PHY DEFINE *****************************/
typedef struct { enum ia_mb25 {
u_int mb25_master_ctrl; /* Master control */ MB25_MASTER_CTRL = 0x00, /* Master control */
u_int mb25_intr_status; /* Interrupt status */ MB25_INTR_STATUS = 0x04, /* Interrupt status */
u_int mb25_diag_control; /* Diagnostic control */ MB25_DIAG_CONTROL = 0x08, /* Diagnostic control */
u_int mb25_led_hec; /* LED driver and HEC status/control */ MB25_LED_HEC = 0x0c, /* LED driver and HEC status/control */
u_int mb25_low_byte_counter; /* Low byte counter */ MB25_LOW_BYTE_COUNTER = 0x10,
u_int mb25_high_byte_counter; /* High byte counter */ MB25_HIGH_BYTE_COUNTER = 0x14
} ia_mb25_t; };
/* /*
* Master Control * Master Control
...@@ -1127,122 +1117,121 @@ typedef struct { ...@@ -1127,122 +1117,121 @@ typedef struct {
#define FE_E3_PHY 0x0090 /* E3 */ #define FE_E3_PHY 0x0090 /* E3 */
/*********************** SUNI_PM7345 PHY DEFINE HERE *********************/ /*********************** SUNI_PM7345 PHY DEFINE HERE *********************/
typedef struct _suni_pm7345_t enum suni_pm7345 {
{ SUNI_CONFIG = 0x000, /* SUNI Configuration */
u_int suni_config; /* SUNI Configuration */ SUNI_INTR_ENBL = 0x004, /* SUNI Interrupt Enable */
u_int suni_intr_enbl; /* SUNI Interrupt Enable */ SUNI_INTR_STAT = 0x008, /* SUNI Interrupt Status */
u_int suni_intr_stat; /* SUNI Interrupt Status */ SUNI_CONTROL = 0x00c, /* SUNI Control */
u_int suni_control; /* SUNI Control */ SUNI_ID_RESET = 0x010, /* SUNI Reset and Identity */
u_int suni_id_reset; /* SUNI Reset and Identity */ SUNI_DATA_LINK_CTRL = 0x014,
u_int suni_data_link_ctrl; SUNI_RBOC_CONF_INTR_ENBL = 0x018,
u_int suni_rboc_conf_intr_enbl; SUNI_RBOC_STAT = 0x01c,
u_int suni_rboc_stat; SUNI_DS3_FRM_CFG = 0x020,
u_int suni_ds3_frm_cfg; SUNI_DS3_FRM_INTR_ENBL = 0x024,
u_int suni_ds3_frm_intr_enbl; SUNI_DS3_FRM_INTR_STAT = 0x028,
u_int suni_ds3_frm_intr_stat; SUNI_DS3_FRM_STAT = 0x02c,
u_int suni_ds3_frm_stat; SUNI_RFDL_CFG = 0x030,
u_int suni_rfdl_cfg; SUNI_RFDL_ENBL_STAT = 0x034,
u_int suni_rfdl_enbl_stat; SUNI_RFDL_STAT = 0x038,
u_int suni_rfdl_stat; SUNI_RFDL_DATA = 0x03c,
u_int suni_rfdl_data; SUNI_PMON_CHNG = 0x040,
u_int suni_pmon_chng; SUNI_PMON_INTR_ENBL_STAT = 0x044,
u_int suni_pmon_intr_enbl_stat; /* SUNI_RESERVED1 (0x13 - 0x11) */
u_int suni_reserved1[0x13-0x11]; SUNI_PMON_LCV_EVT_CNT_LSB = 0x050,
u_int suni_pmon_lcv_evt_cnt_lsb; SUNI_PMON_LCV_EVT_CNT_MSB = 0x054,
u_int suni_pmon_lcv_evt_cnt_msb; SUNI_PMON_FBE_EVT_CNT_LSB = 0x058,
u_int suni_pmon_fbe_evt_cnt_lsb; SUNI_PMON_FBE_EVT_CNT_MSB = 0x05c,
u_int suni_pmon_fbe_evt_cnt_msb; SUNI_PMON_SEZ_DET_CNT_LSB = 0x060,
u_int suni_pmon_sez_det_cnt_lsb; SUNI_PMON_SEZ_DET_CNT_MSB = 0x064,
u_int suni_pmon_sez_det_cnt_msb; SUNI_PMON_PE_EVT_CNT_LSB = 0x068,
u_int suni_pmon_pe_evt_cnt_lsb; SUNI_PMON_PE_EVT_CNT_MSB = 0x06c,
u_int suni_pmon_pe_evt_cnt_msb; SUNI_PMON_PPE_EVT_CNT_LSB = 0x070,
u_int suni_pmon_ppe_evt_cnt_lsb; SUNI_PMON_PPE_EVT_CNT_MSB = 0x074,
u_int suni_pmon_ppe_evt_cnt_msb; SUNI_PMON_FEBE_EVT_CNT_LSB = 0x078,
u_int suni_pmon_febe_evt_cnt_lsb; SUNI_PMON_FEBE_EVT_CNT_MSB = 0x07c,
u_int suni_pmon_febe_evt_cnt_msb; SUNI_DS3_TRAN_CFG = 0x080,
u_int suni_ds3_tran_cfg; SUNI_DS3_TRAN_DIAG = 0x084,
u_int suni_ds3_tran_diag; /* SUNI_RESERVED2 (0x23 - 0x21) */
u_int suni_reserved2[0x23-0x21]; SUNI_XFDL_CFG = 0x090,
u_int suni_xfdl_cfg; SUNI_XFDL_INTR_ST = 0x094,
u_int suni_xfdl_intr_st; SUNI_XFDL_XMIT_DATA = 0x098,
u_int suni_xfdl_xmit_data; SUNI_XBOC_CODE = 0x09c,
u_int suni_xboc_code; SUNI_SPLR_CFG = 0x0a0,
u_int suni_splr_cfg; SUNI_SPLR_INTR_EN = 0x0a4,
u_int suni_splr_intr_en; SUNI_SPLR_INTR_ST = 0x0a8,
u_int suni_splr_intr_st; SUNI_SPLR_STATUS = 0x0ac,
u_int suni_splr_status; SUNI_SPLT_CFG = 0x0b0,
u_int suni_splt_cfg; SUNI_SPLT_CNTL = 0x0b4,
u_int suni_splt_cntl; SUNI_SPLT_DIAG_G1 = 0x0b8,
u_int suni_splt_diag_g1; SUNI_SPLT_F1 = 0x0bc,
u_int suni_splt_f1; SUNI_CPPM_LOC_METERS = 0x0c0,
u_int suni_cppm_loc_meters; SUNI_CPPM_CHG_OF_CPPM_PERF_METR = 0x0c4,
u_int suni_cppm_chng_of_cppm_perf_meter; SUNI_CPPM_B1_ERR_CNT_LSB = 0x0c8,
u_int suni_cppm_b1_err_cnt_lsb; SUNI_CPPM_B1_ERR_CNT_MSB = 0x0cc,
u_int suni_cppm_b1_err_cnt_msb; SUNI_CPPM_FRAMING_ERR_CNT_LSB = 0x0d0,
u_int suni_cppm_framing_err_cnt_lsb; SUNI_CPPM_FRAMING_ERR_CNT_MSB = 0x0d4,
u_int suni_cppm_framing_err_cnt_msb; SUNI_CPPM_FEBE_CNT_LSB = 0x0d8,
u_int suni_cppm_febe_cnt_lsb; SUNI_CPPM_FEBE_CNT_MSB = 0x0dc,
u_int suni_cppm_febe_cnt_msb; SUNI_CPPM_HCS_ERR_CNT_LSB = 0x0e0,
u_int suni_cppm_hcs_err_cnt_lsb; SUNI_CPPM_HCS_ERR_CNT_MSB = 0x0e4,
u_int suni_cppm_hcs_err_cnt_msb; SUNI_CPPM_IDLE_UN_CELL_CNT_LSB = 0x0e8,
u_int suni_cppm_idle_un_cell_cnt_lsb; SUNI_CPPM_IDLE_UN_CELL_CNT_MSB = 0x0ec,
u_int suni_cppm_idle_un_cell_cnt_msb; SUNI_CPPM_RCV_CELL_CNT_LSB = 0x0f0,
u_int suni_cppm_rcv_cell_cnt_lsb; SUNI_CPPM_RCV_CELL_CNT_MSB = 0x0f4,
u_int suni_cppm_rcv_cell_cnt_msb; SUNI_CPPM_XMIT_CELL_CNT_LSB = 0x0f8,
u_int suni_cppm_xmit_cell_cnt_lsb; SUNI_CPPM_XMIT_CELL_CNT_MSB = 0x0fc,
u_int suni_cppm_xmit_cell_cnt_msb; SUNI_RXCP_CTRL = 0x100,
u_int suni_rxcp_ctrl; SUNI_RXCP_FCTRL = 0x104,
u_int suni_rxcp_fctrl; SUNI_RXCP_INTR_EN_STS = 0x108,
u_int suni_rxcp_intr_en_sts; SUNI_RXCP_IDLE_PAT_H1 = 0x10c,
u_int suni_rxcp_idle_pat_h1; SUNI_RXCP_IDLE_PAT_H2 = 0x110,
u_int suni_rxcp_idle_pat_h2; SUNI_RXCP_IDLE_PAT_H3 = 0x114,
u_int suni_rxcp_idle_pat_h3; SUNI_RXCP_IDLE_PAT_H4 = 0x118,
u_int suni_rxcp_idle_pat_h4; SUNI_RXCP_IDLE_MASK_H1 = 0x11c,
u_int suni_rxcp_idle_mask_h1; SUNI_RXCP_IDLE_MASK_H2 = 0x120,
u_int suni_rxcp_idle_mask_h2; SUNI_RXCP_IDLE_MASK_H3 = 0x124,
u_int suni_rxcp_idle_mask_h3; SUNI_RXCP_IDLE_MASK_H4 = 0x128,
u_int suni_rxcp_idle_mask_h4; SUNI_RXCP_CELL_PAT_H1 = 0x12c,
u_int suni_rxcp_cell_pat_h1; SUNI_RXCP_CELL_PAT_H2 = 0x130,
u_int suni_rxcp_cell_pat_h2; SUNI_RXCP_CELL_PAT_H3 = 0x134,
u_int suni_rxcp_cell_pat_h3; SUNI_RXCP_CELL_PAT_H4 = 0x138,
u_int suni_rxcp_cell_pat_h4; SUNI_RXCP_CELL_MASK_H1 = 0x13c,
u_int suni_rxcp_cell_mask_h1; SUNI_RXCP_CELL_MASK_H2 = 0x140,
u_int suni_rxcp_cell_mask_h2; SUNI_RXCP_CELL_MASK_H3 = 0x144,
u_int suni_rxcp_cell_mask_h3; SUNI_RXCP_CELL_MASK_H4 = 0x148,
u_int suni_rxcp_cell_mask_h4; SUNI_RXCP_HCS_CS = 0x14c,
u_int suni_rxcp_hcs_cs; SUNI_RXCP_LCD_CNT_THRESHOLD = 0x150,
u_int suni_rxcp_lcd_cnt_threshold; /* SUNI_RESERVED3 (0x57 - 0x54) */
u_int suni_reserved3[0x57-0x54]; SUNI_TXCP_CTRL = 0x160,
u_int suni_txcp_ctrl; SUNI_TXCP_INTR_EN_STS = 0x164,
u_int suni_txcp_intr_en_sts; SUNI_TXCP_IDLE_PAT_H1 = 0x168,
u_int suni_txcp_idle_pat_h1; SUNI_TXCP_IDLE_PAT_H2 = 0x16c,
u_int suni_txcp_idle_pat_h2; SUNI_TXCP_IDLE_PAT_H3 = 0x170,
u_int suni_txcp_idle_pat_h3; SUNI_TXCP_IDLE_PAT_H4 = 0x174,
u_int suni_txcp_idle_pat_h4; SUNI_TXCP_IDLE_PAT_H5 = 0x178,
u_int suni_txcp_idle_pat_h5; SUNI_TXCP_IDLE_PAYLOAD = 0x17c,
u_int suni_txcp_idle_payload; SUNI_E3_FRM_FRAM_OPTIONS = 0x180,
u_int suni_e3_frm_fram_options; SUNI_E3_FRM_MAINT_OPTIONS = 0x184,
u_int suni_e3_frm_maint_options; SUNI_E3_FRM_FRAM_INTR_ENBL = 0x188,
u_int suni_e3_frm_fram_intr_enbl; SUNI_E3_FRM_FRAM_INTR_IND_STAT = 0x18c,
u_int suni_e3_frm_fram_intr_ind_stat; SUNI_E3_FRM_MAINT_INTR_ENBL = 0x190,
u_int suni_e3_frm_maint_intr_enbl; SUNI_E3_FRM_MAINT_INTR_IND = 0x194,
u_int suni_e3_frm_maint_intr_ind; SUNI_E3_FRM_MAINT_STAT = 0x198,
u_int suni_e3_frm_maint_stat; SUNI_RESERVED4 = 0x19c,
u_int suni_reserved4; SUNI_E3_TRAN_FRAM_OPTIONS = 0x1a0,
u_int suni_e3_tran_fram_options; SUNI_E3_TRAN_STAT_DIAG_OPTIONS = 0x1a4,
u_int suni_e3_tran_stat_diag_options; SUNI_E3_TRAN_BIP_8_ERR_MASK = 0x1a8,
u_int suni_e3_tran_bip_8_err_mask; SUNI_E3_TRAN_MAINT_ADAPT_OPTS = 0x1ac,
u_int suni_e3_tran_maint_adapt_options; SUNI_TTB_CTRL = 0x1b0,
u_int suni_ttb_ctrl; SUNI_TTB_TRAIL_TRACE_ID_STAT = 0x1b4,
u_int suni_ttb_trail_trace_id_stat; SUNI_TTB_IND_ADDR = 0x1b8,
u_int suni_ttb_ind_addr; SUNI_TTB_IND_DATA = 0x1bc,
u_int suni_ttb_ind_data; SUNI_TTB_EXP_PAYLOAD_TYPE = 0x1c0,
u_int suni_ttb_exp_payload_type; SUNI_TTB_PAYLOAD_TYPE_CTRL_STAT = 0x1c4,
u_int suni_ttb_payload_type_ctrl_stat; /* SUNI_PAD5 (0x7f - 0x71) */
u_int suni_pad5[0x7f-0x71]; SUNI_MASTER_TEST = 0x200,
u_int suni_master_test; /* SUNI_PAD6 (0xff - 0x80) */
u_int suni_pad6[0xff-0x80]; };
}suni_pm7345_t;
#define SUNI_PM7345_T suni_pm7345_t #define SUNI_PM7345_T suni_pm7345_t
#define SUNI_PM7345 0x20 /* Suni chip type */ #define SUNI_PM7345 0x20 /* Suni chip type */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册