h.修改arch/arm/kernel/debug-armv.S文件,在适当的位置增加如下关于S3C2410的代码:
#elif defined(CONFIG_ARCH_S3C2410)
.macro addruart,rx mrc p15, 0, \rx, c1, c0 tst \rx, #1 @ MMU enabled ? moveq \rx, #0x50000000 @ physical base address movne \rx, #0xf0000000 @ virtual address .endm
.macro senduart,rd,rx str \rd, [\rx, #0x20] @ UTXH .endm
.macro waituart,rd,rx .endm
.macro busyuart,rd,rx 1001: ldr \rd, [\rx, #0x10] @ read UTRSTAT tst \rd, #1 << 2 @ TX_EMPTY ? beq 1001b .endm |
i.修改arch/arm/kernel/setup.c文件
此文件中的setup_arch非常关键,用来完成与体系结构相关的初始化:
void __init setup_arch(char **cmdline_p) { struct tag *tags = NULL; struct machine_desc *mdesc; char *from = default_command_line;
ROOT_DEV = MKDEV(0, 255);
setup_processor(); mdesc = setup_machine(machine_arch_type); machine_name = mdesc->name;
if (mdesc->soft_reboot) reboot_setup("s");
if (mdesc->param_offset) tags = phys_to_virt(mdesc->param_offset);
/* * Do the machine-specific fixups before we parse the * parameters or tags. */ if (mdesc->fixup) mdesc->fixup(mdesc, (struct param_struct *)tags, &from, &meminfo);
/* * If we have the old style parameters, convert them to * a tag list before. */ if (tags && tags->hdr.tag != ATAG_CORE) convert_to_tag_list((struct param_struct *)tags, meminfo.nr_banks == 0);
if (tags && tags->hdr.tag == ATAG_CORE) parse_tags(tags);
if (meminfo.nr_banks == 0) { meminfo.nr_banks = 1; meminfo.bank[0].start = PHYS_OFFSET; meminfo.bank[0].size = MEM_SIZE; }
|
|