public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Russell King <rmk@arm.linux.org.uk>
To: george anzinger <george@mvista.com>
Cc: Nicolas Pitre <nico@cam.org>, Mark Mielke <mark@mark.mielke.cc>,
	"David S. Miller" <davem@redhat.com>,
	simon@baydel.com, alan@lxorguk.ukuu.org.uk,
	lkml <linux-kernel@vger.kernel.org>
Subject: Re: The end of embedded Linux?
Date: Mon, 7 Oct 2002 20:11:11 +0100	[thread overview]
Message-ID: <20021007201111.C5381@flint.arm.linux.org.uk> (raw)
In-Reply-To: <3DA1D87E.81A1351C@mvista.com>; from george@mvista.com on Mon, Oct 07, 2002 at 11:54:54AM -0700

On Mon, Oct 07, 2002 at 11:54:54AM -0700, george anzinger wrote:
> Nicolas Pitre wrote:
> > #ifdef CONFIG_ASSABET_NEPONSET
> > 
> > /*
> >  * These functions allow us to handle IO addressing as we wish - this
> >  * ethernet controller can be connected to a variety of busses.  Some
> >  * busses do not support 16 bit or 32 bit transfers.  --rmk
> >  */
> > static inline u8 smc_inb(u_int base, u_int reg)
> > {
> >         u_int port = base + reg * 4;
> > 
> >         return readb(port);
> > }
> > 
> > static inline u16 smc_inw(u_int base, u_int reg)
> > {
> >         u_int port = base + reg * 4;
> > 
> >         return readb(port) | readb(port + 4) << 8;
> > }
> > 
> > static inline void smc_outb(u8 val, u_int base, u_int reg)
> > {
> >         u_int port = base + reg * 4;
> > 
> >         writeb(val, port);
> > }
> > 
> > static inline void smc_outw(u16 val, u_int base, u_int reg)
> > {
> >         u_int port = base + reg * 4;
> > 
> >         writeb(val, port);
> >         writeb(val >> 8, port + 4);
> > }
> > 
> > #endif
> > 
> > As you can see such code duplicated multiple times for all bus arrangements
> > in existence out there is just not pretty and was refused by Alan.  We lack
> > a global lightweight IO abstraction to nicely override the default IO macros
> > for individual drivers at compile time to fix that problem optimally and
> > keep the driver proper clean.
> 
> Uh, what about stuff like this (from tulip.h):
>  
> #ifndef USE_IO_OPS
> #undef inb
> #undef inw
> #undef inl
> #undef outb
> #undef outw
> #undef outl
> #define inb(addr) readb((void*)(addr))
> #define inw(addr) readw((void*)(addr))
> #define inl(addr) readl((void*)(addr))
> #define outb(val,addr) writeb((val), (void*)(addr))
> #define outw(val,addr) writew((val), (void*)(addr))
> #define outl(val,addr) writel((val), (void*)(addr))
> #endif /* !USE_IO_OPS */

No, you don't quite get it.  The above code Nico pasted supports _one_
ARM machine type only (the one I have here, hence why its in my tree)
where the SMC chip is configured to be in 8-bit mode.

We also have the same device connected in 16-bit mode on other machines,
with different ways to set it up:

http://www.arm.linux.org.uk/developer/patches/viewpatch.php?id=734/1

Now imagine the case when you have 100 different machine types, all
different, using this device where each hardware designer has decided to
connect the chip up differently.

Is putting this crud into drivers going to be maintainable?  No.

-- 
Russell King (rmk@arm.linux.org.uk)                The developer of ARM Linux
             http://www.arm.linux.org.uk/personal/aboutme.html


  reply	other threads:[~2002-10-07 19:05 UTC|newest]

