[
  [
    "linux-2.6.23.orig/arch/sh/kernel/setup.c", 
    "linux-2.6.23/arch/sh/kernel/setup.c", 
    [
      "Index: linux-2.6.23/arch/sh/kernel/setup.c", 
      "===================================================================", 
      "--- linux-2.6.23.orig/arch/sh/kernel/setup.c", 
      "+++ linux-2.6.23/arch/sh/kernel/setup.c", 
      "@@ -95,13 +95,21 @@ EXPORT_SYMBOL(memory_start);", 
      "", 
      "unsigned long memory_end;", 
      "EXPORT_SYMBOL(memory_end);", 
      "+unsigned long ramtopaddress=0;", 
      "", 
      "static int __init early_parse_mem(char *p)", 
      "{", 
      "unsigned long size;", 
      "", 
      "#ifdef CONFIG_32BIT", 
      "+#ifndef CONFIG_CPU_SUBTYPE_STX7105", 
      "+  if ((ctrl_inl(MMUCR)&MMUCR_SE)==MMUCR_SE)", 
      "+#endif", 
      "memory_start = (unsigned long)PAGE_OFFSET;", 
      "+#ifndef CONFIG_CPU_SUBTYPE_STX7105", 
      "+  else", 
      "+\tmemory_start = (unsigned long)PAGE_OFFSET+__MEMORY_START;", 
      "+#endif", 
      "#else", 
      "memory_start = (unsigned long)PAGE_OFFSET+__MEMORY_START;", 
      "#endif", 
      "@@ -117,11 +125,44 @@ static int __init early_parse_mem(char *", 
      "return 0;", 
      "}", 
      "", 
      "-\tmemory_end = memory_start + size;", 
      "+\tmemory_end = memory_start + size*1024;", 
      "+", 
      "+\treturn 0;", 
      "+}", 
      "+early_param(\"systemmemsize\", early_parse_mem);", 
      "+", 
      "+unsigned long stapi_mem_size = CONFIG_VIP19XX_STAPI_MEMORY_SIZE;", 
      "", 
      "+static int __init early_parse_vidmem(char *p)", 
      "+{", 
      "+\tunsigned long size;", 
      "+\tsize = memparse(p, &p);", 
      "+", 
      "+#ifndef CONFIG_CPU_SUBTYPE_STX7105", 
      "+\tif (size > 0x8000) {", 
      "+               stapi_mem_size = CONFIG_VIP19XX_STAPI_MEMORY_SIZE_64MB;", 
      "+\t}", 
      "+#endif", 
      "+", 
      "+\treturn 0;", 
      "+}", 
      "+early_param(\"videomemsize\", early_parse_vidmem);", 
      "+", 
      "+static int __init early_parse_ramtopaddress(char *p)", 
      "+{", 
      "+\tif (sscanf(p,\"0x%lx\",&ramtopaddress) == 1)", 
      "+\t{", 
      "+\t\t// Convert the 29 bit cached address from firmware to an offset", 
      "+\t\tramtopaddress = (ramtopaddress & 0x1fffffff) - 0x04000000;", 
      "+\t\tramtopaddress = ramtopaddress + __MEMORY_START;", 
      "+\t}", 
      "+", 
      "return 0;", 
      "}", 
      "-early_param(\"mem\", early_parse_mem);", 
      "+", 
      "+early_param(\"ramtopaddress\", early_parse_ramtopaddress);", 
      "+unsigned long stapi_mem_start;", 
      "+unsigned long gfx_mem_size __attribute__ ((section (\".gfx_mem_size\"))) = CONFIG_VIP19XX_GFX_MEMORY_SIZE;", 
      "", 
      "/*", 
      "* Register fully available low RAM pages with the bootmem allocator.", 
      "@@ -150,6 +191,21 @@ static void __init register_bootmem_low_", 
      "void __init setup_bootmem_allocator(unsigned long free_pfn)", 
      "{", 
      "unsigned long bootmap_size;", 
      "+\tunsigned long config_zero_page_offset;", 
      "+\tunsigned long dsp_mem_size;", 
      "+", 
      "+#if defined(CONFIG_32BIT) && !defined(CONFIG_CPU_SUBTYPE_STX7105)", 
      "+\tif ((ctrl_inl(MMUCR)&MMUCR_SE)==MMUCR_SE) {", 
      "+\t\tconfig_zero_page_offset = (unsigned long)CONFIG_ZERO_PAGE_OFFSET;", 
      "+\t}", 
      "+\telse {", 
      "+\t\tconfig_zero_page_offset = (unsigned long)CONFIG_ZERO_PAGE_OFFSET-__MEMORY_START;", 
      "+\t}", 
      "+\tdsp_mem_size = CONFIG_ZERO_PAGE_OFFSET-0x04000000;", 
      "+#else", 
      "+\tconfig_zero_page_offset = (unsigned long)CONFIG_ZERO_PAGE_OFFSET;", 
      "+\tdsp_mem_size = CONFIG_ZERO_PAGE_OFFSET;", 
      "+#endif", 
      "", 
      "/*", 
      "* Find a proper area for the bootmem bitmap. After this", 
      "@@ -171,20 +227,40 @@ void __init setup_bootmem_allocator(unsi", 
      "* case of us accidentally initializing the bootmem allocator with", 
      "* an invalid RAM area.", 
      "*/", 
      "-\treserve_bootmem(__MEMORY_START + CONFIG_ZERO_PAGE_OFFSET,", 
      "+\treserve_bootmem(__MEMORY_START + config_zero_page_offset,", 
      "(PFN_PHYS(free_pfn) + bootmap_size + PAGE_SIZE - 1) -", 
      "-\t\t\t(__MEMORY_START + CONFIG_ZERO_PAGE_OFFSET));", 
      "+\t\t\t(__MEMORY_START + config_zero_page_offset));", 
      "", 
      "-\t/*", 
      "-\t * Reserve physical pages below CONFIG_ZERO_PAGE_OFFSET.", 
      "+\t/* Reserve mem for the ST DSP */", 
      "+\treserve_bootmem(__MEMORY_START, dsp_mem_size);", 
      "+#ifndef CONFIG_CPU_SUBTYPE_STX7105", 
      "+\t/* Reserve mem for STAPI usage and for the common_data_header", 
      "+\t * The common data header is 4096 bytes (PAGE_SIZE)", 
      "*/", 
      "-\tif (CONFIG_ZERO_PAGE_OFFSET != 0)", 
      "-\t\treserve_bootmem(__MEMORY_START, CONFIG_ZERO_PAGE_OFFSET);", 
      "-", 
      "+\tstapi_mem_size += gfx_mem_size;", 
      "+\tstapi_mem_start = ramtopaddress - stapi_mem_size - PAGE_SIZE;", 
      "+\treserve_bootmem(stapi_mem_start, stapi_mem_size + PAGE_SIZE);", 
      "+#else", 
      "+\tstapi_mem_size += gfx_mem_size;", 
      "+\tstapi_mem_start = __MEMORY_START + __MEMORY_SIZE - stapi_mem_size;", 
      "+\treserve_bootmem(__MEMORY_START + __MEMORY_SIZE - stapi_mem_size, stapi_mem_size);", 
      "+#endif", 
      "+\tprintk(KERN_NOTICE \"Reserve %lu KiB for STAVMEM (%lu KiB for graphics)\\n\",", 
      "+\t       stapi_mem_size / 1024, gfx_mem_size/1024);", 
      "sparse_memory_present_with_active_regions(0);", 
      "", 
      "#ifdef CONFIG_BLK_DEV_INITRD", 
      "-\tif (LOADER_TYPE && INITRD_START) {", 
      "+ \t/*", 
      "+ \t * Don't reserve any memory if the initrd is located", 
      "+ \t * in the video memory. Just point it out.", 
      "+ \t */", 
      "+ \tif (((INITRD_START+0x84000000 >= 0x90000000) &&", 
      "+ \t     (INITRD_START+0x84000000 < 0xA0000000)) ||", 
      "+ \t    (INITRD_START+0x84000000 >= 0xB0000000)) {", 
      "+\t\tinitrd_start = INITRD_START + 0x84000000;", 
      "+ \t        initrd_end = initrd_start + INITRD_SIZE;", 
      "+ \t}", 
      "+ \telse\tif (LOADER_TYPE && INITRD_START) {", 
      "/* INITRD_START is the offset from the start of RAM */", 
      "", 
      "unsigned long initrd_start_phys = INITRD_START;", 
      "@@ -261,11 +337,24 @@ void __init setup_arch(char **cmdline_p)", 
      "init_mm.brk = (unsigned long) _end;", 
      "", 
      "#ifdef CONFIG_32BIT", 
      "+#ifndef CONFIG_CPU_SUBTYPE_STX7105", 
      "+  if ((ctrl_inl(MMUCR)&MMUCR_SE)==MMUCR_SE)", 
      "+#endif", 
      "memory_start = (unsigned long)PAGE_OFFSET;", 
      "+#ifndef CONFIG_CPU_SUBTYPE_STX7105", 
      "+  else", 
      "+\tmemory_start = (unsigned long)PAGE_OFFSET+__MEMORY_START;", 
      "+#endif", 
      "#else", 
      "memory_start = (unsigned long)PAGE_OFFSET+__MEMORY_START;", 
      "#endif", 
      "-\tmemory_end = memory_start + __MEMORY_SIZE;", 
      "+\t// Default to 128MB of RAM if systemmemsize is not set by", 
      "+\t// firmware, 256MB for 7105.", 
      "+#ifndef CONFIG_CPU_SUBTYPE_STX7105", 
      "+\tmemory_end = memory_start + 0x08000000;", 
      "+#else", 
      "+       memory_end = memory_start + 0x10000000;", 
      "+#endif", 
      "", 
      "#ifdef CONFIG_CMDLINE_OVERWRITE", 
      "strlcpy(command_line, CONFIG_CMDLINE, sizeof(command_line));", 
      "@@ -280,9 +369,10 @@ void __init setup_arch(char **cmdline_p)", 
      "/* Save unparsed command line copy for /proc/cmdline */", 
      "memcpy(boot_command_line, command_line, COMMAND_LINE_SIZE);", 
      "*cmdline_p = command_line;", 
      "-", 
      "parse_early_param();", 
      "-", 
      "+\tif (ramtopaddress == 0) {", 
      "+\t\tramtopaddress = 0x08000000 + __MEMORY_START;", 
      "+\t}", 
      "request_standard_resources();", 
      "", 
      "sh_mv_setup();"
    ]
  ]
]