-
Xen 4.4-rc2
-
(XEN) Xen version 4.4-rc2 (uty@localdomain) (arm-unknown-linux-gnueabi-gcc (GCC) 4.6.3) debug=y Tue Dec 16 22:03:20 CST 2014
-
(XEN) Latest ChangeSet: Thu Feb 6 12:20:48 2014 +0100 git:fee6163-dirty
-
(XEN) Console output is synchronous.
-
(XEN) Processor: 410fc0f4: "ARM Limited", variant: 0x0, part 0xc0f, rev 0x4
-
(XEN) 32-bit Execution:
-
(XEN) Processor Features: 00001031:00011011
-
(XEN) Instruction Sets: AArch32 Thumb Thumb-2 ThumbEE Jazelle
-
(XEN) Extensions: GenericTimer Security
-
(XEN) Debug Features: 02010555
-
(XEN) Auxiliary Features: 00000000
-
(XEN) Memory Model Features: 10201105 20000000 01240000 02102211
-
(XEN) ISA Features: 02101110 13112111 21232041 11112131 10011142 00000000
-
(XEN) Platform: SAMSUNG EXYNOS5
-
(XEN) Set SYSRAM to 00000000bfe0004c (0020004c)
-
(XEN) Generic Timer IRQ: phys=30 hyp=26 virt=27
-
(XEN) uty: in exynos5_init_time() !!!!!!!!!!!
-
(XEN) Using generic timer at 24000 KHz
-
(XEN) GIC initialization:
-
(XEN) gic_dist_addr=0000000010481000
-
(XEN) gic_cpu_addr=0000000010482000
-
(XEN) gic_hyp_addr=0000000010484000
-
(XEN) gic_vcpu_addr=0000000010486000
-
(XEN) gic_maintenance_irq=25
-
(XEN) GIC: 160 lines, 2 cpus, secure (IID 0200043b).
-
(XEN) Using scheduler: SMP Credit Scheduler (credit)
-
(XEN) Allocated console ring of 16 KiB.
-
(XEN) VFP implementer 0x41 architecture 4 part 0x30 variant 0xf rev 0x0
-
(XEN) Bringing up CPU1
-
(XEN) CPU 1 booted.
-
(XEN) Brought up 2 CPUs
-
(XEN) *** LOADING DOMAIN 0 ***
-
(XEN) Populate P2M 0x80000000->0xa0000000 (1:1 mapping for dom0)
-
(XEN) uty: early_info.modules.nr_mods 2, MOD_KERNEL 2
-
(XEN) Loading kernel from boot module 2
-
(XEN) Loading zImage from 0000000060000000 to 0000000087c00000-0000000087fb9640
-
(XEN) Loading dom0 DTB to 0x0000000088000000-0x0000000088008428
-
(XEN) Scrubbing Free RAM: ...............done.
-
(XEN) Initial low memory virq threshold set at 0x4000 pages.
-
(XEN) Std. Loglevel: All
-
(XEN) Guest Loglevel: All
-
(XEN) **********************************************
-
(XEN) ******* WARNING: CONSOLE OUTPUT IS SYNCHRONOUS
-
(XEN) ******* This option is intended to aid debugging of Xen by ensuring
-
(XEN) ******* that all output is synchronously delivered on the serial line.
-
(XEN) ******* However it can introduce SIGNIFICANT latencies and affect
-
(XEN) ******* timekeeping. It is NOT recommended for production use!
-
(XEN) **********************************************
-
(XEN) 3... 2... 1...
-
(XEN) *** Serial input -> DOM0 (type 'CTRL-a' three times to switch input to Xen)
-
(XEN) Freed 264kB init memory.
-
(XEN) DOM0: Uncompressing Linux... done, booting the kernel.
-
(XEN) DOM0: <6>Initializing cgroup subsys cpu
-
(XEN) DOM0: <5>Linux version 3.0.31-g3370a7c-dirty (uty@localhost.localdomain) (gcc version 4.6.x-google 20120106 (prerelease) (GCC) ) #30
-
(XEN) DOM0: SMP PREEMPT Tue Dec 30 01:29:24 CST 2014
-
(XEN) DOM0: CPU: ARMv7 Processor [410fc0f4] revision 4 (ARMv7), cr=10c5387d
-
(XEN) DOM0: CPU: VIPT nonaliasing data cache, VIPT aliasing instruction cache
-
(XEN) DOM0: <6>Machine: ARNDALE, model: Insignal Arndale evaluation board based on EXYNOS5250
-
(XEN) DOM0: uty: arm_add_memory start 0x80000000 size 0x20000000
-
(XEN) DOM0: <6>debug: ignoring loglevel setting.
-
(XEN) DOM0: Memory policy: ECC disabled, Data cache writealloc
-
(XEN) DOM0: uty: build_mem_type_table end
-
(XEN) DOM0: uty: build_mem_type_table end
-
(XEN) DOM0: uty: prepare_page_table end
-
(XEN) DOM0: uty: prepare_page_table end
-
(XEN) DOM0: uty: map_lowmem end
-
(XEN) DOM0: uty: map_lowmem end
-
(XEN) DOM0: uty:in devicemaps_init
-
(XEN) DOM0: uty:in devicemaps_init 2
-
(XEN) DOM0: uty: early_alloc for vectors_page OK
-
(XEN) DOM0: uty: test for early_printk
-
(XEN) DOM0: CPU EXYNOS5250 (id 0x43520010)
-
(XEN) DOM0: <4>BUG: not creating mapping for 0x00000000 at 0x00000000 in user region
-
(XEN) DOM0: <7>exynos5_init_clocks: initializing clocks
-
(XEN) DOM0: <6>S3C24XX Clocks, Copyright 2004 Simtec Electronics
-
(XEN) DOM0: <3>s3c_register_clksrc: clock audiocdclk has no registers set
-
(XEN) DOM0: <3>audiocdclk: no parent clock specified
-
(XEN) DOM0: <7>exynos5_setup_clocks: registering clocks
-
(XEN) DOM0: <7>exynos5_setup_clocks: xtal is 24000000
-
(XEN) DOM0: <6>EXYNOS5: PLL settings, A=1000000000, B=800000000, C=333000000
-
(XEN) DOM0: M=1600000000, E=96000000, V=300000000, G=533000000
-
(XEN) DOM0: <6>EXYNOS5: ARMCLK=1000000000, CDREX=800000000, ACLK400=24000000
-
(XEN) DOM0: ACLK333=333000000, ACLK266=266666666, ACLK200=200000000
-
(XEN) DOM0: ACLK166=166500000, ACLK66=66666666
-
(XEN) DOM0: <6>uclk1: source is mout_mpll_user (6), rate is 100000000
-
(XEN) DOM0: <6>uclk1: source is mout_mpll_user (6), rate is 100000000
-
(XEN) DOM0: <6>uclk1: source is mout_mpll_user (6), rate is 100000000
-
(XEN) DOM0: <6>uclk1: source is mout_mpll_user (6), rate is 100000000
-
(XEN) DOM0: <6>sclk_usbdrd30: source is mout_mpll (0), rate is 66666666
-
(XEN) DOM0: <6>sclk_fimd: source is mout_mpll_user (6), rate is 800000000
-
(XEN) DOM0: <6>aclk_266_gscl: source is aclk_266 (1), rate is 266666666
-
(XEN) DOM0: <6>sclk_g3d: source is mout_mpll_user (0), rate is 800000000
-
(XEN) DOM0: <6>sclk_sata: source is mout_mpll_user (0), rate is 66666666
-
(XEN) DOM0: <6>sclk_gscl_wrap0: source is ext_xtal (0), rate is 24000000
-
(XEN) DOM0: <6>sclk_gscl_wrap1: source is ext_xtal (0), rate is 24000000
-
(XEN) DOM0: <6>sclk_cam0: source is ext_xtal (0), rate is 24000000
-
(XEN) DOM0: <6>sclk_cam1: source is ext_xtal (0), rate is 24000000
-
(XEN) DOM0: uty: mdesc->map_io OK
-
(XEN) DOM0: uty: mdesc->map_io OK
-
(XEN) DOM0: uty: devicemaps_init end
-
(XEN) DOM0: uty: devicemaps_init end
-
(XEN) DOM0: uty: kmap_init end
-
(XEN) DOM0: uty: kmap_init end
-
(XEN) DOM0: <2>kernel BUG at mm/bootmem.c:353!
昨晚跑到这了,确实是early_printk的问题。感觉原因是这样,虽然mdesc->map_io里面最终又重新map了UART,但在map_io里面初始化了串口,这就比较复杂了,因为xen虚拟的串口只是最简单的2个寄存器,如果复杂了,访问其它的串口寄存器应该就会出错了,而后面的代码会用printk。没有在xen里打印出信息来看,不过感觉应该是这样了。
开始只是把初始化串口的代码注释掉了,并且把arndale_map_io之前的early_printk也都注释了,为得是在UART没有map好前不碰它。现在想想devicemaps_init()注释里说的一切调试方法都不能用了,是指的early_printk、printk的。
-
1285 static void __init arndale_map_io(void)
-
1286 {
-
1287 clk_xxti.rate = 24000000;
-
1288 s5p_init_io(NULL, 0, S5P_VA_CHIPID);
-
1289 s3c24xx_init_clocks(24000000);
-
1290 // uty:test
-
1291
-
1292 //s3c24xx_init_uarts(arndale_uartcfgs, ARRAY_SIZE(arndale_uartcfgs));
-
1293 exynos_reserve_mem();
-
1294 }
但这时候还是不行。比较郁闷,既跑不出来又不能看哪出错了。现在想想有个地方很奇怪,在s3c24xx_init_clocks()函数里就调用printk了,可这是在初始化串口之前。估计是系统有套机制,当串口驱动还没有跑起来之前,printk都先用简单的方式。没有跟着看这个。可能是跟earlyconsole什么的有关,驱动没起来前是用的early console?不懂。
为了看输出,只有最先初始化UART的内存映射了,所以把arch/arm/mach-exynos/cpu-exynos5.c里exynos5_iodesc中UART的部分注释掉,然后提前映射了UART的IO
-
921 static void __init devicemaps_init(struct machine_desc *mdesc)
-
922 {
-
923 struct map_desc map;
-
924 unsigned long addr;
-
925
-
926 early_printk("uty:in devicemaps_init\n");
-
927 early_printk("uty:in devicemaps_init 2\n");
-
928 /*
-
929 * Allocate the vector page early.
-
930 */
-
931 vectors_page = early_alloc(PAGE_SIZE);
-
932 early_printk("uty: early_alloc for vectors_page OK\n");
-
933
-
934 for (addr = VMALLOC_END; addr; addr += PGDIR_SIZE) {
-
935 //early_printk("uty: addr=0x%x\n", (unsigned int)addr);
-
936 //early_printk("uty: pmd=0x%x\n", (unsigned int)pmd_off_k(addr));
-
937 pmd_clear(pmd_off_k(addr));
-
938 }
-
939
-
940 //early_printk("uty: clear VMALLOC_END above pmd\n");
-
941
-
942 // uty: test
-
943 map.pfn = __phys_to_pfn(S3C_PA_UART);
-
944 map.virtual = (unsigned long)S3C_VA_UART;
-
945 map.length = SZ_512K;
-
946 map.type = MT_DEVICE;
-
947 create_mapping(&map);
-
948
-
949 early_printk("uty: test for early_printk\n");
运气真好,跑过去了,就是最上面的log的样子。但奇怪的是为什么一开始注释了map_io之前的early_printk怎么不行。难道是exynos5_iodesc里面的io地址都没有初始化?如果是这样,那就是因为CPU的id得到的不对?但是后面输出有(XEN) DOM0: CPU EXYNOS5250 (id 0x43520010)这句啊。
在arch/arm/plat-samsung/init.c里,cpu->map_io()是映射exynos5_iodesc里的IO地址,包括UART的。在这之前确实有句printk,但为什么这个kernel之前直接在板子上跑的时候没问题呢?
难道是prink有什么缓存机制?确实bootmem现在还有问题,而printk也用到里bootmem。但如果是因为bootmem这里的问题,那现在printk应该也不正常啊。
-
46 void __init s3c_init_cpu(unsigned long idcode,
-
47 struct cpu_table *cputab, unsigned int cputab_size)
-
48 {
-
49 cpu = s3c_lookup_cpu(idcode, cputab, cputab_size);
-
50
-
51 if (cpu == NULL) {
-
52 printk(KERN_ERR "Unknown CPU type 0x%08lx\n", idcode);
-
53 panic("Unknown S3C24XX CPU");
-
54 }
-
55
-
56 printk("CPU %s (id 0x%08lx)\n", cpu->name, idcode);
-
57
-
58 if (cpu->map_io == NULL || cpu->init == NULL) {
-
59 printk(KERN_ERR "CPU %s support not enabled\n", cpu->name);
-
60 panic("Unsupported Samsung CPU");
-
61 }
-
62
-
63 cpu->map_io();
-
64 }
现在这样感觉是提前map里UART,连printk什么的都能用里,所以说很幸运。
在start_kernel()里很早就有
487 printk(KERN_NOTICE "%s", linux_banner);
这时候printk就可以用了。 这部分还没有搞清楚,还得看。
说下IO空间的初始化,platform和cpu的部分是分开的。
arch/arm/mm/mmu.c里
devicemaps_init()里调用mdesc->map_io()
对应的map_io()是arndale_map_io(),实现在arch/arm/mach-exynos/mach-arndale.c里
arndale_map_io()里又调用s5p_init_io()
s5p_init_io()实现在arch/arm/plat-s5p/cpu.c 看名字是个板级的。在里面,首先iotable_init(exynos5_iodesc)映射了一批IO
-
110 /* minimal IO mapping */
-
111
-
112 static struct map_desc s5p_iodesc[] __initdata = {
-
113 {
-
114 .virtual = (unsigned long)S5P_VA_CHIPID,
-
115 .pfn = __phys_to_pfn(S5P_PA_CHIPID),
-
116 .length = SZ_4K,
-
117 .type = MT_DEVICE,
-
118 }, {
-
119 .virtual = (unsigned long)S3C_VA_SYS,
-
120 .pfn = __phys_to_pfn(S5P_PA_SYSCON),
-
121 .length = SZ_64K,
-
122 .type = MT_DEVICE,
-
123 }, {
-
124 .virtual = (unsigned long)S3C_VA_TIMER,
-
125 .pfn = __phys_to_pfn(S5P_PA_TIMER),
-
126 .length = SZ_16K,
-
127 .type = MT_DEVICE,
-
128 }, {
-
129 .virtual = (unsigned long)S3C_VA_WATCHDOG,
-
130 .pfn = __phys_to_pfn(S3C_PA_WDT),
-
131 .length = SZ_4K,
-
132 .type = MT_DEVICE,
-
133 }, {
-
134 .virtual = (unsigned long)S5P_VA_SROMC,
-
135 .pfn = __phys_to_pfn(S5P_PA_SROMC),
-
136 .length = SZ_4K,
-
137 .type = MT_DEVICE,
-
138 }, {
-
139 .virtual = (unsigned long)S3C_VA_HSPHY,
-
140 .pfn = __phys_to_pfn(S5P_PA_HSPHY),
-
141 .length = SZ_4K,
-
142 .type = MT_DEVICE,
-
143 },
-
144 };
这些不是exynos5 cpu上的设备吗,不懂,貌似TIMER WATCHDOG这些不是吧,以后得每个都拿出来好好看看。
然后再调用s3c_init_cpu(),里面得到cpu id,找到对应的cpu类型后再调用cpu->map_io()。
cpu的map_io就是arch/arm/mach-exynos/cpu-exynos5.c里的exynos5_map_io()。看起来还是挺好理解的,先调用arndale_map_io,然后里面再调用exynos5_map_io,先板子,后芯片。
exynos5_map_io()里iotable_init(exynos5_iodesc)。这里面的就是芯片相关的了,并且IO特别多,UART也在里面。
也是先s5p_iodesc后exynos5_iodesc。
阅读(474) | 评论(0) | 转发(0) |