Skip to content

Commit 0f8604a

Browse files
committed
ipmi: NPCM7xx KCS BMC: enable interrupt to the host
Original kcs_bmc_npcm7xx.c was missing enabling to send interrupt to the host on writes to output buffer. This patch fixes it by setting the bits that enables the generation of IRQn events by hardware control based on the status of the OBF flag. Signed-off-by: Avi Fishman <AviFishman70@gmail.com>
1 parent 205cddd commit 0f8604a

File tree

1 file changed

+16
-4
lines changed

1 file changed

+16
-4
lines changed

drivers/char/ipmi/kcs_bmc_npcm7xx.c

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,14 @@
3737
#define KCS1CTL 0x18
3838
#define KCS2CTL 0x2A
3939
#define KCS3CTL 0x3C
40-
#define KCS_CTL_IBFIE BIT(0)
40+
41+
#define KCS1IE 0x1C
42+
#define KCS2IE 0x2E
43+
#define KCS3IE 0x40
44+
45+
#define KCS_CTL_IBFIE BIT(0)
46+
#define KCS_IE_IRQE BIT(0)
47+
#define KCS_IE_HIRQE BIT(3)
4148

4249
/*
4350
* 7.2.4 Core KCS Registers
@@ -48,12 +55,14 @@
4855
* dob: KCS Channel n Data Out Buffer Register (KCSnDO).
4956
* dib: KCS Channel n Data In Buffer Register (KCSnDI).
5057
* ctl: KCS Channel n Control Register (KCSnCTL).
58+
* ie : KCS Channel n Interrupt Enable Register (KCSnIE).
5159
*/
5260
struct npcm7xx_kcs_reg {
5361
u32 sts;
5462
u32 dob;
5563
u32 dib;
5664
u32 ctl;
65+
u32 ie;
5766
};
5867

5968
struct npcm7xx_kcs_bmc {
@@ -63,9 +72,9 @@ struct npcm7xx_kcs_bmc {
6372
};
6473

6574
static const struct npcm7xx_kcs_reg npcm7xx_kcs_reg_tbl[KCS_CHANNEL_MAX] = {
66-
{ .sts = KCS1ST, .dob = KCS1DO, .dib = KCS1DI, .ctl = KCS1CTL },
67-
{ .sts = KCS2ST, .dob = KCS2DO, .dib = KCS2DI, .ctl = KCS2CTL },
68-
{ .sts = KCS3ST, .dob = KCS3DO, .dib = KCS3DI, .ctl = KCS3CTL },
75+
{ .sts = KCS1ST, .dob = KCS1DO, .dib = KCS1DI, .ctl = KCS1CTL, .ie = KCS1IE },
76+
{ .sts = KCS2ST, .dob = KCS2DO, .dib = KCS2DI, .ctl = KCS2CTL, .ie = KCS2IE },
77+
{ .sts = KCS3ST, .dob = KCS3DO, .dib = KCS3DI, .ctl = KCS3CTL, .ie = KCS3IE },
6978
};
7079

7180
static u8 npcm7xx_kcs_inb(struct kcs_bmc *kcs_bmc, u32 reg)
@@ -95,6 +104,9 @@ static void npcm7xx_kcs_enable_channel(struct kcs_bmc *kcs_bmc, bool enable)
95104

96105
regmap_update_bits(priv->map, priv->reg->ctl, KCS_CTL_IBFIE,
97106
enable ? KCS_CTL_IBFIE : 0);
107+
108+
regmap_update_bits(priv->map, priv->reg->ie, KCS_IE_IRQE | KCS_IE_HIRQE,
109+
enable ? KCS_IE_IRQE | KCS_IE_HIRQE : 0);
98110
}
99111

100112
static irqreturn_t npcm7xx_kcs_irq(int irq, void *arg)

0 commit comments

Comments
 (0)