Because sometimes things just need a bit of tweaking to work.
Platforms:
- Celestica Questone 2: TODO
dnf install arm-none-eabi-gcc-cs arm-none-eabi-newlib
make
The CMICx LED interface has two RAM Banks as shown below, Bank0 (Accumulation RAM) for accumulation of status from ports and Bank1 (Pattern RAM) for writing LED pattern. Both Bank0 and Bank1 are of 1024x16-bit, each row representing one port.
Accumulation RAM (Bank 0) Pattern RAM (Bank1)
15 0 15 0
---------------------------- ------------------------------
Row 0 | led_uc_port 0 status | | led_uc_port 0 LED Pattern |
---------------------------- ------------------------------
Row 1 | led_uc_port 1 status | | led_uc_port 1 LED Pattern |
---------------------------- ------------------------------
| | | |
---------------------------- ------------------------------
| | | |
---------------------------- ------------------------------
| | | |
---------------------------- ------------------------------
| | | |
---------------------------- ------------------------------
| | | |
---------------------------- ------------------------------
Row 127 | led_uc_port 128 status | | led_uc_port 128 LED Pattern |
---------------------------- ------------------------------
Row 128 | | | |
---------------------------- ------------------------------
| | | |
---------------------------- ------------------------------
| | | |
---------------------------- ------------------------------
Row x | led_uc_port (x+1) status| | led_uc_port(x+1) LED Pattern|
---------------------------- ------------------------------
| | | |
---------------------------- ------------------------------
| | | |
---------------------------- ------------------------------
Row 1022| led_uc_port 1022 status | | led_uc_port 1022 LED Pattern|
---------------------------- ------------------------------
Row 1023| led_uc_port 1023 status | | led_uc_port 1023 LED Pattern|
---------------------------- ------------------------------
Format of Accumulation RAM:
Bits 15:9 8 7 6 5 4:3 2 1 0
------------------------------------------------------------------------
| Reserved | Link | Link-up | Flow | Duplex | Speed | Col | Tx | Rx |
| | Enable| Status | Control| | | | | |
------------------------------------------------------------------------
Where Speed:
- 00 - 10 Mbps
- 01 - 100 Mbps
- 10 - 1 Gbps
- 11 - Above 1 Gbps
The custom handler in this file should read the port status from
the HW Accumulation RAM or led_control_data
array, then form the required
LED bit pattern in the Pattern RAM at the corresponding location.
The led_control_data
is a 1024 bytes array, application user can use BCM LED API
to exchange port information with LED FW. E.g. using the default callback
ledproc_linkscan_cb
inside diag when using led auto on
.
Typically, led_uc_port = physical port number - constant
.
The constant is 1 for ESW chips, 0 for DNX/DNXF chips and 2 for Firelight.
For those ports that do not meet the above rule, they will be listed in
include/shared/cmicfw/cmicx_led_public.h
.
There are five LED interfaces in CMICx-based devices, and although
a single interface can be used to output LED patterns for all
ports, it is possible to use more than one interface, e.g. the LEDs
for some ports are connected to LED interface-0, while the rest of
the ports are connected to LED interface-1. Accordingly, the custom
handler MUST fill in start-port, end-port and pattern-width in the
soc_led_custom_handler_ctrl_t
structure passed to the custom
handler.
The example custom handler provided in this file has reference code for forming two different LED patterns. Please refer to these patterns before writing your own custom handler code.
The led_customer_t structure
definition is available in
include/shared/cmicfw/cmicx_led_public.h
.