Of particular interest is this line:
msg.data[0] = (clk == 0) ? clk : ((clk / 10) % 20) + 2;
It looks like calling
baikal_setoption() allows the clock to be set to an arbitrary value.
To be honest I don't get the point of this part
((clk / 10) % 20) + 2It just doesn't make any sense to me. If the clock is set to 400 MHz, then the msg.data[0] value will be 2. While if the clock is 300 MHz, then msg.data[0] is 12.
What is the logic here?