Thread overview: 115+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-10-05 19:36 The end of embedded Linux? Gigi Duru
2002-10-05 19:46 ` Francois Romieu
2002-10-05 19:49 ` Ben Greear
2002-10-05 19:53 ` Andre Hedrick
2002-10-05 20:52   ` Gigi Duru
2002-10-05 20:58     ` Mark Mielke
2002-10-06  1:54       ` Andre Hedrick
2002-10-07 23:28       ` Gigi Duru
2002-10-06  0:46     ` Rik van Riel
2002-10-06  1:52     ` Andre Hedrick
2002-10-06 20:20       ` Gigi Duru
2002-10-07  2:01         ` Andre Hedrick
2002-10-06  4:28     ` David S. Miller
2002-10-06 16:53       ` Alan Cox
2002-10-06 18:50         ` george anzinger
2002-10-07 10:06         ` simon
2002-10-07 10:36           ` David S. Miller
2002-10-07 11:57             ` Russell King
2002-10-07 12:10               ` Abraham vd Merwe
2002-10-07 14:12                 ` Alan Cox
2002-10-07 16:05               ` Nicolas Pitre
2002-10-07 16:02                 ` David S. Miller
2002-10-07 16:20                   ` Benjamin LaHaise
2002-10-07 16:38                   ` Nicolas Pitre
2002-10-07 16:53                   ` Mark Mielke
2002-10-07 17:45                     ` Nicolas Pitre
2002-10-07 18:11                       ` Richard B. Johnson
2002-10-07 18:54                       ` george anzinger
2002-10-07 19:11                         ` Russell King [this message]
2002-10-07 20:05                           ` Ben Greear
2002-10-12 10:08                       ` Richard Zidlicky
2002-10-14 12:26                       ` Richard Zidlicky
2002-10-07 17:15             ` simon
2002-10-07 17:24               ` David S. Miller
2002-10-07 20:22               ` Alan Cox
2002-10-07 22:22                 ` Christer Weinigel
2002-10-07 22:52                   ` Alan Cox
2002-10-07 22:56                     ` Arnaldo Carvalho de Melo
2002-10-09 11:19                     ` Jamie Lokier
2002-10-08 10:11                 ` simon
2002-10-08 11:11                   ` jbradford
2002-10-08 11:53                     ` Richard B. Johnson
2002-10-08 12:09                       ` jbradford
2002-10-08 11:25                   ` Vojtech Pavlik
2002-10-08 11:25                   ` Alan Cox
2002-10-08 20:04                     ` David S. Miller
2002-10-08 22:53                       ` Alan Cox
2002-10-08 22:38                         ` David S. Miller
2002-10-08 11:27                   ` jw schultz
2002-10-09  7:37                     ` Alexander Kellett
2002-10-09 11:49                       ` Alan Cox
2002-10-09 11:53                         ` Richard B. Johnson
2002-10-09 19:17                           ` jbradford
2002-10-09 23:49                             ` jw schultz
2002-10-13 16:30                         ` Eric W. Biederman
2002-10-09 12:42                       ` Ian Molton
2002-10-10  4:47                       ` Shane Nay
2002-10-08 15:52                   ` David Lang
2002-10-09 10:53                     ` David Woodhouse
2002-10-07 10:55           ` Xavier Bestel
2002-10-07 17:20             ` simon
2002-10-07 22:59               ` Arnaldo Carvalho de Melo
2002-10-07 23:18                 ` Alan Cox
2002-10-07 16:15         ` Matt Porter
2002-10-07 16:22       ` Matt Porter
2002-10-07 16:41         ` Rob Landley
2002-10-07 21:56           ` Gigi Duru
2002-10-07 19:44             ` Rob Landley
2002-10-08 13:22               ` Thomas Molina
2002-10-08 16:34                 ` Rob Landley
2002-10-07 23:20           ` Matt Porter
2002-10-07 19:50             ` Rob Landley
2002-10-08 15:04               ` Matt Porter
2002-10-08 16:52                 ` Rob Landley
2002-10-09 11:38                   ` Adrian Bunk
2002-10-09 12:15                     ` [patch] show Fusion MPT dialog only when CONFIG_BLK_DEV_SD is set Adrian Bunk
2002-10-09 19:55                       ` Rob Landley
2002-10-09 19:54                     ` [PATCH]: Move Fusion MPT config menu into scsi driver support (was Re: The end of embedded Linux?) Rob Landley
2002-10-07 23:01         ` The end of embedded Linux? Arnaldo Carvalho de Melo
2002-10-07 23:23           ` Alan Cox
2002-10-07 23:47             ` Arnaldo Carvalho de Melo
2002-10-08  0:06               ` Arnaldo Carvalho de Melo
2002-10-08  1:23             ` Xcytame@yahoo.es
2002-10-06 13:02     ` Ian Molton
2002-10-05 19:53 ` jbradford
2002-10-05 22:23 ` Oliver Xymoron
2002-10-05 23:28   ` Arnaldo Carvalho de Melo
2002-10-06  1:57     ` Andre Hedrick
2002-10-12  4:01   ` Daniel Phillips
2002-10-12  4:09     ` William Lee Irwin III
2002-10-06  0:36 ` Rik van Riel
2002-10-06  0:41 ` Zwane Mwaikambo
2002-10-06  0:50   ` William Lee Irwin III
2002-10-06  1:00     ` Zwane Mwaikambo
2002-10-06  0:44 ` William Lee Irwin III
2002-10-06 22:24   ` Aaron Lehmann
2002-10-06 22:54     ` William Lee Irwin III
2002-10-07  1:33     ` Andre Hedrick
2002-10-07 22:25     ` Andre Hedrick
2002-10-07  9:10 ` Jan-Benedict Glaw
     [not found] <Pine.LNX.4.33.0210061854190.24860-100000@coffee.psychology.mcmaster.ca>
2002-10-07  5:38 ` Gigi Duru
2002-10-07  5:42   ` Rik van Riel
2002-10-07  6:06     ` Arnaldo Carvalho de Melo
2002-10-07 12:04   ` Richard B. Johnson
2002-10-07 12:00     ` David S. Miller
2002-10-07 12:32       ` Richard B. Johnson
2002-10-07 12:29         ` David S. Miller
2002-10-07 13:06   ` Dana Lacoste
  -- strict thread matches above, loose matches on Subject: below --
2002-10-07 20:04 Hell.Surfers
2002-10-07 23:01 ` David S. Miller
2002-10-08  0:10   ` jw schultz
2002-10-08  9:36 Hell.Surfers
2002-10-08  9:51 Hell.Surfers
2002-10-08 20:00 ` David S. Miller
2002-10-08 12:05 Hicks, Jamey
2002-10-12 20:45 Hell.Surfers

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20021007201111.C5381@flint.arm.linux.org.uk \
    --to=rmk@arm.linux.org.uk \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=davem@redhat.com \
    --cc=george@mvista.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark@mark.mielke.cc \
    --cc=nico@cam.org \
    --cc=simon@baydel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox