From: avifishman70@gmail.com
To: minyard@acm.org, arnd@arndb.de, gregkh@linuxfoundation.org,
openipmi-developer@lists.sourceforge.net, joel@jms.id.au,
openbmc@lists.ozlabs.org
Cc: haiyue.wang@linux.intel.com, tmaimon77@gmail.com,
tali.perry1@gmail.com, avifishman70@gmail.com,
Avi Fishman <AviFishman70@gmail.com>
Subject: [PATCH v1 1/1] ipmi: NPCM7xx KCS BMC: enable interrupt to the host
Date: Wed, 16 May 2018 12:37:52 +0300 [thread overview]
Message-ID: <1526463472-7979-2-git-send-email-avifishman70@gmail.com> (raw)
In-Reply-To: <1526463472-7979-1-git-send-email-avifishman70@gmail.com>
From: Avi Fishman <AviFishman70@gmail.com>
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>
---
drivers/char/ipmi/kcs_bmc_npcm7xx.c | 20 ++++++++++++++++----
1 file changed, 16 insertions(+), 4 deletions(-)
diff --git a/drivers/char/ipmi/kcs_bmc_npcm7xx.c b/drivers/char/ipmi/kcs_bmc_npcm7xx.c
index 7bc898c5d372..5894561d061f 100644
--- a/drivers/char/ipmi/kcs_bmc_npcm7xx.c
+++ b/drivers/char/ipmi/kcs_bmc_npcm7xx.c
@@ -37,7 +37,14 @@
#define KCS1CTL 0x18
#define KCS2CTL 0x2A
#define KCS3CTL 0x3C
-#define KCS_CTL_IBFIE BIT(0)
+
+#define KCS1IE 0x1C
+#define KCS2IE 0x2E
+#define KCS3IE 0x40
+
+#define KCS_CTL_IBFIE BIT(0)
+#define KCS_IE_IRQE BIT(0)
+#define KCS_IE_HIRQE BIT(3)
/*
* 7.2.4 Core KCS Registers
@@ -48,12 +55,14 @@
* dob: KCS Channel n Data Out Buffer Register (KCSnDO).
* dib: KCS Channel n Data In Buffer Register (KCSnDI).
* ctl: KCS Channel n Control Register (KCSnCTL).
+ * ie : KCS Channel n Interrupt Enable Register (KCSnIE).
*/
struct npcm7xx_kcs_reg {
u32 sts;
u32 dob;
u32 dib;
u32 ctl;
+ u32 ie;
};
struct npcm7xx_kcs_bmc {
@@ -63,9 +72,9 @@ struct npcm7xx_kcs_bmc {
};
static const struct npcm7xx_kcs_reg npcm7xx_kcs_reg_tbl[KCS_CHANNEL_MAX] = {
- { .sts = KCS1ST, .dob = KCS1DO, .dib = KCS1DI, .ctl = KCS1CTL },
- { .sts = KCS2ST, .dob = KCS2DO, .dib = KCS2DI, .ctl = KCS2CTL },
- { .sts = KCS3ST, .dob = KCS3DO, .dib = KCS3DI, .ctl = KCS3CTL },
+ { .sts = KCS1ST, .dob = KCS1DO, .dib = KCS1DI, .ctl = KCS1CTL, .ie = KCS1IE },
+ { .sts = KCS2ST, .dob = KCS2DO, .dib = KCS2DI, .ctl = KCS2CTL, .ie = KCS2IE },
+ { .sts = KCS3ST, .dob = KCS3DO, .dib = KCS3DI, .ctl = KCS3CTL, .ie = KCS3IE },
};
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)
regmap_update_bits(priv->map, priv->reg->ctl, KCS_CTL_IBFIE,
enable ? KCS_CTL_IBFIE : 0);
+
+ regmap_update_bits(priv->map, priv->reg->ie, KCS_IE_IRQE | KCS_IE_HIRQE,
+ enable ? KCS_IE_IRQE | KCS_IE_HIRQE : 0);
}
static irqreturn_t npcm7xx_kcs_irq(int irq, void *arg)
--
2.14.1
next prev parent reply other threads:[~2018-05-16 9:39 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-05-16 9:37 [PATCH v1 0/1] ipmi: NPCM7xx KCS BMC: enable interrupt to the host avifishman70
2018-05-16 9:37 ` avifishman70 [this message]
-- strict thread matches above, loose matches on Subject: below --
2018-05-15 13:38 avifishman70
2018-05-15 13:38 ` [PATCH v1 1/1] " avifishman70
2018-05-15 15:15 ` Greg KH
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1526463472-7979-2-git-send-email-avifishman70@gmail.com \
--to=avifishman70@gmail.com \
--cc=arnd@arndb.de \
--cc=gregkh@linuxfoundation.org \
--cc=haiyue.wang@linux.intel.com \
--cc=joel@jms.id.au \
--cc=minyard@acm.org \
--cc=openbmc@lists.ozlabs.org \
--cc=openipmi-developer@lists.sourceforge.net \
--cc=tali.perry1@gmail.com \
--cc=tmaimon77@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.