Commit 273250b7 authored by Benoit Rat's avatar Benoit Rat Committed by Grzegorz Daniluk

userspace: Improve the status LED mechanism

0. From power until linux has boot the led is unpowered
1. We first set init it before flashing FPGA => LED is yellow.
2. Then when the HAL start => LED is orange
3. WR is setup => LED is green
parent 91e1de44
......@@ -106,9 +106,6 @@ int shw_io_init()
IOARR_SET_IO(shw_io_led_state_g,SHW_I2C,I2C_shw_io_led_state_g);
IOARR_SET_IO(shw_io_led_state_o,SHW_I2C,I2C_shw_io_led_state_o);
//Finally setup the orange led state before initiate anything else
shw_io_write(shw_io_led_state_o,1);
}
TRACE(TRACE_INFO, "version=%g",ver);
......
......@@ -10,7 +10,7 @@ for arg in $(cat /proc/cmdline); do
done
# Obtain the type of FPGA (LX130XT or LX240XT)
tfpga=$($WR_HOME/bin/shw_ver -f)
tfpga=$($WR_HOME/bin/shw_ver -F)
$WR_HOME/bin/load-virtex $WR_HOME/lib/firmware/18p_mb-${tfpga}.bin
$WR_HOME/bin/load-lm32 $WR_HOME/lib/firmware/rt_cpu.bin
......
......@@ -41,7 +41,8 @@ void help(const char* pgrname)
printf("usage: %s <command>\n", pgrname);
printf("available commands are:\n"
" -p PCB version\n"
" -f FPGA size\n"
" -f FPGA type\n"
" -F FPGA type and init status LED\n"
" -c Compiling time\n"
" -v version (git)\n"
" -a All (default)\n"
......@@ -61,15 +62,26 @@ int main(int argc, char **argv)
assert_init(shw_pio_mmap_init());
shw_io_init();
shw_io_configure_all();
shw_io_t* all_io = (shw_io_t*)_all_shw_io;
switch(func)
{
case 'p':
printf("%s\n",get_shw_info(func));
break;
case 'F':
/* When the linux has boot the status led
* is unpowered so we set it to yellow
* until the HAL start (LED is orange) and finally
* WR is setup (LED is green) */
if(shw_io_read(shw_io_led_state_g)==0)
{
shw_io_write(shw_io_led_state_o,1);
shw_io_write(shw_io_led_state_g,1);
}
func='f';
case 'f':
printf("%s\n",get_shw_info(func));
break;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment