* IBM 4xx drivers restructuring
@ 2001-12-06 22:54 Armin Kuster
2001-12-07 10:52 ` Kenneth Johansson
0 siblings, 1 reply; 4+ messages in thread
From: Armin Kuster @ 2001-12-06 22:54 UTC (permalink / raw)
To: ppcdevel
I have hit the issue of trying to reuse some of the drivers from the
405GP to NP405 and have the following proposal for making it a bit
easier for other 4xx cores. Also my goal is to get the drivers smart
enough so they can init any number of the same devices in the init
code. I am going to use the term "internal peripheral support (ips)"
when referring to the support of these devices use in the 405GP, NP405H,
NP405L, stb3xxx and stb4xxx.
1) Menuconfig change
I would like to use a single CONFIG_<mfg>_IPS to enable a given driver
instead of "if 405gp -o np405 " so that the config.in is a bit cleaner.
This config variable will be a bool defined in the /platform/config.in
in the board sections.
2) Centralize the ips register mapping.
I would like to move the #defines and ethernet register struct and
created some new ones to a asm-ppc/ibm_ips.h to eliminates replication
of the same info. This file is included in the asm-platform/board.h file
before the cpu header(ibm405gp.h, ibmnp405.h, etc.)
3) Centralize the defined base address and number for each of the ips
into the processor headers.
I would like to move the defines out of the drivers and into a single
place.
4) Created new cpu.c
I would like to create cpu.c files to do some register inits and keeps
this form being replicated in each board.c file.
example:
ibm_ips.h
typedef struct emac_regs {....}emac_t;
ibmnp405.h
#define EMAC_BASE_1 0xef008000
#define EMAC_NUMS 1
ibm405.c
const emac_t* EMAC_ADDR[]=
{
(emac_t*) EMAC_BASE_1,
};
5) Change drivers to loop though and initialize for any number of
devices.
In ther current state, many of the 405/4xx drivers can not be easily
reused. Whith the above changes and driver restructuring, porting a new
405 processor model shoul dony require two file changes. its cpu.h and
cpu.c
I have changed the ethernet driver all ready and does init two emacs on
the cedar.
feedback
-- armin
** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: IBM 4xx drivers restructuring
2001-12-06 22:54 IBM 4xx drivers restructuring Armin Kuster
@ 2001-12-07 10:52 ` Kenneth Johansson
2001-12-11 17:33 ` Armin Kuster
0 siblings, 1 reply; 4+ messages in thread
From: Kenneth Johansson @ 2001-12-07 10:52 UTC (permalink / raw)
To: Armin Kuster; +Cc: ppcdevel
Armin Kuster wrote:
>
> I have hit the issue of trying to reuse some of the drivers from the
> 405GP to NP405 and have the following proposal for making it a bit
> easier for other 4xx cores. Also my goal is to get the drivers smart
> enough so they can init any number of the same devices in the init
> code. I am going to use the term "internal peripheral support (ips)"
> when referring to the support of these devices use in the 405GP, NP405H,
> NP405L, stb3xxx and stb4xxx.
Any reason to not call it On-Chip Peripherals (OCP)? That would sound more
like the IBM docs
> 2) Centralize the ips register mapping.
> I would like to move the #defines and ethernet register struct and
> created some new ones to a asm-ppc/ibm_ips.h to eliminates replication
> of the same info. This file is included in the asm-platform/board.h file
> before the cpu header(ibm405gp.h, ibmnp405.h, etc.)
Would not the cpu core file (ibm405(CR|GP))file automatically include the
right peripherals? Why would I like to override that from the board
configuration?? After all it's not like it's possible to actually change
anything anyway.
>
> 4) Created new cpu.c
> I would like to create cpu.c files to do some register inits and keeps
> this form being replicated in each board.c file.
> example:
> ibm_ips.h
>
> typedef struct emac_regs {....}emac_t;
>
> ibmnp405.h
>
> #define EMAC_BASE_1 0xef008000
> #define EMAC_NUMS 1
>
> ibm405.c
>
> const emac_t* EMAC_ADDR[]=
> {
> (emac_t*) EMAC_BASE_1,
> };
hmm I don't know if this is a good idea. What I think you mean here is that
ibm405 only contain things that is common to all 405 chips and np405 only
changes or adds stuff that is specifict to this chip. But then there is 405CR
that don't even have ethernet, this sugests that we really don't know much
about how the peripherals is related in different chips.
The ibm405 file should probably only contain stuff that is related to the 405
CORE and the chip specfic file(ibmnp405) should include/define all the
peripherals directly.
--
Kenneth Johansson
Ericsson Business Innovation AB Tel: +46 8 404 71 83
Viderögatan 3 Fax: +46 8 404 72 72
164 80 Stockholm kenneth.johansson@inn.ericsson.se
** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: IBM 4xx drivers restructuring
2001-12-07 10:52 ` Kenneth Johansson
@ 2001-12-11 17:33 ` Armin Kuster
0 siblings, 0 replies; 4+ messages in thread
From: Armin Kuster @ 2001-12-11 17:33 UTC (permalink / raw)
To: Kenneth Johansson; +Cc: Armin Kuster, ppcdevel
Kenneth Johansson wrote:
>
> Armin Kuster wrote:
> >
> > I have hit the issue of trying to reuse some of the drivers from the
> > 405GP to NP405 and have the following proposal for making it a bit
> > easier for other 4xx cores. Also my goal is to get the drivers smart
> > enough so they can init any number of the same devices in the init
> > code. I am going to use the term "internal peripheral support (ips)"
> > when referring to the support of these devices use in the 405GP, NP405H,
> > NP405L, stb3xxx and stb4xxx.
>
> Any reason to not call it On-Chip Peripherals (OCP)? That would sound more
> like the IBM docs
Sounds better...OCP is more descriptive
>
> > 2) Centralize the ips register mapping.
> > I would like to move the #defines and ethernet register struct and
> > created some new ones to a asm-ppc/ibm_ips.h to eliminates replication
> > of the same info. This file is included in the asm-platform/board.h file
> > before the cpu header(ibm405gp.h, ibmnp405.h, etc.)
>
> Would not the cpu core file (ibm405(CR|GP))file automatically include the
> right peripherals? Why would I like to override that from the board
> configuration?? After all it's not like it's possible to actually change
> anything anyway.
>
I does not over ride anything in the board configuration. The header
only centilized the OCP structs & #defines into one file. If I do it in
the core files then I am replicating info.
> >
> > 4) Created new cpu.c
> > I would like to create cpu.c files to do some register inits and keeps
> > this form being replicated in each board.c file.
> > example:
> > ibm_ips.h
> >
> > typedef struct emac_regs {....}emac_t;
> >
> > ibmnp405.h
> >
> > #define EMAC_BASE_1 0xef008000
> > #define EMAC_NUMS 1
> >
> > ibm405.c
> >
> > const emac_t* EMAC_ADDR[]=
> > {
> > (emac_t*) EMAC_BASE_1,
> > };
>
> hmm I don't know if this is a good idea. What I think you mean here is that
> ibm405 only contain things that is common to all 405 chips and np405 only
> changes or adds stuff that is specifict to this chip. But then there is 405CR
> that don't even have ethernet, this sugests that we really don't know much
> about how the peripherals is related in different chips.
>
> The ibm405 file should probably only contain stuff that is related to the 405
> CORE and the chip specfic file(ibmnp405) should include/define all the
> peripherals directly.
>
The OCP are pci, uart, gpio, opb, i2c, ide ,emac & zmii and are what
help define the GP or L or H. I am not addressing things that
differentiate between cores. 403 , 405 etc.
-- armin
** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: IBM 4xx drivers restructuring
@ 2001-12-11 17:09 Mark Wisner
0 siblings, 0 replies; 4+ messages in thread
From: Mark Wisner @ 2001-12-11 17:09 UTC (permalink / raw)
To: Armin Kuster, linuxppc-dev
You should add the MAL to the list of devices. It should not be included in
the EMAC driver. The MAL can be connected to different COMACs and there can
be multiple MALs.
Mark K. Wisner
Advisory Software Engineer
IBM Microelectronics
3039 Cornwallis Rd
RTP, NC 27709
Tel. 919-254-7191
Fax 919-543-7575
** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2001-12-11 17:33 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-12-06 22:54 IBM 4xx drivers restructuring Armin Kuster
2001-12-07 10:52 ` Kenneth Johansson
2001-12-11 17:33 ` Armin Kuster
-- strict thread matches above, loose matches on Subject: below --
2001-12-11 17:09 Mark Wisner
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).