Re: [PATCH v2 16/21] ipmi: kcs_bmc: Add a "raw" character device interface

2021-04-13 Thread Andrew Jeffery
On Tue, 13 Apr 2021, at 17:52, Arnd Bergmann wrote: > On Tue, Apr 13, 2021 at 1:45 AM Andrew Jeffery wrote: > > On Mon, 12 Apr 2021, at 18:18, Arnd Bergmann wrote: > > > On Mon, Apr 12, 2021 at 3:33 AM Andrew Jeffery wrote: > > > > On Fri, 9 Apr 2021,

Re: [PATCH v2 16/21] ipmi: kcs_bmc: Add a "raw" character device interface

2021-04-12 Thread Andrew Jeffery
On Mon, 12 Apr 2021, at 18:18, Arnd Bergmann wrote: > On Mon, Apr 12, 2021 at 3:33 AM Andrew Jeffery wrote: > > On Fri, 9 Apr 2021, at 17:25, Arnd Bergmann wrote: > > > On Fri, Mar 19, 2021 at 7:31 AM Andrew Jeffery wrote: > > > > > > > > The exi

Re: [PATCH v6 3/4] serial: 8250_aspeed_vuart: add aspeed,lpc-io-reg and aspeed,lpc-interrupts DT properties

2021-04-12 Thread Andrew Jeffery
On Mon, 12 Apr 2021, at 13:17, Zev Weiss wrote: > These allow describing all the Aspeed VUART attributes currently > available via sysfs. aspeed,lpc-interrupts provides a replacement for > the deprecated aspeed,sirq-polarity-sense property. > > Signed-off-by: Zev Weiss Revi

Re: [PATCH v1 2/2] mmc: sdhci-of-aspeed: Support toggling SD bus signal voltage by GPIO

2021-04-12 Thread Andrew Jeffery
On Mon, 12 Apr 2021, at 16:20, Steven Lee wrote: > The 04/09/2021 12:14, Andrew Jeffery wrote: > > Hi Steven, > > > > On Thu, 8 Apr 2021, at 11:22, Steven Lee wrote: > > > AST2600-A2 EVB provides reference design to support toggling signal > > > voltag

Re: [PATCH v3] ARM: dts: aspeed: add ASRock E3C246D4I BMC

