2021-06-21 07:09:19

by Martin Hundebøll

[permalink] [raw]
Subject: [PATCH 0/4] fpga/mfd/hwmon: Initial support for Silicom N5010 PAC

From: Martin Hundebøll <[email protected]>

This is an initial set of patches for the Silciom N5010 programmable
accelerated card adding support for reading out sensors.

I'm not really sure if these should be taken through each of the
affected trees separately, or just by fpga collectively?

Based on current master.

// Martin

Debarati Biswas (1):
fpga: dfl: Move DFH header register macros to linux/dfl.h

Martin Hundebøll (3):
fpga: dfl: pci: add device IDs for Silicom N501x PAC cards
spi: spi-altera-dfl: support n5010 feature revision
hwmon: intel-m10-bmc: add sensor support for Silicom N5010 card

drivers/fpga/dfl-pci.c | 5 ++
drivers/fpga/dfl.h | 48 +-----------
drivers/hwmon/intel-m10-bmc-hwmon.c | 116 ++++++++++++++++++++++++++++
drivers/mfd/intel-m10-bmc.c | 12 ++-
drivers/spi/spi-altera-dfl.c | 15 +++-
include/linux/dfl.h | 52 +++++++++++++
6 files changed, 198 insertions(+), 50 deletions(-)

--
2.31.0


2021-06-21 07:10:25

by Martin Hundebøll

[permalink] [raw]
Subject: [PATCH 3/4] spi: spi-altera-dfl: support n5010 feature revision

The Max10 BMC on the Silicom n5010 PAC is slightly different than the
existing BMC's, so use a dedicated feature revision detect it.

Signed-off-by: Martin Hundebøll <[email protected]>
---
drivers/spi/spi-altera-dfl.c | 15 +++++++++++++--
1 file changed, 13 insertions(+), 2 deletions(-)

diff --git a/drivers/spi/spi-altera-dfl.c b/drivers/spi/spi-altera-dfl.c
index 3e32e4fe5895..d4908db39d87 100644
--- a/drivers/spi/spi-altera-dfl.c
+++ b/drivers/spi/spi-altera-dfl.c
@@ -111,6 +111,13 @@ static struct spi_board_info m10_bmc_info = {
.chip_select = 0,
};

+static struct spi_board_info m10_n5010_bmc_info = {
+ .modalias = "m10-n5010",
+ .max_speed_hz = 12500000,
+ .bus_num = 0,
+ .chip_select = 0,
+};
+
static void config_spi_master(void __iomem *base, struct spi_master *master)
{
u64 v;
@@ -130,6 +137,7 @@ static void config_spi_master(void __iomem *base, struct spi_master *master)

static int dfl_spi_altera_probe(struct dfl_device *dfl_dev)
{
+ struct spi_board_info *board_info = &m10_bmc_info;
struct device *dev = &dfl_dev->dev;
struct spi_master *master;
struct altera_spi *hw;
@@ -172,9 +180,12 @@ static int dfl_spi_altera_probe(struct dfl_device *dfl_dev)
goto exit;
}

- if (!spi_new_device(master, &m10_bmc_info)) {
+ if (dfl_feature_revision(base) == FME_FEATURE_REV_MAX10_SPI_N5010)
+ board_info = &m10_n5010_bmc_info;
+
+ if (!spi_new_device(master, board_info)) {
dev_err(dev, "%s failed to create SPI device: %s\n",
- __func__, m10_bmc_info.modalias);
+ __func__, board_info->modalias);
}

return 0;
--
2.31.0

2021-06-21 08:46:03

by Xu Yilun

[permalink] [raw]
Subject: Re: [PATCH 0/4] fpga/mfd/hwmon: Initial support for Silicom N5010 PAC

On Mon, Jun 21, 2021 at 09:06:17AM +0200, Martin Hundeb?ll wrote:
> From: Martin Hundeb?ll <[email protected]>
>
> This is an initial set of patches for the Silciom N5010 programmable
> accelerated card adding support for reading out sensors.

Seems the card is a variant of d5005, just changes the layout of the
sensors in BMC. It may not worth a dedicated PCI DID, and pass
down the info all the way from
pcie -> dfl -> spi-altera -> m10bmc -> m10bmc-hwmon

Is it possible we just have some version check in m10bmc?

Thank,
Yilun

>
> I'm not really sure if these should be taken through each of the
> affected trees separately, or just by fpga collectively?
>
> Based on current master.
>
> // Martin
>
> Debarati Biswas (1):
> fpga: dfl: Move DFH header register macros to linux/dfl.h
>
> Martin Hundeb?ll (3):
> fpga: dfl: pci: add device IDs for Silicom N501x PAC cards
> spi: spi-altera-dfl: support n5010 feature revision
> hwmon: intel-m10-bmc: add sensor support for Silicom N5010 card
>
> drivers/fpga/dfl-pci.c | 5 ++
> drivers/fpga/dfl.h | 48 +-----------
> drivers/hwmon/intel-m10-bmc-hwmon.c | 116 ++++++++++++++++++++++++++++
> drivers/mfd/intel-m10-bmc.c | 12 ++-
> drivers/spi/spi-altera-dfl.c | 15 +++-
> include/linux/dfl.h | 52 +++++++++++++
> 6 files changed, 198 insertions(+), 50 deletions(-)
>
> --
> 2.31.0

2021-06-25 07:13:30

by Martin Hundebøll

[permalink] [raw]
Subject: Re: [PATCH 0/4] fpga/mfd/hwmon: Initial support for Silicom N5010 PAC

Hi Yilun,

On 21/06/2021 10.38, Xu Yilun wrote:
> On Mon, Jun 21, 2021 at 09:06:17AM +0200, Martin Hundebøll wrote:
>> From: Martin Hundebøll <[email protected]>
>>
>> This is an initial set of patches for the Silciom N5010 programmable
>> accelerated card adding support for reading out sensors.
>
> Seems the card is a variant of d5005, just changes the layout of the
> sensors in BMC. It may not worth a dedicated PCI DID, and pass
> down the info all the way from
> pcie -> dfl -> spi-altera -> m10bmc -> m10bmc-hwmon
>
> Is it possible we just have some version check in m10bmc?

I think not.

The n501x is a Silicom card, and d5005 is from Intel. The Max10 based BMC
is quite similar, which is why we use a feature revision to differentiate,
but the main FPGA register layout is a different story.

// Martin

>>
>> I'm not really sure if these should be taken through each of the
>> affected trees separately, or just by fpga collectively?
>>
>> Based on current master.
>>
>> // Martin
>>
>> Debarati Biswas (1):
>> fpga: dfl: Move DFH header register macros to linux/dfl.h
>>
>> Martin Hundebøll (3):
>> fpga: dfl: pci: add device IDs for Silicom N501x PAC cards
>> spi: spi-altera-dfl: support n5010 feature revision
>> hwmon: intel-m10-bmc: add sensor support for Silicom N5010 card
>>
>> drivers/fpga/dfl-pci.c | 5 ++
>> drivers/fpga/dfl.h | 48 +-----------
>> drivers/hwmon/intel-m10-bmc-hwmon.c | 116 ++++++++++++++++++++++++++++
>> drivers/mfd/intel-m10-bmc.c | 12 ++-
>> drivers/spi/spi-altera-dfl.c | 15 +++-
>> include/linux/dfl.h | 52 +++++++++++++
>> 6 files changed, 198 insertions(+), 50 deletions(-)
>>
>> --
>> 2.31.0