On Mon, Feb 10, 2025 at 03:45:02PM +0100, Geert Uytterhoeven wrote: > Hi Thierry, > Hi Geert, > On Wed, 29 Jan 2025 at 18:03, Thierry Bultel > <thierry.bultel.yh@xxxxxxxxxxxxxx> wrote: > > The aim here is to prepare support for new sci controllers like > > the T2H/RSCI whose registers are too much different for being > > handled in common code. > > > > This named serial controller also has 32 bits register, > > so some return types had to be changed. > > > > The needed generic functions are no longer static, with prototypes > > defined in sh-sci-common.h so that they can be used from specific > > implementation in a separate file, to keep this driver as little > > changed as possible. > > > > For doing so, a set of 'ops' is added to struct sci_port. > > > > Signed-off-by: Thierry Bultel <thierry.bultel.yh@xxxxxxxxxxxxxx> > > Thanks for your patch! > > I can't say I am super-enthusiastic about this approach. > The SCI variant in RZ/T2 seems to differ a lot from the already > supported SCI, SCIF, SCIFA, SCIFB, and HSCIF variants. The latter > are very similar, but usually have just more features/registers, and > further differ in a few different register offsets and bit locations. > If you compare the RZ/T2 SCI block diagram with the SH7751 SCI block > diagram (or even the R-Car SCIF block diagram), the most striking > similarity is that both have a baud rate generator that can divide > Pclk by 1, 4, 16, or 64 ;-) > So perhaps you're better off adding a completely new driver? > The origin of this work is the non-mainline 'rz-sci.c' from renesas BSP, which is a actually separate driver, but that we considered 'similar enough' (a lot of duplicated lines) to be integrated in sh-sci with some work. The number of places where to add specific code for the new port type were however a concern in terms of non-regression tests and future evolutions. So the idea was basically to change it once in the most possible modular way, so that coming features and/or bug fixes keep specific to rzsci. I am looking forward to getting more minds about that approach, which seemed the less intrusive, keeping as much code in common as possible. > What do other people think? > Thanks! > > Gr{oetje,eeting}s, > > Geert > > -- > Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@xxxxxxxxxxxxxx > > In personal conversations with technical people, I call myself a hacker. But > when I'm talking to journalists I just say "programmer" or something like that. > -- Linus Torvalds