From: Matthias Fuchs Date: Fri, 23 Oct 2009 17:10:56 +0200 Subject: [U-Boot] [PATCH V2] ppc4xx: Initialize magnetic couplers in PLU405 In-Reply-To: <20091023145329.15A2CE398E1@gemini.denx.de> References: <200910231638.11295.matthias.fuchs@esd.eu> <20091023145329.15A2CE398E1@gemini.denx.de> Message-ID: <200910231710.56712.matthias.fuchs@esd.eu> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Wolfgang, you are right, but I didn't want to trigger a discussion about CAN in U-Boot. This has nothing to do with CAN :-) Also I am using the controller in a slightly untypical manner. I also dont't want to add sja1000 Linux kernel headers (from SocketCAN) - a) they do not contains the wanted C struct and b) they don't use the basic CAN mode of the chip. So when you want me just to move the SJA1000 specific struct and the two defines into a header and place that under include, I will do so. But please nothing else. Matthias On Friday 23 October 2009 16:53, Wolfgang Denk wrote: > Dear Matthias Fuchs, > > In message <200910231638.11295.matthias.fuchs@esd.eu> you wrote: > > This patch fixes an ugly behavior of the IL712 magnetic couplers > > as used on PLU405. These parts will remember their last state > > over a power cycle which might cause unwanted behavior. > ... > > --- a/board/esd/plu405/plu405.c > > +++ b/board/esd/plu405/plu405.c > > @@ -45,6 +45,55 @@ const unsigned char fpgadata[] = > > */ > > #include "../common/fpga.c" > > > > +/* > > + * SJA1000 register layout in basic can mode > > + */ > > +struct sja1000_basic_s { > > + u8 cr; > > + u8 cmr; > > + u8 sr; > > + u8 ir; > > + u8 ac; > > + u8 am; > > + u8 btr0; > > + u8 btr1; > > + u8 oc; > > + u8 txb[10]; > > + u8 rxb[10]; > > + u8 unused; > > + u8 cdr; > > +}; > > + > > +#define SJA1000_CR_RR 0x01 > > +#define SJA1000_OC_MODE0 0x01 > > Hmm... a SJA1000 is a pretty generic piece of hardware, and in no way > specific to the plu405 board. Would it not make sense to create as > separate header file for this? Eventually other boards will need to > interface to SJA1000's, too ? > > Best regards, > > Wolfgang Denk >