From: Lee Jones <lee.jones@linaro.org>
To: Xu Yilun <yilun.xu@intel.com>
Cc: arnd@arndb.de, gregkh@linuxfoundation.org,
linux-kernel@vger.kernel.org, trix@redhat.com,
lgoncalv@redhat.com, hao.wu@intel.com, matthew.gerlach@intel.com,
russell.h.weight@intel.com
Subject: Re: [PATCH 1/2] mfd: intel-m10-bmc: specify the retimer sub devices
Date: Wed, 6 Jan 2021 08:23:30 +0000 [thread overview]
Message-ID: <20210106082330.GB1592923@dell> (raw)
In-Reply-To: <1609918567-13339-2-git-send-email-yilun.xu@intel.com>
On Wed, 06 Jan 2021, Xu Yilun wrote:
> The patch specifies the 2 retimer sub devices and their resources in the
> parent driver's mfd_cell. It also adds the register definition of the
> retimer sub devices.
>
> There are 2 ethernet retimer chips (C827) connected to the Intel MAX 10
> BMC. They are managed by the BMC firmware, and host could query them via
> retimer interfaces (shared registers) on the BMC. The 2 retimers have
> identical register interfaces in different register addresses or fields,
> so it is better we define 2 retimer devices and handle them with the same
> driver.
>
> Signed-off-by: Xu Yilun <yilun.xu@intel.com>
> ---
> drivers/mfd/intel-m10-bmc.c | 19 ++++++++++++++++++-
> include/linux/mfd/intel-m10-bmc.h | 7 +++++++
> 2 files changed, 25 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/mfd/intel-m10-bmc.c b/drivers/mfd/intel-m10-bmc.c
> index b84579b..e0a99a0 100644
> --- a/drivers/mfd/intel-m10-bmc.c
> +++ b/drivers/mfd/intel-m10-bmc.c
> @@ -17,9 +17,26 @@ enum m10bmc_type {
> M10_N3000,
> };
>
> +static struct resource retimer0_resources[] = {
> + {M10BMC_PKVL_A_VER, M10BMC_PKVL_A_VER, "version", IORESOURCE_REG, },
> +};
> +
> +static struct resource retimer1_resources[] = {
> + {M10BMC_PKVL_B_VER, M10BMC_PKVL_B_VER, "version", IORESOURCE_REG, },
> +};
Please use the DEFINE_RES_*() helpers for this.
> static struct mfd_cell m10bmc_pacn3000_subdevs[] = {
> { .name = "n3000bmc-hwmon" },
> - { .name = "n3000bmc-retimer" },
> + {
> + .name = "n3000bmc-retimer",
> + .num_resources = ARRAY_SIZE(retimer0_resources),
> + .resources = retimer0_resources,
> + },
> + {
> + .name = "n3000bmc-retimer",
> + .num_resources = ARRAY_SIZE(retimer1_resources),
> + .resources = retimer1_resources,
> + },
> { .name = "n3000bmc-secure" },
> };
>
> diff --git a/include/linux/mfd/intel-m10-bmc.h b/include/linux/mfd/intel-m10-bmc.h
> index c8ef2f1..d6216f9 100644
> --- a/include/linux/mfd/intel-m10-bmc.h
> +++ b/include/linux/mfd/intel-m10-bmc.h
> @@ -21,6 +21,13 @@
> #define M10BMC_VER_PCB_INFO_MSK GENMASK(31, 24)
> #define M10BMC_VER_LEGACY_INVALID 0xffffffff
>
> +/* Retimer related registers, in system register region */
> +#define M10BMC_PKVL_LSTATUS 0x164
> +#define M10BMC_PKVL_A_VER 0x254
> +#define M10BMC_PKVL_B_VER 0x258
> +#define M10BMC_PKVL_SERDES_VER GENMASK(15, 0)
> +#define M10BMC_PKVL_SBUS_VER GENMASK(31, 16)
> +
> /**
> * struct intel_m10bmc - Intel MAX 10 BMC parent driver data structure
> * @dev: this device
--
Lee Jones [李琼斯]
Senior Technical Lead - Developer Services
Linaro.org │ Open source software for Arm SoCs
Follow Linaro: Facebook | Twitter | Blog
next prev parent reply other threads:[~2021-01-06 8:24 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-06 7:36 [PATCH 0/2] Add retimer interfaces support for Intel MAX 10 BMC Xu Yilun
2021-01-06 7:36 ` [PATCH 1/2] mfd: intel-m10-bmc: specify the retimer sub devices Xu Yilun
2021-01-06 8:23 ` Lee Jones [this message]
2021-01-07 4:16 ` Xu Yilun
2021-01-06 7:36 ` [PATCH 2/2] misc: add support for retimers interfaces on Intel MAX 10 BMC Xu Yilun
2021-01-06 7:56 ` Greg KH
2021-01-06 8:53 ` Xu Yilun
2021-01-06 9:06 ` Greg KH
2021-01-07 4:14 ` Xu Yilun
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=20210106082330.GB1592923@dell \
--to=lee.jones@linaro.org \
--cc=arnd@arndb.de \
--cc=gregkh@linuxfoundation.org \
--cc=hao.wu@intel.com \
--cc=lgoncalv@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=matthew.gerlach@intel.com \
--cc=russell.h.weight@intel.com \
--cc=trix@redhat.com \
--cc=yilun.xu@intel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).