示例#1
0
/*
 * only support irom booting.
 */
void irom_copyself(void)
{
	u32_t om;
	u32_t * mem;
	u32_t size;

	/*
	 * read om register, om[5..1]
	 */
	om = (u32_t)((reg_read(EXYNOS4412_PMU_OM_STAT) >> 1) & 0x1f);

	/* SDMMC CH2 */
	if(om == 0x2)
	{
		/*
		 * the xboot's memory base address.
		 */
		mem = (u32_t *)__text_start;

		/*
		 * the size which will be copyed, the 'size' is
		 * 1 : 256KB, 2 : 512KB, 3 : 768KB, 4 : 1024KB ...
		 */
		size = (__data_shadow_end - __text_start + 0x00040000) >> 18;

		/*
		 * how many blocks the 'size' is , 512 bytes per block.
		 * size * 256 *1024 / 512 = size * 2^9 = size << 9
		 */
		size = size << 9;

		/*
		 * copy xboot to memory from sdmmc ch2.
		 */
		irom_sdmmc_to_mem(1, size, mem);
	}
示例#2
0
/*
 * only support irom booting.
 */
void irom_copyself(void)
{
	u8_t om;
	u32_t * mem;
	u32_t size;

	/*
	 * read om register, om[4..1]
	 */
	om = (u8_t)((reg_read(S5PV210_OMR) >> 1) & 0x0f);

	/* essd */
	if(om == 0x0)
	{

	}

	/* nand 2KB, 5-cycle, 8-bit ecc */
	else if(om == 0x1)
	{

	}

	/* nand 4KB, 5-cycle, 8-bit ecc */
	else if(om == 0x2)
	{

	}

	/* nand 4KB, 5-cycle, 16-bit ecc */
	else if(om == 0x3)
	{

	}

	/* onenand mux */
	else if(om == 0x4)
	{

	}

	/* onenand demux */
	else if(om == 0x5)
	{

	}

	/* sd / mmc */
	else if(om == 0x6)
	{
		/*
		 * the xboot's memory base address.
		 */
		mem = (u32_t *)__text_start;

		/*
		 * the size which will be copyed, the 'size' is
		 * 1 : 256KB, 2 : 512KB, 3 : 768KB, 4 : 1024KB ...
		 */
		size = (__data_shadow_end - __text_start + 0x00040000) >> 18;

		/*
		 * how many blocks the 'size' is , 512 bytes per block.
		 * size * 256 *1024 / 512 = size * 2^9 = size << 9
		 */
		size = size << 9;

		/*
		 * copy xboot to memory from sd/mmc card.
		 */
		if(irom_v210_sdmmc_base == 0xeb000000)
		{
			irom_sdmmc_to_mem(0, 1, size, mem, 0);
		}
		else if(irom_v210_sdmmc_base == 0xeb200000)
		{
			irom_sdmmc_to_mem(2, 1, size, mem, 0);
		}
		else
		{
			return;
		}
	}