On Fri, 2018-02-23 at 15:04 +0800, Haiyue Wang wrote:Not sure, I've added the specification of eSPI, hope people don't feel confused with SPI. :-)
When PCH works under eSPI mode, the PMC (Power Management Controller)So, do we have an agreement that the driver should go in this shape w/o
in
PCH is waiting for SUS_ACK from BMC after it alerts SUS_WARN. It is in
dead loop if no SUS_ACK assert. This is the basic requirement for the
BMC
works as eSPI slave.
interacting with SPI subsystem?
Also few comments below.OK, it looks clean. I referred to:
+config ASPEED_ESPI_SLAVEI would rather split this to two
+ depends on (ARCH_ASPEED || COMPILE_TEST) && REGMAP_MMIO
depends on REGMAP_MMIO
depends on ARCH_ASPEED || COMPILE_TEST
Oh, I ctrl+c / ctrl+v from other device tree usage module. :-(+ tristate "Aspeed ast2500 eSPI slave device driver"What exactly requires this header?
+ ---help---
+ Control Aspeed ast2500 eSPI slave controller to handle
event
+ which needs the firmware's processing.
+#include <linux/of.h>
Fixed!+static int aspeed_espi_slave_probe(struct platform_device *pdev)Do this after checks and memory allocations.
+{
+ struct aspeed_espi_slave_data *priv;
+ struct device *dev = &pdev->dev;
+ struct resource *res;
+ void __iomem *regs;
+ int rc;
+
+ dev_set_name(dev, DEVICE_NAME);
Fixed.+This one should be closer to the struct of_device_id.
+ res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+ regs = devm_ioremap_resource(dev, res);
+ if (IS_ERR(regs))
+ return PTR_ERR(regs);
+
+ priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
+ if (!priv)
+ return -ENOMEM;
+
+ priv->map = devm_regmap_init_mmio(dev, regs,
&espi_slave_regmap_cfg);
+ if (IS_ERR(priv->map))
+ return PTR_ERR(priv->map);
+
+static const struct of_device_id of_espi_slave_match_table[] = {
+ { .compatible = "aspeed,ast2500-espi-slave" },
+ { }
+};
+MODULE_DEVICE_TABLE(of, of_espi_slave_match_table);