Skip to contentSkip to conversation

EV-64260-BP & GT64260 bi_recs

DISCUSSION Michael Sokolov 3 participants 6 messages Mar 27, 2002

lore
Share & tools
lore
#1 lore raw
In reply to Michael Sokolov
Quoted 11 lines · Michael Sokolov
Quoted 1 line · Mark A. Greer

Okay, this may be it, attempt #4:

Looks fine, except for:

Quoted 1 line

[6] 0x00000000 (NULL Termination of whole list)

Currently the entire bi_recs list starts with BI_FIRST (that's how we detect a bi_recs list) and ends with BI_LAST (that's the terminator). We must maintain compatibility.

Yeah, that's right, I messed up. So what should be done for the nested ones? What is we use the BI_DEVICE as a quasi-BI_FIRST and then add a BI_LAST to each nested one? This is what it would look like:

Example for ev64260:
--------------------

[0] tag: BI_FIRST

    size: 4
    data: 0x00000000                    (don't care)

[1] tag: BI_CMD_LINE

    size: 36                            (4 + 4 + 26 chars + 2 pad)
    data: "console=ttyS0,115200 ip=on"
    pad: 2

[2] tag: BI_MEMSIZE

    size: 12
    data: 0x33554432                    (32 MB)

[3] tag: BI_GT64260_BASE

    size: 12
    data: 0xfc000000

[4] tag: BI_DEVICE (embedded enet cltr 0)

    size: 60                            (8 + 2*12 + 16 + 12 == 60)

    [4.0] tag: BI_DEV_TYPE
          size: 12
          data: BI_DEV_TYPE_GT_ETH

    [4.1] tag: BI_DEV_ID
          size: 12
          data: 0x00000000              (1st enet device)

    [4.2] tag: BI_MAC_ADDR
          size: 16
          data: 0xaabbccddeeff          (6 byte MAC addr)
          pad: 2

    [4.3] tag: BI_LAST
          size: 4
          data: 0x00000000              (don't care)

[5] tag: BI_DEVICE (embedded enet cltr 1)

    size: 60                            (8 + 2*12 + 16 + 12 == 60)

    [5.0] tag: BI_DEV_TYPE
          size: 12
          data: BI_DEV_TYPE_GT_ETH

    [5.1] tag: BI_DEV_ID
          size: 12
          data: 0x00000001              (2nd enet device)

    [5.2] tag: BI_MAC_ADDR
          size: 16
          data: 0xgghhiijjkkll          (6 byte MAC addr)
          pad: 2

    [5.3] tag: BI_LAST
          size: 4
          data: 0x00000000              (don't care)

[6] tag: BI_DEVICE (embedded enet cltr 2)

    size: 60                            (8 + 2*12 + 16 + 12 == 60)

    [6.0] tag: BI_DEV_TYPE
          size: 12
          data: BI_DEV_TYPE_GT_ETH

    [6.1] tag: BI_DEV_ID
          size: 12
          data: 0x00000002              (3rd enet device)

    [6.2] tag: BI_MAC_ADDR
          size: 16
          data: 0xmmnnooppqqrr          (6 byte MAC addr)
          pad: 2

    [6.3] tag: BI_LAST
          size: 4
          data: 0x00000000              (don't care)

[7] tag: BI_LAST

    size: 4
    data: 0x00000000                    (don't care)

** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/

#2 lore raw
Quoted 3 lines · Mark A. Greer

Yeah, that's right, I messed up. So what should be done for the nested ones? What is we use the BI_DEVICE as a quasi-BI_FIRST and then add a BI_LAST to each nested one? This is what it would look like:

I messed up the size on the BI_LAST struct, should be 12. Attempt #5:

Example for ev64260:
--------------------

[0] tag: BI_FIRST

    size: 12
    data: 0x00000000                    (don't care)

[1] tag: BI_CMD_LINE

    size: 36                            (4 + 4 + 26 chars + 2 pad)
    data: "console=ttyS0,115200 ip=on"
    pad: 2

[2] tag: BI_MEMSIZE

    size: 12
    data: 0x33554432                    (32 MB)

[3] tag: BI_GT64260_BASE

    size: 12
    data: 0xfc000000

[4] tag: BI_DEVICE (embedded enet cltr 0)

    size: 60                            (8 + 2*12 + 16 + 12 == 60)

    [4.0] tag: BI_DEV_TYPE
          size: 12
          data: BI_DEV_TYPE_GT_ETH

    [4.1] tag: BI_DEV_ID
          size: 12
          data: 0x00000000              (1st enet device)

    [4.2] tag: BI_MAC_ADDR
          size: 16
          data: 0xaabbccddeeff          (6 byte MAC addr)
          pad: 2

    [4.3] tag: BI_LAST
          size: 12
          data: 0x00000000              (don't care)

[5] tag: BI_DEVICE (embedded enet cltr 1)

    size: 60                            (8 + 2*12 + 16 + 12 == 60)

    [5.0] tag: BI_DEV_TYPE
          size: 12
          data: BI_DEV_TYPE_GT_ETH

    [5.1] tag: BI_DEV_ID
          size: 12
          data: 0x00000001              (2nd enet device)

    [5.2] tag: BI_MAC_ADDR
          size: 16
          data: 0xgghhiijjkkll          (6 byte MAC addr)
          pad: 2

    [5.3] tag: BI_LAST
          size: 12
          data: 0x00000000              (don't care)

[6] tag: BI_DEVICE (embedded enet cltr 2)

    size: 60                            (8 + 2*12 + 16 + 12 == 60)

    [6.0] tag: BI_DEV_TYPE
          size: 12
          data: BI_DEV_TYPE_GT_ETH

    [6.1] tag: BI_DEV_ID
          size: 12
          data: 0x00000002              (3rd enet device)

    [6.2] tag: BI_MAC_ADDR
          size: 16
          data: 0xmmnnooppqqrr          (6 byte MAC addr)
          pad: 2

    [6.3] tag: BI_LAST
          size: 12
          data: 0x00000000              (don't care)

[7] tag: BI_LAST

    size: 12
    data: 0x00000000                    (don't care)

** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/

#4 lore raw
In reply to [email protected]
Quoted 2 lines · [email protected] wrote:

Any reason why BI_LAST has those 4 bytes of data set to 0, why not just BI_LAST size=0 and no data ?

Only reason is that it is how its implemented now so to keep backward compatibility...

E.g., _2_4_devel, arch/ppc/boot/common/misc-simple.c:decompress_kernel()

        rec->tag = BI_LAST;
        rec->size = sizeof(struct bi_record);
        rec = (struct bi_record *)((unsigned long)rec + rec->size);

Mark

** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/

#0 lore raw
Quoted 1 line · Mark A. Greer

Okay, this may be it, attempt #4:

Looks fine, except for:

Quoted 1 line

[6] 0x00000000 (NULL Termination of whole list)

Currently the entire bi_recs list starts with BI_FIRST (that's how we detect a bi_recs list) and ends with BI_LAST (that's the terminator). We must maintain compatibility.

MS

** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/

#5 lore raw
In reply to Mark A. Greer
Quoted 5 lines · Mark A. Greer
Quoted 2 lines · [email protected] wrote:

Any reason why BI_LAST has those 4 bytes of data set to 0, why not just BI_LAST size=0 and no data ?

Quoted 8 lines

Only reason is that it is how its implemented now so to keep backward compatibility...

E.g., _2_4_devel, arch/ppc/boot/common/misc-simple.c:decompress_kernel()

        rec->tag = BI_LAST;
        rec->size = sizeof(struct bi_record);
        rec = (struct bi_record *)((unsigned long)rec + rec->size);

Ahh shit, I was thinking bi_rec had data[1], not data[0].

Attempt #6:

[0] tag: BI_FIRST

    size: 8

[1] tag: BI_CMD_LINE

    size: 36                            (4 + 4 + 26 chars + 2 pad)
    data: "console=ttyS0,115200 ip=on"
    pad: 2

[2] tag: BI_MEMSIZE

    size: 12
    data: 0x33554432                    (32 MB)

[3] tag: BI_GT64260_BASE

    size: 12
    data: 0xfc000000

[4] tag: BI_DEVICE (embedded enet cltr 0)

    size: 56                            (8 + 2*12 + 16 + 8 == 56)

    [4.0] tag: BI_DEV_TYPE
          size: 12
          data: BI_DEV_TYPE_GT_ETH

    [4.1] tag: BI_DEV_ID
          size: 12
          data: 0x00000000              (1st enet device)

    [4.2] tag: BI_MAC_ADDR
          size: 16
          data: 0xaabbccddeeff          (6 byte MAC addr)
          pad: 2

    [4.3] tag: BI_LAST
          size: 8

[5] tag: BI_DEVICE (embedded enet cltr 1)

    size: 56                            (8 + 2*12 + 16 + 8 == 56)

    [5.0] tag: BI_DEV_TYPE
          size: 12
          data: BI_DEV_TYPE_GT_ETH

    [5.1] tag: BI_DEV_ID
          size: 12
          data: 0x00000001              (2nd enet device)

    [5.2] tag: BI_MAC_ADDR
          size: 16
          data: 0xgghhiijjkkll          (6 byte MAC addr)
          pad: 2

    [5.3] tag: BI_LAST
          size: 8
[6] tag: BI_DEVICE                      (embedded enet cltr 2)
    size: 56                            (8 + 2*12 + 16 + 8 == 56)

    [6.0] tag: BI_DEV_TYPE
          size: 12
          data: BI_DEV_TYPE_GT_ETH

    [6.1] tag: BI_DEV_ID
          size: 12
          data: 0x00000002              (3rd enet device)

    [6.2] tag: BI_MAC_ADDR
          size: 16
          data: 0xmmnnooppqqrr          (6 byte MAC addr)
          pad: 2

    [6.3] tag: BI_LAST
          size: 8

[7] tag: BI_LAST

    size: 8

** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/

#3 lore raw
In reply to Mark A. Greer
Quoted 5 lines

Yeah, that's right, I messed up. So what should be done for the nested ones? What is we use the BI_DEVICE as a quasi-BI_FIRST and then add a BI_LAST to each
nested one? This is what it would look like:

Any reason why BI_LAST has those 4 bytes of data set to 0, why not just BI_LAST size=0 and no data ?

Ben.

** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/