2021-04-11 Thread Andrew Jeffery
io-channels = < 0>, < 1>, < 2>, < 3>, < 4>, > + < 5>, < 6>, < 7>, < 8>, < 9>, > + < 10>, < 11>, < 12>; > + }; > +}; > + > + { > + status = "okay"; > + flash@0 { > + status = "okay"; > + m25p,fast-read; > + label = "bmc"; > + spi-max-frequency = <1>; /* 100 MHz */ > +#include "openbmc-flash-layout.dtsi" > + }; > +}; > + > + { > + status = "okay"; > +}; > + > + { > + status = "okay"; > + aspeed,sirq-active-high; This should probably go away, but otherwise, Reviewed-by: Andrew Jeffery

Re: [PATCH v2 16/21] ipmi: kcs_bmc: Add a "raw" character device interface

2021-04-11 Thread Andrew Jeffery
On Fri, 9 Apr 2021, at 17:25, Arnd Bergmann wrote: > On Fri, Mar 19, 2021 at 7:31 AM Andrew Jeffery wrote: > > > > The existing IPMI chardev encodes IPMI behaviours as the name suggests. > > However, KCS devices are useful beyond IPMI (or keyboards), as they > > provi

Re: [PATCH v2 10/21] ipmi: kcs_bmc: Turn the driver data-structures inside-out

2021-04-11 Thread Andrew Jeffery
On Sat, 10 Apr 2021, at 04:56, Zev Weiss wrote: > On Fri, Apr 09, 2021 at 01:25:26AM CDT, Zev Weiss wrote: > >On Fri, Apr 09, 2021 at 12:59:09AM CDT, Andrew Jeffery wrote: > >>On Fri, 9 Apr 2021, at 13:27, Zev Weiss wrote: > >>>On Fri, Mar 19, 2021 at 01:27:

Re: [PATCH v2 16/21] ipmi: kcs_bmc: Add a "raw" character device interface

2021-04-09 Thread Andrew Jeffery
On Fri, 9 Apr 2021, at 14:47, Zev Weiss wrote: > On Fri, Mar 19, 2021 at 01:27:47AM CDT, Andrew Jeffery wrote: > >The existing IPMI chardev encodes IPMI behaviours as the name suggests. > >However, KCS devices are useful beyond IPMI (or keyboards), as they > >provide a m

Re: [PATCH v2 14/21] ipmi: kcs_bmc: Allow clients to control KCS IRQ state

2021-04-09 Thread Andrew Jeffery
On Fri, 9 Apr 2021, at 14:07, Zev Weiss wrote: > On Fri, Mar 19, 2021 at 01:27:45AM CDT, Andrew Jeffery wrote: > >Add a mechanism for controlling whether the client associated with a > >KCS device will receive Input Buffer Full (IBF) and Output Buffer Empty > >(OBE)

Re: [PATCH v2 13/21] ipmi: kcs_bmc: Decouple the IPMI chardev from the core

2021-04-09 Thread Andrew Jeffery
On Fri, 9 Apr 2021, at 14:05, Zev Weiss wrote: > On Fri, Mar 19, 2021 at 01:27:44AM CDT, Andrew Jeffery wrote: > >Now that we have untangled the data-structures, split the userspace > >interface out into its own module. Userspace interfaces and drivers are > >registere

Re: [PATCH v2 12/21] ipmi: kcs_bmc: Strip private client data from struct kcs_bmc

2021-04-09 Thread Andrew Jeffery
On Fri, 9 Apr 2021, at 13:37, Zev Weiss wrote: > On Fri, Mar 19, 2021 at 01:27:43AM CDT, Andrew Jeffery wrote: > >Move all client-private data out of `struct kcs_bmc` into the KCS client > >implementation. > > > >With this change the KCS BMC core code now only conce

Re: [PATCH v2 11/21] ipmi: kcs_bmc: Split headers into device and client

2021-04-09 Thread Andrew Jeffery
On Fri, 9 Apr 2021, at 13:31, Zev Weiss wrote: > On Fri, Mar 19, 2021 at 01:27:42AM CDT, Andrew Jeffery wrote: > >Strengthen the distinction between code that abstracts the > >implementation of the KCS behaviours (device drivers) and code that > >exploits KCS behaviours (cl

Re: [PATCH v2 10/21] ipmi: kcs_bmc: Turn the driver data-structures inside-out

2021-04-08 Thread Andrew Jeffery
On Fri, 9 Apr 2021, at 13:27, Zev Weiss wrote: > On Fri, Mar 19, 2021 at 01:27:41AM CDT, Andrew Jeffery wrote: > >Make the KCS device drivers responsible for allocating their own memory. > > > >Until now the private data for the device driver was allocated internal &

Re: [PATCH v2 09/21] ipmi: kcs_bmc: Split out kcs_bmc_cdev_ipmi

2021-04-08 Thread Andrew Jeffery
On Fri, 9 Apr 2021, at 13:26, Zev Weiss wrote: > On Fri, Mar 19, 2021 at 01:27:40AM CDT, Andrew Jeffery wrote: > >Take steps towards defining a coherent API to separate the KCS device > >drivers from the userspace interface. Decreasing the coupling will > >improve the s

Re: [PATCH v2 00/21] ipmi: Allow raw access to KCS devices

2021-04-08 Thread Andrew Jeffery
On Fri, 9 Apr 2021, at 13:37, Joel Stanley wrote: > On Thu, 8 Apr 2021 at 23:47, Andrew Jeffery wrote: > > On Thu, 8 Apr 2021, at 21:44, Corey Minyard wrote: > > > On Thu, Apr 08, 2021 at 10:27:46AM +0930, Andrew Jeffery wrote: > > > > > > 1. It begins with

Re: [PATCH v2 17/21] dt-bindings: ipmi: Convert ASPEED KCS binding to schema

2021-04-08 Thread Andrew Jeffery
On Fri, 9 Apr 2021, at 14:45, Zev Weiss wrote: > On Fri, Mar 19, 2021 at 01:27:48AM CDT, Andrew Jeffery wrote: > >Given the deprecated binding, improve the ability to detect issues in > >the platform devicetrees. Further, a subsequent patch will introduce a > >ne

Re: [PATCH v2 01/21] dt-bindings: aspeed-lpc: Remove LPC partitioning

2021-04-08 Thread Andrew Jeffery
On Fri, 9 Apr 2021, at 12:48, Joel Stanley wrote: > On Fri, 19 Mar 2021 at 06:28, Andrew Jeffery wrote: > > > > From: "Chia-Wei, Wang" > > > > The LPC controller has no concept of the BMC and the Host partitions. > > This patch fixes the docum

Re: [PATCH v5 3/4] drivers/tty/serial/8250: add aspeed, lpc-io-reg and aspeed, lpc-interrupts DT properties

2021-04-08 Thread Andrew Jeffery
Hi Zev, A couple of minor comments: On Thu, 8 Apr 2021, at 10:46, Zev Weiss wrote: > These allow describing all the Aspeed VUART attributes currently > available via sysfs. aspeed,sirq aspeed,lpc-interrupts now > provides a replacement for the > deprecated aspeed,sirq-polarity-sense property.

Re: [PATCH v5 2/4] drivers/tty/serial/8250: refactor sirq and lpc address setting code

2021-04-08 Thread Andrew Jeffery
> + if (sirq > (ASPEED_VUART_GCRB_HOST_SIRQ_MASK >> > ASPEED_VUART_GCRB_HOST_SIRQ_SHIFT)) > + return -EINVAL; > + > + sirq <<= ASPEED_VUART_GCRB_HOST_SIRQ_SHIFT; > + sirq &= ASPEED_VUART_GCRB_HOST_SIRQ_MASK; This might be less verbose if

Re: [PATCH v1 2/2] mmc: sdhci-of-aspeed: Support toggling SD bus signal voltage by GPIO

2021-04-08 Thread Andrew Jeffery
Hi Steven, On Thu, 8 Apr 2021, at 11:22, Steven Lee wrote: > AST2600-A2 EVB provides reference design to support toggling signal > voltage between 3.3v and 1.8v by power-switch-gpio pin that defined in > the device tree. Is this something you think we need support for beyond the EVB? It sounds

Re: [PATCH v2 00/21] ipmi: Allow raw access to KCS devices

2021-04-08 Thread Andrew Jeffery
On Thu, 8 Apr 2021, at 21:44, Corey Minyard wrote: > On Thu, Apr 08, 2021 at 10:27:46AM +0930, Andrew Jeffery wrote: > > Hi Corey, > > > > On Fri, 19 Mar 2021, at 16:49, Andrew Jeffery wrote: > > > Hello, > > > > > > This series is a

Re: [PATCH v2 00/21] ipmi: Allow raw access to KCS devices

2021-04-07 Thread Andrew Jeffery
Hi Corey, On Fri, 19 Mar 2021, at 16:49, Andrew Jeffery wrote: > Hello, > > This series is a bit of a mix of things, but its primary purpose is to > expose BMC KCS IPMI devices to userspace in a way that enables userspace > to talk to host firmware using protocols that are not IP

Re: [PATCH v3 4/4] dt-bindings: serial: 8250: add aspeed,lpc-address and aspeed,sirq

2021-04-01 Thread Andrew Jeffery
On Fri, 2 Apr 2021, at 11:17, Zev Weiss wrote: > These correspond to the existing lpc_address, sirq, and sirq_polarity > sysfs attributes; the second element of aspeed,sirq provides a > replacement for the deprecated aspeed,sirq-polarity-sense property. > > Signed-off-by: Zev Weiss > --- >

Re: [PATCH v2 2/3] drivers/tty/serial/8250: add DT property for aspeed vuart sirq polarity

2021-03-31 Thread Andrew Jeffery
On Thu, 1 Apr 2021, at 15:48, Zev Weiss wrote: > On Wed, Mar 31, 2021 at 11:15:44PM CDT, Joel Stanley wrote: > >On Thu, 1 Apr 2021 at 00:57, Zev Weiss wrote: > >> > >> This provides a simple boolean to use instead of the deprecated > >> aspeed,sirq-polarity-sense property. > >> > >>

Re: [PATCH v2 3/3] dt-bindings: serial: 8250: add aspeed,sirq-active-high

2021-03-31 Thread Andrew Jeffery
On Thu, 1 Apr 2021, at 11:27, Zev Weiss wrote: > This provides a simpler, more direct alternative to the deprecated > aspeed,sirq-polarity-sense property for indicating the polarity of > the Aspeed VUART's SIRQ line. > > Signed-off-by: Zev Weiss > --- >

Re: [PATCH 3/3] ARM: dts: aspeed: add ASRock E3C246D4I BMC

2021-03-31 Thread Andrew Jeffery
On Tue, 30 Mar 2021, at 10:53, Zev Weiss wrote: > This is a relatively low-cost AST2500-based Xeon E-2100/E-2200 series > mini-ITX board that we hope can provide a decent platform for OpenBMC > development. > > This initial device-tree provides the necessary configuration for > basic BMC

[PATCH v2 21/21] ipmi: kcs_bmc_aspeed: Optionally apply status address

2021-03-19 Thread Andrew Jeffery
addressing scheme. Allow these requests where possible if the devicetree specifies the status register address. Signed-off-by: Andrew Jeffery --- drivers/char/ipmi/kcs_bmc_aspeed.c | 113 + 1 file changed, 81 insertions(+), 32 deletions(-) diff --git a/drivers/char

[PATCH v2 20/21] ipmi: kcs_bmc_aspeed: Fix IBFIE typo from datasheet

2021-03-19 Thread Andrew Jeffery
Input Buffer Full Interrupt Enable (IBFIE) is typoed as IBFIF for some registers in the datasheet. Fix the driver to use the sensible acronym. Signed-off-by: Andrew Jeffery --- drivers/char/ipmi/kcs_bmc_aspeed.c | 24 1 file changed, 12 insertions(+), 12 deletions

[PATCH v2 19/21] ipmi: kcs_bmc_aspeed: Implement KCS SerIRQ configuration

2021-03-19 Thread Andrew Jeffery
Apply the SerIRQ ID and level/sense behaviours from the devicetree if provided. Signed-off-by: Andrew Jeffery --- drivers/char/ipmi/kcs_bmc_aspeed.c | 179 - 1 file changed, 177 insertions(+), 2 deletions(-) diff --git a/drivers/char/ipmi/kcs_bmc_aspeed.c b/drivers

[PATCH v2 17/21] dt-bindings: ipmi: Convert ASPEED KCS binding to schema

2021-03-19 Thread Andrew Jeffery
Given the deprecated binding, improve the ability to detect issues in the platform devicetrees. Further, a subsequent patch will introduce a new interrupts property for specifying SerIRQ behaviour, so convert before we do any further additions. Signed-off-by: Andrew Jeffery --- .../bindings

[PATCH v2 18/21] dt-bindings: ipmi: Add optional SerIRQ property to ASPEED KCS devices

2021-03-19 Thread Andrew Jeffery
devices to describe SerIRQ properties. Signed-off-by: Andrew Jeffery --- .../bindings/ipmi/aspeed,ast2400-kcs-bmc.yaml | 14 ++ 1 file changed, 14 insertions(+) diff --git a/Documentation/devicetree/bindings/ipmi/aspeed,ast2400-kcs-bmc.yaml b/Documentation/devicetree/bindings/ipmi

[PATCH v2 15/21] ipmi: kcs_bmc: Don't enforce single-open policy in the kernel

2021-03-19 Thread Andrew Jeffery
notification of events. However, any fd on any chardev may race their accesses to the data and status registers. Signed-off-by: Andrew Jeffery --- drivers/char/ipmi/kcs_bmc.c | 34 ++--- drivers/char/ipmi/kcs_bmc_aspeed.c | 3 +-- drivers/char/ipmi/kcs_bmc_npcm7xx.c | 3

[PATCH v2 16/21] ipmi: kcs_bmc: Add a "raw" character device interface

2021-03-19 Thread Andrew Jeffery
ssing both offsets in the one system call may block if the data registers are not ready. Signed-off-by: Andrew Jeffery --- Documentation/ABI/testing/dev-raw-kcs | 25 ++ drivers/char/ipmi/Kconfig | 17 + drivers/char/ipmi/Makefile| 1 + drivers/char/ipmi/kcs_bmc_cdev_ra

[PATCH v2 14/21] ipmi: kcs_bmc: Allow clients to control KCS IRQ state

2021-03-19 Thread Andrew Jeffery
an OBE interrupt for the BMC. Instead we pretend it has one by polling the status register waiting for the Output Buffer Full (OBF) bit to clear, and generating an event when OBE is observed. Signed-off-by: Andrew Jeffery --- drivers/char/ipmi/kcs_bmc.c | 6 ++ drivers/char/ipmi

[PATCH v2 11/21] ipmi: kcs_bmc: Split headers into device and client

2021-03-19 Thread Andrew Jeffery
Strengthen the distinction between code that abstracts the implementation of the KCS behaviours (device drivers) and code that exploits KCS behaviours (clients). Neither needs to know about the APIs required by the other, so provide separate headers. Signed-off-by: Andrew Jeffery --- drivers

[PATCH v2 12/21] ipmi: kcs_bmc: Strip private client data from struct kcs_bmc

2021-03-19 Thread Andrew Jeffery
as required. Finally, now that it is free of client data, `struct kcs_bmc` is renamed to `struct kcs_bmc_device` to contrast `struct kcs_bmc_client`. Signed-off-by: Andrew Jeffery --- drivers/char/ipmi/kcs_bmc.c | 68 +++- drivers/char/ipmi/kcs_bmc.h | 86 +- drivers

[PATCH v2 13/21] ipmi: kcs_bmc: Decouple the IPMI chardev from the core

2021-03-19 Thread Andrew Jeffery
Now that we have untangled the data-structures, split the userspace interface out into its own module. Userspace interfaces and drivers are registered to the KCS BMC core to support arbitrary binding of either. Signed-off-by: Andrew Jeffery --- drivers/char/ipmi/Kconfig | 13

[PATCH v2 10/21] ipmi: kcs_bmc: Turn the driver data-structures inside-out

2021-03-19 Thread Andrew Jeffery
a layer off the onion and turn the data-structures inside out by exploiting container_of() and embedding `struct kcs_device` in the driver private data. Signed-off-by: Andrew Jeffery --- drivers/char/ipmi/kcs_bmc.c | 15 +-- drivers/char/ipmi/kcs_bmc.h | 12 ++ drivers

[PATCH v2 09/21] ipmi: kcs_bmc: Split out kcs_bmc_cdev_ipmi

2021-03-19 Thread Andrew Jeffery
file. The code continues to build into the same module. Signed-off-by: Andrew Jeffery --- drivers/char/ipmi/Makefile| 2 +- drivers/char/ipmi/kcs_bmc.c | 423 + drivers/char/ipmi/kcs_bmc.h | 10 +- drivers/char/ipmi/kcs_bmc_cdev_ipmi.c

[PATCH v2 05/21] soc: aspeed: Adapt to new LPC device tree layout

2021-03-19 Thread Andrew Jeffery
From: "Chia-Wei, Wang" Add check against LPC device v2 compatible string to ensure that the fixed device tree layout is adopted. The LPC register offsets are also fixed accordingly. Signed-off-by: Chia-Wei Wang Reviewed-by: Andrew Jeffery --- drivers/soc/aspeed/aspeed-lpc-ct

[PATCH v2 08/21] ipmi: kcs_bmc: Rename {read,write}_{status,data}() functions

2021-03-19 Thread Andrew Jeffery
Rename the functions in preparation for separating the IPMI chardev out from the KCS BMC core. Signed-off-by: Andrew Jeffery --- drivers/char/ipmi/kcs_bmc.c | 52 ++--- 1 file changed, 25 insertions(+), 27 deletions(-) diff --git a/drivers/char/ipmi/kcs_bmc.c b

[PATCH v2 07/21] ipmi: kcs_bmc: Make status update atomic

2021-03-19 Thread Andrew Jeffery
Enable more efficient implementation of read-modify-write sequences. Both device drivers for the KCS BMC stack use regmaps. The new callback allows us to exploit regmap_update_bits(). Signed-off-by: Andrew Jeffery --- drivers/char/ipmi/kcs_bmc.c | 7 +-- drivers/char/ipmi/kcs_bmc.h

[PATCH v2 06/21] ipmi: kcs_bmc_aspeed: Use of match data to extract KCS properties

2021-03-19 Thread Andrew Jeffery
Unpack and remove the aspeed_kcs_probe_of_v[12]() functions to aid rearranging how the private device-driver memory is allocated. Signed-off-by: Andrew Jeffery --- drivers/char/ipmi/kcs_bmc_aspeed.c | 146 ++--- 1 file changed, 68 insertions(+), 78 deletions(-) diff

[PATCH v2 04/21] pinctrl: aspeed-g5: Adapt to new LPC device tree layout

2021-03-19 Thread Andrew Jeffery
From: "Chia-Wei, Wang" Add check against LPC device v2 compatible string to ensure that the fixed device tree layout is adopted. The LPC register offsets are also fixed accordingly. Signed-off-by: Chia-Wei Wang Reviewed-by: Andrew Jeffery Acked-by: Linus Walleij --- drivers/pinc

[PATCH v2 03/21] ipmi: kcs: aspeed: Adapt to new LPC DTS layout

2021-03-19 Thread Andrew Jeffery
From: "Chia-Wei, Wang" Add check against LPC device v2 compatible string to ensure that the fixed device tree layout is adopted. The LPC register offsets are also fixed accordingly. Signed-off-by: Chia-Wei Wang Reviewed-by: Andrew Jeffery Acked-by: Haiyue Wang --- drivers

[PATCH v2 02/21] ARM: dts: Remove LPC BMC and Host partitions

2021-03-19 Thread Andrew Jeffery
uot; "aspeed,ast2500-lpc-v2" "aspeed,ast2600-lpc-v2" Signed-off-by: Chia-Wei Wang Reviewed-by: Andrew Jeffery --- arch/arm/boot/dts/aspeed-g4.dtsi | 70 +++--- arch/arm/boot/dts/aspeed-g5.dtsi | 121 +-

[PATCH v2 01/21] dt-bindings: aspeed-lpc: Remove LPC partitioning

2021-03-19 Thread Andrew Jeffery
Signed-off-by: Chia-Wei Wang Reviewed-by: Andrew Jeffery Acked-by: Rob Herring Acked-by: Lee Jones --- .../devicetree/bindings/mfd/aspeed-lpc.txt| 100 +- 1 file changed, 25 insertions(+), 75 deletions(-) diff --git a/Documentation/devicetree/bindings/mfd/aspeed-lpc.txt b/Doc

[PATCH v2 00/21] ipmi: Allow raw access to KCS devices

2021-03-19 Thread Andrew Jeffery
/standards/documents/DSP0254_1.0.0.pdf [5] https://lore.kernel.org/qemu-devel/20210309131641.2709380-1-...@kaod.org/ Andrew Jeffery (16): ipmi: kcs_bmc_aspeed: Use of match data to extract KCS properties ipmi: kcs_bmc: Make status update atomic ipmi: kcs_bmc: Rename {read,write}_{status,data}()

Re: [PATCH 16/19] dt-bindings: ipmi: Convert ASPEED KCS binding to schema

2021-03-08 Thread Andrew Jeffery
On Sat, 6 Mar 2021, at 09:37, Rob Herring wrote: > On Sat, Feb 20, 2021 at 12:55:20AM +1030, Andrew Jeffery wrote: > > Given the deprecated binding, improve the ability to detect issues in > > the platform devicetrees. Further, a subsequent patch will introduce a > > ne

Re: [PATCH 17/19] dt-bindings: ipmi: Add optional SerIRQ property to ASPEED KCS devices

2021-03-08 Thread Andrew Jeffery
On Sat, 6 Mar 2021, at 09:39, Rob Herring wrote: > On Sat, Feb 20, 2021 at 12:55:21AM +1030, Andrew Jeffery wrote: > > Allocating IO and IRQ resources to LPC devices is in-theory an operation > > for the host, however ASPEED don't appear to expose this capability > >

[PATCH 15/19] ipmi: kcs_bmc: Add a "raw" character device interface

2021-02-19 Thread Andrew Jeffery
ssing both offsets in the one system call may block if the data registers are not ready. Signed-off-by: Andrew Jeffery --- Documentation/ABI/testing/dev-raw-kcs | 25 ++ drivers/char/ipmi/Kconfig | 17 + drivers/char/ipmi/Makefile| 1 + drivers/char/ipmi/kcs_bmc_cdev_ra

[PATCH 16/19] dt-bindings: ipmi: Convert ASPEED KCS binding to schema

2021-02-19 Thread Andrew Jeffery
Given the deprecated binding, improve the ability to detect issues in the platform devicetrees. Further, a subsequent patch will introduce a new interrupts property for specifying SerIRQ behaviour, so convert before we do any further additions. Signed-off-by: Andrew Jeffery --- .../bindings

[PATCH 09/19] ipmi: kcs_bmc: Split out kcs_bmc_cdev_ipmi

2021-02-19 Thread Andrew Jeffery
file. The code continues to build into the same module. Signed-off-by: Andrew Jeffery --- drivers/char/ipmi/Makefile| 2 +- drivers/char/ipmi/kcs_bmc.c | 423 + drivers/char/ipmi/kcs_bmc.h | 10 +- drivers/char/ipmi/kcs_bmc_cdev_ipmi.c

[PATCH 19/19] ipmi: kcs_bmc_aspeed: Fix IBFIE typo from datasheet

2021-02-19 Thread Andrew Jeffery
Input Buffer Full Interrupt Enable (IBFIE) is typoed as IBFIF for some registers in the datasheet. Fix the driver to use the sensible acronym. Signed-off-by: Andrew Jeffery --- drivers/char/ipmi/kcs_bmc_aspeed.c | 24 1 file changed, 12 insertions(+), 12 deletions

[PATCH 11/19] ipmi: kcs_bmc: Split headers into device and client

2021-02-19 Thread Andrew Jeffery
Strengthen the distinction between code that abstracts the implementation of the KCS behaviours (device drivers) and code that exploits KCS behaviours (clients). Neither needs to know about the APIs required by the other, so provide separate headers. Signed-off-by: Andrew Jeffery --- drivers

[PATCH 18/19] ipmi: kcs_bmc_aspeed: Implement KCS SerIRQ configuration

2021-02-19 Thread Andrew Jeffery
Apply the SerIRQ ID and level/sense behaviours from the devicetree if provided. Signed-off-by: Andrew Jeffery --- drivers/char/ipmi/kcs_bmc_aspeed.c | 126 + 1 file changed, 126 insertions(+) diff --git a/drivers/char/ipmi/kcs_bmc_aspeed.c b/drivers/char/ipmi

[PATCH 14/19] ipmi: kcs_bmc: Allow clients to control KCS IRQ state

2021-02-19 Thread Andrew Jeffery
an OBE interrupt for the BMC. Instead we pretend it has one by polling the status register waiting for the Output Buffer Full (OBF) bit to clear, and generating an event when OBE is observed. Signed-off-by: Andrew Jeffery --- drivers/char/ipmi/kcs_bmc.c | 6 ++ drivers/char/ipmi

[PATCH 13/19] ipmi: kcs_bmc: Decouple the IPMI chardev from the core

2021-02-19 Thread Andrew Jeffery
Now that we have untangled the data-structures, split the userspace interface out into its own module. Userspace interfaces and drivers are registered to the KCS BMC core to support arbitrary binding of either. Signed-off-by: Andrew Jeffery --- drivers/char/ipmi/Kconfig | 13

[PATCH 12/19] ipmi: kcs_bmc: Strip private client data from struct kcs_bmc

2021-02-19 Thread Andrew Jeffery
as required. Finally, now that it is free of client data, `struct kcs_bmc` is renamed to `struct kcs_bmc_device` to contrast `struct kcs_bmc_client`. Signed-off-by: Andrew Jeffery --- drivers/char/ipmi/kcs_bmc.c | 68 - drivers/char/ipmi/kcs_bmc.h | 86 +- drivers

[PATCH 17/19] dt-bindings: ipmi: Add optional SerIRQ property to ASPEED KCS devices

2021-02-19 Thread Andrew Jeffery
devices to describe SerIRQ properties. Signed-off-by: Andrew Jeffery --- .../bindings/ipmi/aspeed,ast2400-kcs-bmc.yaml | 14 ++ 1 file changed, 14 insertions(+) diff --git a/Documentation/devicetree/bindings/ipmi/aspeed,ast2400-kcs-bmc.yaml b/Documentation/devicetree/bindings/ipmi

[PATCH 05/19] soc: aspeed: Adapt to new LPC device tree layout

2021-02-19 Thread Andrew Jeffery
From: "Chia-Wei, Wang" Add check against LPC device v2 compatible string to ensure that the fixed device tree layout is adopted. The LPC register offsets are also fixed accordingly. Signed-off-by: Chia-Wei Wang Reviewed-by: Andrew Jeffery Tested-by: Andrew Jeffery --- drivers/

[PATCH 07/19] ipmi: kcs_bmc: Make status update atomic

2021-02-19 Thread Andrew Jeffery
Enable more efficient implementation of read-modify-write sequences. Both device drivers for the KCS BMC stack use regmaps. The new callback allows us to exploit regmap_update_bits(). Signed-off-by: Andrew Jeffery --- drivers/char/ipmi/kcs_bmc.c | 7 +-- drivers/char/ipmi/kcs_bmc.h

[PATCH 10/19] ipmi: kcs_bmc: Turn the driver data-structures inside-out

2021-02-19 Thread Andrew Jeffery
a layer off the onion and turn the data-structures inside out by exploiting container_of() and embedding `struct kcs_device` in the driver private data. Signed-off-by: Andrew Jeffery --- drivers/char/ipmi/kcs_bmc.c | 15 +-- drivers/char/ipmi/kcs_bmc.h | 12 ++ drivers

[PATCH 06/19] ipmi: kcs_bmc_aspeed: Use of match data to extract KCS properties

2021-02-19 Thread Andrew Jeffery
Unpack and remove the aspeed_kcs_probe_of_v[12]() functions to aid rearranging how the private device-driver memory is allocated. Signed-off-by: Andrew Jeffery --- drivers/char/ipmi/kcs_bmc_aspeed.c | 146 ++--- 1 file changed, 68 insertions(+), 78 deletions(-) diff

[PATCH 08/19] ipmi: kcs_bmc: Rename {read,write}_{status,data}() functions

2021-02-19 Thread Andrew Jeffery
Rename the functions in preparation for separating the IPMI chardev out from the KCS BMC core. Signed-off-by: Andrew Jeffery --- drivers/char/ipmi/kcs_bmc.c | 52 ++--- 1 file changed, 25 insertions(+), 27 deletions(-) diff --git a/drivers/char/ipmi/kcs_bmc.c b

[PATCH 04/19] pinctrl: aspeed-g5: Adapt to new LPC device tree layout

2021-02-19 Thread Andrew Jeffery
From: "Chia-Wei, Wang" Add check against LPC device v2 compatible string to ensure that the fixed device tree layout is adopted. The LPC register offsets are also fixed accordingly. Signed-off-by: Chia-Wei Wang Reviewed-by: Andrew Jeffery Tested-by: Andrew Jeffery Acked-by: Lin

[PATCH 03/19] ipmi: kcs: aspeed: Adapt to new LPC DTS layout

2021-02-19 Thread Andrew Jeffery
From: "Chia-Wei, Wang" Add check against LPC device v2 compatible string to ensure that the fixed device tree layout is adopted. The LPC register offsets are also fixed accordingly. Signed-off-by: Chia-Wei Wang Reviewed-by: Andrew Jeffery Acked-by: Haiyue Wang Acked-by: Cor

[PATCH 01/19] dt-bindings: aspeed-lpc: Remove LPC partitioning

2021-02-19 Thread Andrew Jeffery
Signed-off-by: Chia-Wei Wang Reviewed-by: Andrew Jeffery Acked-by: Rob Herring --- .../devicetree/bindings/mfd/aspeed-lpc.txt| 100 +- 1 file changed, 25 insertions(+), 75 deletions(-) diff --git a/Documentation/devicetree/bindings/mfd/aspeed-lpc.txt b/Documentation/devicetre

[PATCH 02/19] ARM: dts: Remove LPC BMC and Host partitions

2021-02-19 Thread Andrew Jeffery
uot; "aspeed,ast2500-lpc-v2" "aspeed,ast2600-lpc-v2" Signed-off-by: Chia-Wei Wang Reviewed-by: Andrew Jeffery Tested-by: Andrew Jeffery --- arch/arm/boot/dts/aspeed-g4.dtsi | 68 +++-- arch/arm/boot/dts/aspeed-g5.dtsi | 119 +---

[PATCH 00/19] ipmi: Allow raw access to KCS devices

2021-02-19 Thread Andrew Jeffery
es/default/files/standards/documents/DSP0254_1.0.0.pdf [5] https://github.com/amboar/qemu/tree/kcs Andrew Jeffery (14): ipmi: kcs_bmc_aspeed: Use of match data to extract KCS properties ipmi: kcs_bmc: Make status update atomic ipmi: kcs_bmc: Rename {read,write}_{status,data}() functions ipm

Re: [PATCH v5 1/5] dt-bindings: aspeed-lpc: Remove LPC partitioning

2021-02-17 Thread Andrew Jeffery
On Wed, 17 Feb 2021, at 18:14, Joel Stanley wrote: > Hi Chaiwei, > > On Wed, 17 Feb 2021 at 07:40, ChiaWei Wang > wrote: > > > > Hi All, > > > > Do you have update on this patch series? > > Aspeed has subsequent LPC module upstream plan. > > We hope that the following patches can be on the

Re: [PATCH 1/3] dt-bindings: Fix undocumented compatible strings in examples

2021-02-02 Thread Andrew Jeffery
> Cc: Linus Walleij > Cc: Herbert Xu > Cc: "David S. Miller" > Cc: Daniel Palmer > Cc: Bartosz Golaszewski > Cc: Avi Fishman > Cc: Tomer Maimon > Cc: Tali Perry > Cc: Joerg Roedel > Cc: Will Deacon > Cc: Andrew Jeffery > Cc: Joel Stanley &

Re: [PATCH] ARM: dts: aspeed: amd-ethanolx: Enable secondary LPC snooping address

2021-01-27 Thread Andrew Jeffery
ping address to capture the higher byte of POST > codes. > > Signed-off-by: Konstantin Aladyshev Reviewed-by: Andrew Jeffery

Re: [PATCH v5 1/5] dt-bindings: aspeed-lpc: Remove LPC partitioning

2021-01-26 Thread Andrew Jeffery
On Thu, 14 Jan 2021, at 23:46, Chia-Wei, Wang wrote: > The LPC controller has no concept of the BMC and the Host partitions. > This patch fixes the documentation by removing the description on LPC > partitions. The register offsets illustrated in the DTS node examples > are also fixed to adapt

Re: [PATCH v5 5/5] soc: aspeed: Adapt to new LPC device tree layout

2021-01-24 Thread Andrew Jeffery
soc/aspeed/aspeed-lpc-ctrl.c | 20 ++-- > drivers/soc/aspeed/aspeed-lpc-snoop.c | 23 +++ Using a Witherspoon (AST2500) I've tested the aspeed-lpc-ctrl driver: Tested-by: Andrew Jeffery

Re: [PATCH v5 2/5] ARM: dts: Remove LPC BMC and Host partitions

2021-01-24 Thread Andrew Jeffery
++-- > arch/arm/boot/dts/aspeed-g5.dtsi | 135 ++- > arch/arm/boot/dts/aspeed-g6.dtsi | 135 ++----- I've booted a Witherspoon BMC and host with these patches applied, so for aspeed-g5.dtsi: Tested-by: Andrew Jeffery

Re: [PATCH v5 4/5] pinctrl: aspeed-g5: Adapt to new LPC device tree layout

2021-01-24 Thread Andrew Jeffery
T2500): Tested-by: Andrew Jeffery

Re: [PATCH 1/1] clk: aspeed: modify some default clks are critical

2021-01-24 Thread Andrew Jeffery
as to which clock each platform considers crititical/in-need-of-protection. Andrew > > Regards, > Ryan > > -Original Message- > > From: Samuel Holland > > Sent: Thursday, October 29, 2020 10:25 AM > > To: Stephen Boyd ; Joel Stanley > > Cc: Andrew

[PATCH v2] mmc: sdhci-of-aspeed: Fix kunit-related build error

2021-01-22 Thread Andrew Jeffery
-code the kunit initialisation to avoid the error. Fixes: 7efa02a981d6 ("mmc: sdhci-of-aspeed: Add KUnit tests for phase calculations") Reported-by: Randy Dunlap Signed-off-by: Andrew Jeffery --- v2: * Collapse the #ifdef-ery drivers/mmc/host/sdhci-of-aspeed-test.c | 9 +- d

Re: [PATCH v3 4/4] hwmon: Support Aspeed AST2600 PWM/Fan tachometer

2021-01-21 Thread Andrew Jeffery
Hi Troy, On Mon, 18 Jan 2021, at 17:20, Troy Lee wrote: > Add Aspeed AST2600 PWM/Fan tacho driver. AST2600 has 16 PWM channel and > 16 FAN tacho channel. > > Changes since v2: > - declare local function as static function > > Changes since v1: > - fixed review comments > - fixed

Re: [PATCH v3 1/4] dt-bindings: hwmon: Add Aspeed AST2600 PWM/Fan

2021-01-21 Thread Andrew Jeffery
On Mon, 18 Jan 2021, at 17:20, Troy Lee wrote: > We add binding for supporting a new AST2600 PWM/Fan hwmon driver. > > Changes since v2: > - Fixed yamllint warnings/errors > > Changes since v1: > - dt binding with DT schema format > > Signed-off-by: Troy Lee > Reported-by: Rob Herring >

[PATCH] mmc: sdhci-of-aspeed: Fix kunit-related build error

2021-01-21 Thread Andrew Jeffery
-code the kunit initialisation to avoid the error. Fixes: 7efa02a981d6 ("mmc: sdhci-of-aspeed: Add KUnit tests for phase calculations") Reported-by: Randy Dunlap Signed-off-by: Andrew Jeffery --- drivers/mmc/host/sdhci-of-aspeed-test.c | 9 - drivers/mmc/host/sdhci-o

Re: linux-next: Tree for Jan 21 (mmc/host/sdhci-of-aspeed-test.c)

2021-01-21 Thread Andrew Jeffery
On Fri, 22 Jan 2021, at 06:37, Randy Dunlap wrote: > On 1/20/21 11:28 PM, Stephen Rothwell wrote: > > Hi all, > > > > Changes since 20210120: > > > > > Hi, > I suppose that I have some config combo that has not been tested. > > > on i386: > CONFIG_MMC_SDHCI_OF_ASPEED=m >

Re: [PATCH v7 0/6] mmc: sdhci-of-aspeed: Expose phase delay tuning

2021-01-20 Thread Andrew Jeffery
On Thu, 21 Jan 2021, at 00:26, Ulf Hansson wrote: > On Thu, 14 Jan 2021 at 04:14, Andrew Jeffery wrote: > > > > Hello, > > > > This series implements support for the MMC core clk-phase-* devicetree > > bindings > > in the Aspeed SD/eMMC dr

Re: [PATCH v3 4/4] hwmon: Support Aspeed AST2600 PWM/Fan tachometer

2021-01-19 Thread Andrew Jeffery
On Wed, 20 Jan 2021, at 15:53, Ryan Chen wrote: > > -Original Message- > > From: Andrew Jeffery > > Sent: Wednesday, January 20, 2021 1:16 PM > > To: Troy Lee ; open...@lists.ozlabs.org; Joel > > Stanley ; Philipp Zabel ; open list > > ; moderated

Re: [PATCH v3 4/4] hwmon: Support Aspeed AST2600 PWM/Fan tachometer

2021-01-19 Thread Andrew Jeffery
Hi Troy, On Mon, 18 Jan 2021, at 17:20, Troy Lee wrote: > Add Aspeed AST2600 PWM/Fan tacho driver. AST2600 has 16 PWM channel and > 16 FAN tacho channel. > > Changes since v2: > - declare local function as static function > > Changes since v1: > - fixed review comments > - fixed

[PATCH v5 5/5] soc: aspeed: Adapt to new LPC device tree layout

2021-01-19 Thread Andrew Jeffery
> drivers/soc/aspeed/aspeed-lpc-snoop.c | 23 +++ In the future please do separate patches for separate drivers, but for now: Reviewed-by: Andrew Jeffery

Re: [PATCH v5 4/5] pinctrl: aspeed-g5: Adapt to new LPC device tree layout

2021-01-19 Thread Andrew Jeffery
On Thu, 14 Jan 2021, at 23:46, Chia-Wei, Wang wrote: > Add check against LPC device v2 compatible string to > ensure that the fixed device tree layout is adopted. > The LPC register offsets are also fixed accordingly. > > Signed-off-by: Chia-Wei, Wang Reviewed-by: Andrew Jeffery

Re: [PATCH v5 3/5] ipmi: kcs: aspeed: Adapt to new LPC DTS layout

2021-01-19 Thread Andrew Jeffery
ue Wang Reviewed-by: Andrew Jeffery

Re: [PATCH v5 2/5] ARM: dts: Remove LPC BMC and Host partitions

2021-01-19 Thread Andrew Jeffery
ible strings are adopted > for the LPC device as listed: > > "aspeed,ast2400-lpc-v2" > "aspeed,ast2500-lpc-v2" > "aspeed,ast2600-lpc-v2" > > Signed-off-by: Chia-Wei, Wang Reviewed-by: Andrew Jeffery

Re: [PATCH v5 1/5] dt-bindings: aspeed-lpc: Remove LPC partitioning

2021-01-19 Thread Andrew Jeffery
xed to adapt to the LPC DTS change. > > Signed-off-by: Chia-Wei, Wang Reviewed-by: Andrew Jeffery

[PATCH v7 6/6] ARM: dts: rainier: Add eMMC clock phase compensation

2021-01-13 Thread Andrew Jeffery
Determined by scope measurements at speed. Signed-off-by: Andrew Jeffery --- arch/arm/boot/dts/aspeed-bmc-ibm-rainier.dts | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm/boot/dts/aspeed-bmc-ibm-rainier.dts b/arch/arm/boot/dts/aspeed-bmc-ibm-rainier.dts index 21ae880c7530

[PATCH v7 5/6] MAINTAINERS: Add entry for the ASPEED SD/MMC driver

2021-01-13 Thread Andrew Jeffery
Add myself as the maintainer. Signed-off-by: Andrew Jeffery --- MAINTAINERS | 9 + 1 file changed, 9 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index e451dcce054f..eae4322aae67 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -2826,6 +2826,15 @@ F: Documentation

[PATCH v7 0/6] mmc: sdhci-of-aspeed: Expose phase delay tuning

2021-01-13 Thread Andrew Jeffery
testing in response to Adrian's feedback. I've just done a quick build test of v7 given the small change and more extensive testing done with v5. v6 can be found here: https://lore.kernel.org/linux-mmc/20201218035338.1130849-1-and...@aj.id.au/ Please review! Cheers, Andrew Andrew Jeffery (6

[PATCH v7 2/6] mmc: sdhci-of-aspeed: Expose clock phase controls

2021-01-13 Thread Andrew Jeffery
-by: Andrew Jeffery --- drivers/mmc/host/sdhci-of-aspeed.c | 216 +++-- 1 file changed, 208 insertions(+), 8 deletions(-) diff --git a/drivers/mmc/host/sdhci-of-aspeed.c b/drivers/mmc/host/sdhci-of-aspeed.c index 4f008ba3280e..b1a14e7dda82 100644 --- a/drivers/mmc/host/sdhci

[PATCH v7 4/6] mmc: sdhci-of-aspeed: Add KUnit tests for phase calculations

2021-01-13 Thread Andrew Jeffery
Converting degrees of phase to logic delays is irritating to test on hardware, so lets exercise the function using KUnit. Signed-off-by: Andrew Jeffery --- drivers/mmc/host/Kconfig| 14 drivers/mmc/host/sdhci-of-aspeed-test.c | 98 + drivers/mmc/host

[PATCH v7 3/6] mmc: sdhci-of-aspeed: Add AST2600 bus clock support

2021-01-13 Thread Andrew Jeffery
The AST2600 can achieve HS200 speeds with a change to the bus clock divisor behaviour. The divisor can also be more accurate with respect to the requested clock rate, but keep the one-hot behaviour for backwards compatibility with the AST2400 and AST2500. Signed-off-by: Andrew Jeffery

[PATCH v7 1/6] mmc: core: Add helper for parsing clock phase properties

2021-01-13 Thread Andrew Jeffery
the extracted values to hardware as required. Signed-off-by: Andrew Jeffery --- drivers/mmc/core/host.c | 44 include/linux/mmc/host.h | 13 2 files changed, 57 insertions(+) diff --git a/drivers/mmc/core/host.c b/drivers/mmc/core/host.c index

Re: [PATCH, v1 1/1] gpio: aspeed: Add gpio base address reading

2021-01-13 Thread Andrew Jeffery
Hello, On Thu, 14 Jan 2021, at 09:08, Hongwei Zhang wrote: > Add gpio base address reading in the driver; in old code, it just > returns -1 to gpio->chip.base. Why do you want to do this? It feels hacky. The base address only affects the legacy sysfs number-space, and even then if you're using

Re: [PATCH v6 4/6] mmc: sdhci-of-aspeed: Add KUnit tests for phase calculations

2021-01-10 Thread Andrew Jeffery
On Wed, 6 Jan 2021, at 00:17, Adrian Hunter wrote: > On 18/12/20 5:53 am, Andrew Jeffery wrote: > > Converting degrees of phase to logic delays is irritating to test on > > hardware, so lets exercise the function using KUnit. > > > > Signed-off-by: Andrew Jeffery &g

  1   2   3   4   5   6   7   8   9   10   >