Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob

Signature SCAN support in EZ-HOST or EZ-OTG

Signature SCAN support in EZ-HOST or EZ-OTG

Anonymous
Not applicable
Question: How BIOS utilizes signature SCAN support in EZ-HOST and what  SCAN opcodes are used during firmware download?

 

Answer:

The signature SCAN support is a comprehensive control protocol that allows UART, serial EEPROM(I2C), USB, and external ROM to interface to the BIOS. There are 2 interrupts to utilize the signature SCAN support

1. SCAN_INT as Interrupt 67 at vector location 0x86

2. SCAN_DECODE_INT as Interrupt 79 at vector location 0x9E

During Boot up time BIOS will utilize signature SCAN features in the following way:

1.   Read External ROM location 0xC100 for SCAN signature 0xC3B6.If it exists BIOS will jump to the location following the signature  for the entire BIOS override.

2.   Reads the EEPROM through I2C for SCAN signature 0xC3B6. If it exists the subsequent SCAN records are read sequentially and the entire firmware image is copied from EEPROM to on-chip RAM at start_addr mentioned in the SCAN record.

3.   At the end of BIOS initialization BIOS creates usb_idle and uart_idle tasks. uart_idle used for debugging through COM port and usb_idle to download firmware image into EEPROM. These tasks run concurrently in the background and call SCAN interrupt if 0xC3B6 is decoded in the UART/USB packets.

Using scanwrap.exe utility of CY3663 DVK the firmware image xxxx.bin is converted to scan_xxx.bin .This image contains SCAN records inserted between data. The image is downloaded into EEPROM in standalone mode .During boot up BIOS checks the EEPROM for SCAN records in this image.

The image contains SCAN records in the below format

Record1:

0xC3B6-0xnnnn(data length)-0xmm(SCAN opcode) – data_0....data_n 

Record2:

0xC3B6-0xnnnn(data length)-0xmm(SCAN opcode) – data_0....data_n 

Last Record:

0x00 0x00

There are 10 SCAN opcodes for different functionality. Method of interpreting the data bytes depends on SCAN opcode number. SCAN_DECODE_INT interrupt will decode the SCAN record to find the relevant opcode. simple examples (se2,se8) utilize SCAN opcodes 0 and 4 to skip SIE1/SIE2 hardware initialization in BIOS. For I2C download SCAN opcode 7 and 8 are used.

Refer the following documents for detailed description,

1.   USB Multi-Role Device Design By Example.pdf: Page 34-35

2.   OTG-Host BIOS User Manual.pdf :pages 35-39

Both the documents can be found at C:\Cypress\USB\OTG-Host\Docs in CY3663 DVK .

0 Likes
241 Views
Contributors