FreeBSD/sys/dev/qlxgbe/ql_misc.c
/*
 * Name: qla_load_fw_from_flash
 * Function: Reads the Bootloader from Flash and Loads into Offchip Memory
 */
qla_load_fw_from_flash
Function: Reads the Bootloader from Flash and Loads into Offchip Memory
qla_load_fw_from_flash Function : Reads the Bootloader from Flash and Loads into Offchip Memory
static void
qla_load_fw_from_flash(qla_host_t *ha)
{
	uint32_t flash_off	= 0x10000;
	uint64_t mem_off;
	uint32_t count, mem_size;
	q80_offchip_mem_val_t val;
	mem_off = (uint64_t)(READ_REG32(ha, Q8_BOOTLD_ADDR));
	mem_size = READ_REG32(ha, Q8_BOOTLD_SIZE);
	device_printf(ha->pci_dev, "%s: [0x%08x][0x%08x]\n",
		__func__, (uint32_t)mem_off, mem_size);
	for (count = 0; count < mem_size ; ) {
		ql_rd_flash32(ha, flash_off, &val.data_lo);
		count = count + 4;
		flash_off = flash_off + 4;
		ql_rd_flash32(ha, flash_off, &val.data_hi);
		count = count + 4;
		flash_off = flash_off + 4;
		ql_rd_flash32(ha, flash_off, &val.data_ulo);
		count = count + 4;
		flash_off = flash_off + 4;
		ql_rd_flash32(ha, flash_off, &val.data_uhi);
		count = count + 4;
		flash_off = flash_off + 4;
		ql_rdwr_offchip_mem(ha, mem_off, &val, 0);
		mem_off = mem_off + 16;
	}
	return;
}
static void qla_load_fw_from_flash ( qla_host_t * ha ) { uint32_t flash_off = 0x10000 ; uint64_t mem_off ; uint32_t count , mem_size ; q80_offchip_mem_val_t val ; mem_off = ( uint64_t ) ( READ_REG32 ( ha , Q8_BOOTLD_ADDR ) ) ; mem_size = READ_REG32 ( ha , Q8_BOOTLD_SIZE ) ; device_printf ( ha -> pci_dev , " \n " , __func__ , ( uint32_t ) mem_off , mem_size ) ; for ( count = 0 ; count < mem_size ; ) { ql_rd_flash32 ( ha , flash_off , & val . data_lo ) ; count = count + 4 ; flash_off = flash_off + 4 ; ql_rd_flash32 ( ha , flash_off , & val . data_hi ) ; count = count + 4 ; flash_off = flash_off + 4 ; ql_rd_flash32 ( ha , flash_off , & val . data_ulo ) ; count = count + 4 ; flash_off = flash_off + 4 ; ql_rd_flash32 ( ha , flash_off , & val . data_uhi ) ; count = count + 4 ; flash_off = flash_off + 4 ; ql_rdwr_offchip_mem ( ha , mem_off , & val , 0 ) ; mem_off = mem_off + 16 ; } return ; }
Name: qla_load_fw_from_flash
 Function: Reads the Bootloader from Flash and Loads into Offchip Memory
Name : qla_load_fw_from_flash Function : Reads the Bootloader from Flash and Loads into Offchip Memory
/* only bootloader needs to be loaded into memory */