• Vladimir Oltean's avatar
    net: mscc: ocelot: auto-detect packet buffer size and number of frame references · f6fe01d6
    Vladimir Oltean authored
    Instead of reading these values from the reference manual and writing
    them down into the driver, it appears that the hardware gives us the
    option of detecting them dynamically.
    
    The number of frame references corresponds to what the reference manual
    notes, however it seems that the frame buffers are reported as slightly
    less than the books would indicate. On VSC9959 (Felix), the books say it
    should have 128KB of packet buffer, but the registers indicate only
    129840 bytes (126.79 KB). Also, the unit of measurement for FREECNT from
    the documentation of all these devices is incorrect (taken from an older
    generation). This was confirmed by Younes Leroul from Microchip support.
    
    Not having anything better to do with these values at the moment* (this
    will change soon), let's just print them.
    
    *The frame buffer size is, in fact, used to calculate the tail dropping
    watermarks.
    Signed-off-by: default avatarVladimir Oltean <vladimir.oltean@nxp.com>
    Reviewed-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
    Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
    f6fe01d6
ocelot_qsys.h 14.7 KB