[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <16008638.kvcHKcsGDv@192.168.1.3>
Date: Fri, 13 Mar 2020 15:50:10 +0000
From: <Tudor.Ambarus@...rochip.com>
To: <linux-mtd@...ts.infradead.org>
CC: <boris.brezillon@...labora.com>, <kstewart@...uxfoundation.org>,
<alexandre.belloni@...tlin.com>, <vigneshr@...com>,
<linux-aspeed@...ts.ozlabs.org>, <thor.thayer@...ux.intel.com>,
<jethro@...tanix.com>, <rfontana@...hat.com>,
<miquel.raynal@...tlin.com>, <opensource@...ayne.com>,
<richard@....at>, <allison@...utok.net>, <michal.simek@...inx.com>,
<Ludovic.Desroches@...rochip.com>, <joel@....id.au>,
<nishkadg.linux@...il.com>, <john.garry@...wei.com>,
<vz@...ia.com>, <alexander.sverdlin@...ia.com>,
<matthias.bgg@...il.com>, <tglx@...utronix.de>,
<swboyd@...omium.org>, <mika.westerberg@...ux.intel.com>,
<ludovic.barre@...com>, <linux-arm-kernel@...ts.infradead.org>,
<bbrezillon@...nel.org>, <andrew@...id.au>,
<Nicolas.Ferre@...rochip.com>, <linux-kernel@...r.kernel.org>,
<dinguyen@...nel.org>, <michael@...le.cc>,
<linux-mediatek@...ts.infradead.org>, <info@...ux.net>
Subject: Re: [PATCH 01/23] mtd: spi-nor: Stop prefixing generic functions with
a manufacturer name
On Friday, March 13, 2020 4:30:48 PM EET Tudor.Ambarus@...rochip.com wrote:
> > > > - * macronix_set_4byte() - Set 4-byte address mode for Macronix
> > > > flashes.
> > > > + * spi_nor_en4_ex4_set_4byte() - Enter/Exit 4-byte mode for Macronix
> > > > like
> > > > + * flashes.
> > > >
> > > > * @nor: pointer to 'struct spi_nor'.
> > > > * @enable: true to enter the 4-byte address mode, false to exit
> > > > the 4-byte * address mode.
> > > > *
> > > > * Return: 0 on success, -errno otherwise.
> > > > */
> > > >
> > > > -static int macronix_set_4byte(struct spi_nor *nor, bool enable)
> > > > +static int spi_nor_en4_ex4_set_4byte(struct spi_nor *nor, bool
> > > > enable)
> > >
> > > Sounds a bit weird, how about simplifying this to:
> > > spi_nor_set_4byte_addr_mode()
> > >
> > > Or if you want to be specific:
> > > spi_nor_en_ex_4byte_addr_mode()
> >
> > You're right. Maybe we can simplify things by having a single function
> > that does optional steps based on new flags
> >
> > SPI_NOR_EN_EX_4B_NEEDS_WEN
> > SPI_NOR_CLEAR_EAR_ON_4B_EXIT
> >
> > This should probably be done in a separate patch though, so ack on the
> > spi_nor_en_ex_4byte_addr_mode() rename, assuming we also change the
> > bool argument name to enter.
>
> A single big function will be ugly to handle because of the
> spansion_set_4byte() -> it uses a different opcode.
>
> I like the nor->params>set_4byte hook.
>
> I think that spi_nor_en4_ex4_set_4byte() can be renamed to
> spi_nor_set_4byte() and be the only set_4byte() method exposed to
> manufacturers.
> spansion_set_4byte() will be static in core.c and the rest will be private
> in the manufacturer drivers.
>
> Here's how the manufacturers enter and exit the 4 byte mode:
> -> eon, gidadevice, issi, macronix, xmc use EN4B/EX4B
> -> micron-st needs WEN -> private method as they are the only ones that
> require this
> -> newer spansion have a 4BAM opcode (new, public command), older spansion
> flashes use BRWR (legacy in core.c, spansion_set_4byte())
> -> winbond set_4byte method is hackish and may be reason for just a flash
> fixup hook -> private method
I'll drop the set_4byte changes from this patch. I'm adding a dedicated patch
immediately after this, to implement what I said above.
Cheers,
ta
Powered by blists - more mailing lists