This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

MAC Hash Address Register.

Other Parts Discussed in Thread: AM1705, OMAP-L138

Hi, all.

I have am1705. The SPRUH93A defines the calculation of HASH in 18.3.3.37 paragraph.

But I have a question about it. Is is possible to look on the example of calculation?

I need a hash for 01:80:c2:00:00:03 as example.

As far as I understood the HASH will be:

Hash_fun = 0x84, 0x8C, 0x002, 0x02, 0x02, 0x00

And the MACHASH1 = 0x02008C84; MACHASH2=0x00000002.

Am I correct?

  • Hello,

    I only worked with the EMAC controller on the OMAP-L138.  If they are both the same and it does look that way, then your calculation is incorrect.

    Only 1 bit should be set for each address.

    You can do a lazy man's way by enabling all the bits on the two registers and your packet should go through.

    Then start clearing all the bits on one register and see if the packet still go through.  If not, you cleared the wrong register.

    Then continue doing so until you find that one bit.  That was how I figured out the hash address for UPNP and mDNS.

    But if you really want the calculation, then:

       * The UPNP 48 Bit Destination Address is 01:00:5E:7F:FF:FA
       *                 0    1 :  0    0 :  5    E :  7    F :  F    F :  F    A
       *               0       7 8      15 16     23 24     31 32     39 40     47
       *               0000 0001 0000 0000 0101 1110 0111 1111 1111 1111 1111 1010
       * Hash_fun(0) = 0   ^  0      ^0   ^  0      ^0   ^  1      ^1   ^  1       = 1  (MSB)
       * Hash_fun(1) =  0  ^   1     ^ 0  ^   1     ^ 1  ^   1     ^ 1  ^   1      = 0
       * Hash_fun(2) =   0      ^0   ^  0      ^1   ^  1      ^1   ^  1      ^1    = 1
       * Hash_fun(3) =    0     ^ 0  ^   0     ^ 1  ^   1     ^ 1  ^   1     ^ 0   = 0
       * Hash_fun(4) =      0   ^  0      ^0   ^  1      ^1   ^  1      ^1   ^  1  = 1
       * Hash_fun(5) =       0  ^   0     ^ 1  ^   0     ^ 1  ^   1^      1  ^   0 = 0  (LSB)
       * Hash_fun = 0x2A
       *
    So, for 0x2A, set bit 10 of MACHASH2.

    Cheers,

    Victor