EV-64260-BP & GT64260 bi_recs
Quoted 6 lines
It would set a very bad example if it is implemented. In your proposal the records containing the GT-64260 Ethernet information have no indication in them
whatsoever that they are for GT-64260 and not some other Ethernet. If
you make
Quoted 2 lines
the
gt64260_ethdriver call a function to grab allbi_recsof this kind, the next engineer who designs a board with other hard-wired Ethernet
interfaces on
Quoted 4 lines
it besides the GT-64260 (like an MPC8260 + GT-64260 system) will be simply stuck out of luck as the
gt64260_ethdriver will unceremoniously grab all records for all Ethernets and there will be no way to tell which MAC address belongs to each Ethernet.
Yah, this is why BI_DEV_TYPE should be GT64260_xxxx
We have several choices here for the design, I'm not sure which is best, so please speak up:
When dealing with combo-chips like the GT or PPC 4xx/8xx etc..., we can either:
- define one BI_DEV_TYPE per chip (BI_DEV_TYPE_GT64260, ...). The actual
device within the GT64260 (ethernet in our case) is referenced via the BI_DEV_CLASS (ethernet), BI_DEV_ID beeing optionally there in case a given device in the chip exist in more than one instance.
- define one BI_DEV_TYPE per chip (same as above), and define a BI_DEV_ID
containing both function and the index (for example 'ETH0') thus we don't need BI_DEV_CLASS.
- define a specific BI_DEV_TYPE for each function (that isBI_DEV_TYPE_GT64260_ETH), BI_DEV_ID is only an index.
I tend to prefer solution 2)
Ben.
** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/
Quoted 2 lines · Mark A. Greer
First, we need to see if this is going to fit with everything else in 2_4/2_4_devel and then it will get implemented.
It would set a very bad example if it is implemented. In your proposal the records containing the GT-64260 Ethernet information have no indication in them whatsoever that they are for GT-64260 and not some other Ethernet. If you make the gt64260_eth driver call a function to grab all bi_recs of this kind, the next engineer who designs a board with other hard-wired Ethernet interfaces on it besides the GT-64260 (like an MPC8260 + GT-64260 system) will be simply stuck out of luck as the gt64260_eth driver will unceremoniously grab all records for all Ethernets and there will be no way to tell which MAC address belongs to each Ethernet.
Bad bad bad.
MS
** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/
Quoted 28 lines · On Tue, Mar 26, 2002 at 10:52:35PM +0100, [email protected] wrote:
Quoted 6 lines
It would set a very bad example if it is implemented. In your proposal the records containing the GT-64260 Ethernet information have no indication in them
whatsoever that they are for GT-64260 and not some other Ethernet. Ifyou make
Quoted 2 lines
the
gt64260_ethdriver call a function to grab allbi_recsof this kind, the next engineer who designs a board with other hard-wired Ethernetinterfaces on
Quoted 4 lines
it besides the GT-64260 (like an MPC8260 + GT-64260 system) will be simply stuck out of luck as the
gt64260_ethdriver will unceremoniously grab all records for all Ethernets and there will be no way to tell which MAC address belongs to each Ethernet.Yah, this is why
BI_DEV_TYPEshould beGT64260_xxxxWe have several choices here for the design, I'm not sure which is best, so please speak up:
When dealing with combo-chips like the GT or PPC 4xx/8xx etc..., we can either:
- define one
BI_DEV_TYPEper chip (BI_DEV_TYPE_GT64260, ...). The actual
device within the GT64260 (ethernet in our case) is referenced via theBI_DEV_CLASS(ethernet),BI_DEV_IDbeeing optionally there in case a given device in the chip exist in more than one instance.
Quoted 8 lines
- define one
BI_DEV_TYPEper chip (same as above), and define aBI_DEV_ID
containing both function and the index (for example 'ETH0') thus we don't needBI_DEV_CLASS.- define a specific
BI_DEV_TYPEfor each function (that isBI_DEV_TYPE_GT64260_ETH),BI_DEV_IDis only an index.I tend to prefer solution 2)
Since device macro cells are commonly used across different chips, it might be wise to orient the records around the device macro rather than the SoC it is implemented in. For example, there are tens of 405 variants plus a similar future of 440 variants that all share the EMAC macro device and corresponding driver. A single BI_DEV_TYPE_IBM_EMAC would be most appropriate. Mot has a similar scheme with the many 825x/826x variants sharing the same ethernet macro. Marvell probably will use the same eth macro in any forthcoming chips since they already share the same eth macro between their MIPS and PPC offerings.
Regards,
--
Matt Porter
MontaVista Software, Inc.
[email protected]
** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/
Quoted 12 lines · Matt Porter
Quoted 10 lines · On Tue, Mar 26, 2002 at 10:52:35PM +0100, [email protected] wrote:
Quoted 6 lines
It would set a very bad example if it is implemented. In your proposal the records containing the GT-64260 Ethernet information have no indication in them
whatsoever that they are for GT-64260 and not some other Ethernet. Ifyou make
Quoted 2 lines
the
gt64260_ethdriver call a function to grab allbi_recsof this kind, the next engineer who designs a board with other hard-wired Ethernetinterfaces on
<snip>
Quoted 21 lines
Quoted 21 lines
Yah, this is why
BI_DEV_TYPEshould beGT64260_xxxxWe have several choices here for the design, I'm not sure which is best, so please speak up:
When dealing with combo-chips like the GT or PPC 4xx/8xx etc..., we can either:
- define one
BI_DEV_TYPEper chip (BI_DEV_TYPE_GT64260, ...). The actual
device within the GT64260 (ethernet in our case) is referenced via theBI_DEV_CLASS(ethernet),BI_DEV_IDbeeing optionally there in case a given device in the chip exist in more than one instance.- define one
BI_DEV_TYPEper chip (same as above), and define aBI_DEV_ID
containing both function and the index (for example 'ETH0') thus we don't needBI_DEV_CLASS.- define a specific
BI_DEV_TYPEfor each function (that isBI_DEV_TYPE_GT64260_ETH),BI_DEV_IDis only an index.
Quoted 8 lines
Quoted 1 line
I tend to prefer solution 2)
Since device macro cells are commonly used across different chips, it might be wise to orient the records around the device macro rather than the SoC it is implemented in. For example, there are tens of 405 variants plus a similar future of 440 variants that all share the EMAC macro device and corresponding driver. A single
BI_DEV_TYPE_IBM_EMACwould be most appropriate. Mot
<snip>
All good points. Given Matt's comments, I think sol'n 3) may be the best. Comments?
Here's the next iteration using Ben's sol'n 3)
I also adde NULL termination to the overall bi_rec and to each nested one so the parsing code can stop when a NULL is hit whether its a nested one or not (therefore we can never have a valid tag with value 0). I also adjusted the size of the BI_STRUCTS to include the 4 byte NULL terminator. I also fixed an error on the length of the BI_MAC_ADDR (was 25, should be 28 to count padding).
Mark
--
Example for ev64260:
--------------------
[0] tag: BI_CMD_LINE
size: 36 (4 + 4 + 26 chars + 2 pad)
data: "console=ttyS0,115200 ip=on"
pad: 2[1] tag: BI_MEMSIZE
size: 12
data: 33554432 (32 MB)[2] tag: BI_GT64260_BASE
size: 12
data: fc000000[3] tag: BI_STRUCT (embedded enet cltr 0)
size: 68 (12 + 2*12 + 28 + 4 == 68)
data: BI_DEVICE
[3.0] tag: BI_DEV_TYPE
size: 12
data: BI_DEV_TYPE_GT_ETH
[3.2] tag: BI_DEV_ID
size: 12
data: 0 (1st enet device)
[3.3] tag: BI_MAC_ADDR
size: 28
data: aa:bb:cc:dd:ee:ff (ascii)
pad: 3
[3.4] 0x00000000 (NULL Termination of BI_STRUCT)[4] tag: BI_STRUCT (embedded enet cltr 1)
size: 68 (12 + 2*12 + 28 + 4 == 68)
data: BI_DEVICE
[4.0] tag: BI_DEV_TYPE
size: 12
data: BI_DEV_TYPE_GT_ETH
[4.2] tag: BI_DEV_ID
size: 12
data: 1 (2nd enet device)
[4.3] tag: BI_MAC_ADDR
size: 28
data: gg:hh:ii:jj:kk:ll (ascii)
pad: 3
[4.4] 0x00000000 (NULL Termination of BI_STRUCT)[5] tag: BI_STRUCT (embedded enet cltr 2)
size: 68 (12 + 2*12 + 28 + 4 == 68)
data: BI_DEVICE
[5.0] tag: BI_DEV_TYPE
size: 12
data: BI_DEV_TYPE_GT_ETH
[5.2] tag: BI_DEV_ID
size: 12
data: 2 (3rd enet device)
[5.3] tag: BI_MAC_ADDR
size: 28
data: mm:nn:oo:pp:qq:rr (ascii)
pad: 3
[5.4] 0x00000000 (NULL Termination of BI_STRUCT)[6] 0x00000000 (NULL Termination of whole list)
** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/
Forget the last one, here's attempt #3:
Example for ev64260:
--------------------
[0] tag: BI_CMD_LINE
size: 36 (4 + 4 + 26 chars + 2 pad)
data: "console=ttyS0,115200 ip=on"
pad: 2[1] tag: BI_MEMSIZE
size: 12
data: 33554432 (32 MB)[2] tag: BI_GT64260_BASE
size: 12
data: fc000000[3] tag: BI_DEVICE (embedded enet cltr 0)
size: 64 (8 + 2*12 + 28 + 4 == 64)
[3.0] tag: BI_DEV_TYPE
size: 12
data: BI_DEV_TYPE_GT_ETH
[3.2] tag: BI_DEV_ID
size: 12
data: 0 (1st enet device)
[3.3] tag: BI_MAC_ADDR
size: 28
data: aa:bb:cc:dd:ee:ff (ascii)
pad: 3
[3.4] 0x00000000 (NULL Termination of BI_STRUCT)[4] tag: BI_DEVICE (embedded enet cltr 1)
size: 64 (8 + 2*12 + 28 + 4 == 64)
[4.0] tag: BI_DEV_TYPE
size: 12
data: BI_DEV_TYPE_GT_ETH
[4.2] tag: BI_DEV_ID
size: 12
data: 1 (2nd enet device)
[4.3] tag: BI_MAC_ADDR
size: 28
data: gg:hh:ii:jj:kk:ll (ascii)
pad: 3
[4.4] 0x00000000 (NULL Termination of BI_STRUCT)[5] tag: BI_DEVICE (embedded enet cltr 2)
size: 64 (8 + 2*12 + 28 + 4 == 64)
[5.0] tag: BI_DEV_TYPE
size: 12
data: BI_DEV_TYPE_GT_ETH
[5.2] tag: BI_DEV_ID
size: 12
data: 2 (3rd enet device)
[5.3] tag: BI_MAC_ADDR
size: 28
data: mm:nn:oo:pp:qq:rr (ascii)
pad: 3
[5.4] 0x00000000 (NULL Termination of BI_STRUCT)[6] 0x00000000 (NULL Termination of whole list)
** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/
Quoted 2 lines
Forget the last one, here's attempt #3:
Looks fine for me.
So everybody agree around this mecanism ?
Ben.
** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/
Quoted 3 lines · Mark A. Greer
I also adde NULL termination to the overall
bi_recand to each nested one so the parsing code can stop when a NULL is hit whether its a nested one or not (therefore we can never have a valid tag with value 0). I also adjusted the size
Don't we have BI_LAST for that?
Note that on m68k and on PPC/APUS, BI_LAST == 0, but on other PPC platforms BI_LAST = 0x1011.
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]
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
** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/