RE: [PATCH 5/7] soc: aspeed: Add eSPI flash channel support

YH Chung <[email protected]> Mon, 29 Jun 2026 08:10:12 +0000
Newsgroups org.ozlabs.lists.openbmc,org.infradead.lists.linux-arm-kernel,org.kernel.vger.linux-devicetree,org.kernel.vger.linux-kernel,org.ozlabs.lists.linux-aspeed
Message-ID <KL1PR0601MB42767D6B20A0990D7F46DB9890E82@KL1PR0601MB4276.apcprd06.prod.outlook.com>
Hi Markus,


> > +++ b/drivers/soc/aspeed/espi/aspeed-espi-comm.h
> > @@ -0,0 +1,62 @@
> …
> > +/*
> > + * eSPI cycle type encoding
> > + *
> > + * Section 5.1 Cycle Types and Packet Format,
> > + * Intel eSPI Interface Base Specification, Rev 1.0, Jan. 2016.
> > + */
> > +#define ESPI_FLASH_READ			0x00
> > +#define ESPI_FLASH_WRITE		0x01
> > +#define ESPI_FLASH_ERASE		0x02
> …
> 
> How do you think about to use an enumeration for such data?
> https://en.wikipedia.org/wiki/Enumerated_type#C_and_syntactically_similar_lan
> guages

Thanks for the feedback. Yes, these values are related cycle type encodings,
so using an enum makes sense. I will update them, as well as other
specification-defined encodings, to enums in the next revision, while still
using fixed-width types such as `u8` for the actual packet/register fields.

Thanks,
Yun-Hsuan