Esempio n. 1
0
uint16 emu_Read_Device_ID()
{
    uint16  status = PASS;             

    GLOB_DeviceInfo.wDeviceMaker    = 0xBB; 
    GLOB_DeviceInfo.wDeviceType     = 4;
    GLOB_DeviceInfo.wSpectraStartBlock = 3;
    GLOB_DeviceInfo.wSpectraEndBlock  = GLOB_LLD_BLOCKS-1;
    GLOB_DeviceInfo.wTotalBlocks    = GLOB_LLD_BLOCKS;   
    GLOB_DeviceInfo.wPagesPerBlock  = GLOB_LLD_PAGES;
    GLOB_DeviceInfo.wPageSize       = GLOB_LLD_PAGE_SIZE;
    GLOB_DeviceInfo.wPageDataSize   = GLOB_LLD_PAGE_DATA_SIZE;
    GLOB_DeviceInfo.wPageSpareSize  = GLOB_LLD_PAGE_SIZE - GLOB_LLD_PAGE_DATA_SIZE;
    GLOB_DeviceInfo.wBlockSize      = GLOB_DeviceInfo.wPageSize * GLOB_LLD_PAGES;
    GLOB_DeviceInfo.wBlockDataSize  = GLOB_DeviceInfo.wPageDataSize * GLOB_LLD_PAGES;
    GLOB_DeviceInfo.wDataBlockNum   = (BLOCKNODE)(GLOB_DeviceInfo.wSpectraEndBlock - GLOB_DeviceInfo.wSpectraStartBlock+1);
    GLOB_DeviceInfo.MLCDevice       = EMU_MLC_DEV;

    GLOB_DeviceInfo.nBitsInPageNumber = (byte)GLOB_Calc_Used_Bits(GLOB_DeviceInfo.wPagesPerBlock);
    GLOB_DeviceInfo.nBitsInPageDataSize = (byte)GLOB_Calc_Used_Bits(GLOB_DeviceInfo.wPageDataSize);
    GLOB_DeviceInfo.nBitsInBlockDataSize = (byte)GLOB_Calc_Used_Bits(GLOB_DeviceInfo.wBlockDataSize);
#if CMD_DMA
    GLOB_totalUsedBanks = 4; 
    GLOB_valid_banks[0] = 1;
    GLOB_valid_banks[1] = 1;
    GLOB_valid_banks[2] = 1;
    GLOB_valid_banks[3] = 1;
#endif    

    return status;
}
Esempio n. 2
0
u16 mtd_Read_Device_ID(void)
{
	uint64_t tmp;
	nand_dbg_print(NAND_DBG_TRACE, "%s, Line %d, Function: %s\n",
		       __FILE__, __LINE__, __func__);

	if (!spectra_mtd)
		return FAIL;

	DeviceInfo.wDeviceMaker = 0;
	DeviceInfo.wDeviceType = 8;
	DeviceInfo.wSpectraStartBlock = SPECTRA_START_BLOCK;
	tmp = spectra_mtd->size;
	do_div(tmp, spectra_mtd->erasesize);
	DeviceInfo.wTotalBlocks = tmp;
	DeviceInfo.wSpectraEndBlock = DeviceInfo.wTotalBlocks - 1;
	DeviceInfo.wPagesPerBlock = spectra_mtd->erasesize / spectra_mtd->writesize;
	DeviceInfo.wPageSize = spectra_mtd->writesize + spectra_mtd->oobsize;
	DeviceInfo.wPageDataSize = spectra_mtd->writesize;
	DeviceInfo.wPageSpareSize = spectra_mtd->oobsize;
	DeviceInfo.wBlockSize = DeviceInfo.wPageSize * DeviceInfo.wPagesPerBlock;
	DeviceInfo.wBlockDataSize = DeviceInfo.wPageDataSize * DeviceInfo.wPagesPerBlock;
	DeviceInfo.wDataBlockNum = (u32) (DeviceInfo.wSpectraEndBlock -
						DeviceInfo.wSpectraStartBlock
						+ 1);
	DeviceInfo.MLCDevice = 0;//spectra_mtd->celltype & NAND_CI_CELLTYPE_MSK;
	DeviceInfo.nBitsInPageNumber =
		(u8)GLOB_Calc_Used_Bits(DeviceInfo.wPagesPerBlock);
	DeviceInfo.nBitsInPageDataSize =
		(u8)GLOB_Calc_Used_Bits(DeviceInfo.wPageDataSize);
	DeviceInfo.nBitsInBlockDataSize =
		(u8)GLOB_Calc_Used_Bits(DeviceInfo.wBlockDataSize);

#if CMD_DMA
	totalUsedBanks = 4;
	valid_banks[0] = 1;
	valid_banks[1] = 1;
	valid_banks[2] = 1;
	valid_banks[3] = 1;
#endif

	return PASS;
}
Esempio n. 3
0
u16 emu_Read_Device_ID(void)
{
    nand_dbg_print(NAND_DBG_TRACE, "%s, Line %d, Function: %s\n",
                   __FILE__, __LINE__, __func__);

    DeviceInfo.wDeviceMaker = 0;
    DeviceInfo.wDeviceType = 8;
    DeviceInfo.wSpectraStartBlock = 36;
    DeviceInfo.wSpectraEndBlock = GLOB_LLD_BLOCKS - 1;
    DeviceInfo.wTotalBlocks = GLOB_LLD_BLOCKS;
    DeviceInfo.wPagesPerBlock = GLOB_LLD_PAGES;
    DeviceInfo.wPageSize = GLOB_LLD_PAGE_SIZE;
    DeviceInfo.wPageDataSize = GLOB_LLD_PAGE_DATA_SIZE;
    DeviceInfo.wPageSpareSize = GLOB_LLD_PAGE_SIZE -
                                GLOB_LLD_PAGE_DATA_SIZE;
    DeviceInfo.wBlockSize = DeviceInfo.wPageSize * GLOB_LLD_PAGES;
    DeviceInfo.wBlockDataSize = DeviceInfo.wPageDataSize * GLOB_LLD_PAGES;
    DeviceInfo.wDataBlockNum = (u32) (DeviceInfo.wSpectraEndBlock -
                                      DeviceInfo.wSpectraStartBlock
                                      + 1);
    DeviceInfo.MLCDevice = 1; /* Emulate MLC device */
    DeviceInfo.nBitsInPageNumber =
        (u8)GLOB_Calc_Used_Bits(DeviceInfo.wPagesPerBlock);
    DeviceInfo.nBitsInPageDataSize =
        (u8)GLOB_Calc_Used_Bits(DeviceInfo.wPageDataSize);
    DeviceInfo.nBitsInBlockDataSize =
        (u8)GLOB_Calc_Used_Bits(DeviceInfo.wBlockDataSize);

#if CMD_DMA
    totalUsedBanks = 4;
    valid_banks[0] = 1;
    valid_banks[1] = 1;
    valid_banks[2] = 1;
    valid_banks[3] = 1;
#endif

    return PASS;
}