2.10.1、uboot与linux驱动
2.10.1.1、uboot本身是裸机程序

2.10.1.2、uboot的虚拟地址对硬件操作的影响

2.10.1.3、uboot借用(移植)了linux驱动

2.10.2、iNand/SD驱动解析1
2.10.2.1、从start_armboot开始

#if defined(CONFIG_GENERIC_MMC)
puts ("SD/MMC: ");
mmc_exist = mmc_initialize(gd->bd);
if (mmc_exist != 0)
{
puts ("0 MB\n");
}
#endif
2.10.2.2、mmc_initialize

static struct list_head mmc_devices;
struct list_head {
struct list_head *next, *prev;
};
#define INIT_LIST_HEAD(ptr) do { \
(ptr)->next = (ptr); (ptr)->prev = (ptr); \
} while (0)
static int __def_mmc_init(bd_t *bis)
{
return -1;
}
int cpu_mmc_init(bd_t *bis) __attribute__((weak, alias("__def_mmc_init")));
int board_mmc_init(bd_t *bis) __attribute__((weak, alias("__def_mmc_init")));
int mmc_initialize(bd_t *bis)
{
struct mmc *mmc;
int err;
INIT_LIST_HEAD(&mmc_devices);
cur_dev_num = 0;
if (board_mmc_init(bis) < 0)
cpu_mmc_init(bis);
#if defined(DEBUG_S3C_HSMMC)
print_mmc_devices(',');
#endif
#ifdef CONFIG_CHECK_X210CV3
mmc = find_mmc_device(1);
#else
mmc = find_mmc_device(0);
#endif
if (mmc) {
err = mmc_init(mmc);
if (err)
err = mmc_init(mmc);
if (err) {
printf("Card init fail!\n");
return err;
}
}
printf("%ldMB\n", (mmc->capacity/(1024*1024/(1<<9))));
return 0;
}
2.10.2.3、cpu_mmc_init

int cpu_mmc_init(bd_t *bis)
{
#ifdef CONFIG_S3C_HSMMC
setup_hsmmc_clock();
setup_hsmmc_cfg_gpio();
return smdk_s3c_hsmmc_init();
#else
return 0;
#endif
}

void setup_hsmmc_clock(void)
{
u32 tmp;
u32 clock;
u32 i;
tmp = CLK_SRC4_REG & ~(0x0000000f);
CLK_SRC4_REG = tmp | 0x00000006;
tmp = CLK_DIV4_REG & ~(0x0000000f);
clock = get_MPLL_CLK()/1000000;
for(i=0; i<0xf; i++)
{
if((clock / (i+1)) <= 50) {
CLK_DIV4_REG = tmp | i<<0;
break;
}
}
