|
S3C2410A的MMU初始化只需要调用通用的arm920 MMU初始化函数:
static inline void arm920_setup(void) { unsigned long ttb = MMU_TABLE_BASE;
__asm__( /* Invalidate caches */ "mov r0, #0\n" "mcr p15, 0, r0, c7, c7, 0\n" /* invalidate I,D caches on v4 */ "mcr p15, 0, r0, c7, c10, 4\n" /* drain write buffer on v4 */ "mcr p15, 0, r0, c8, c7, 0\n" /* invalidate I,D TLBs on v4 */ /* Load page table pointer */ "mov r4, %0\n" "mcr p15, 0, r4, c2, c0, 0\n" /* load page table pointer */ /* Write domain id (cp15_r3) */ "mvn r0, #0\n" /* Domains 0, 1 = client */ "mcr p15, 0, r0, c3, c0, 0\n" /* load domain access register */ /* Set control register v4 */ "mrc p15, 0, r0, c1, c0, 0\n" /* get control register v4 */ /* Clear out 'unwanted' bits (then put them in if we need them) */ /* .RVI ..RS B... .CAM */ "bic r0, r0, #0x3000\n" /* ..11 .... .... .... */ "bic r0, r0, #0x0300\n" /* .... ..11 .... .... */ "bic r0, r0, #0x0087\n" /* .... .... 1... .111 */ /* Turn on what we want */ /* Fault checking enabled */ "orr r0, r0, #0x0002\n" /* .... .... .... ..1. */ #ifdef CONFIG_CPU_D_CACHE_ON "orr r0, r0, #0x0004\n" /* .... .... .... .1.. */ #endif #ifdef CONFIG_CPU_I_CACHE_ON "orr r0, r0, #0x1000\n" /* ...1 .... .... .... */ #endif /* MMU enabled */ "orr r0, r0, #0x0001\n" /* .... .... .... ...1 */ "mcr p15, 0, r0, c1, c0, 0\n" /* write control register */ : /* no outputs */ : "r" (ttb) ); } |
STEP4设置堆栈;STEP5进行mtd设备的初始化,记录MTD分区信息;STEP6设置私有数据;STEP7初始化内建命令。
STEP8启动一个SHELL,等待用户输出命令并进行相应处理。在SHELL退出的情况下,启动操作系统:
#define DEFAULT_BOOT_DELAY 0x30000000 void boot_or_vivi(void) { char c; int ret; ulong boot_delay;
boot_delay = get_param_value("boot_delay", &ret); if (ret) boot_delay = DEFAULT_BOOT_DELAY; /* If a value of boot_delay is zero, * unconditionally call vivi shell */ if (boot_delay == 0) vivi_shell();
/* * wait for a keystroke (or a button press if you want.) */ printk("Press Return to start the LINUX now, any other key for vivi\n"); c = awaitkey(boot_delay, NULL); if (((c != '\r') && (c != '\n') && (c != '\0'))) { printk("type \"help\" for help.\n"); vivi_shell(); } run_autoboot();
return; } |
|
|