Skip to content

Commit

Permalink
Merge branch '3.11-fixes' into mips-for-linux-next
Browse files Browse the repository at this point in the history
  • Loading branch information
Ralf Baechle committed Sep 5, 2013
2 parents 4d85419 + c2882b7 commit 356948f
Show file tree
Hide file tree
Showing 5 changed files with 61 additions and 56 deletions.
5 changes: 3 additions & 2 deletions arch/mips/dec/time.c
Original file line number Diff line number Diff line change
Expand Up @@ -126,12 +126,13 @@ int rtc_mips_set_mmss(unsigned long nowtime)
void __init plat_time_init(void)
{
u32 start, end;
int i = HZ / 10;
int i = HZ / 8;

/* Set up the rate of periodic DS1287 interrupts. */
ds1287_set_base_clock(HZ);

if (cpu_has_counter) {
ds1287_timer_state();
while (!ds1287_timer_state())
;

Expand All @@ -143,7 +144,7 @@ void __init plat_time_init(void)

end = read_c0_count();

mips_hpt_frequency = (end - start) * 10;
mips_hpt_frequency = (end - start) * 8;
printk(KERN_INFO "MIPS counter frequency %dHz\n",
mips_hpt_frequency);
} else if (IOASIC)
Expand Down
6 changes: 3 additions & 3 deletions arch/mips/kernel/csrc-ioasic.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ void __init dec_ioasic_clocksource_init(void)
{
unsigned int freq;
u32 start, end;
int i = HZ / 10;

int i = HZ / 8;

ds1287_timer_state();
while (!ds1287_timer_state())
;

Expand All @@ -55,7 +55,7 @@ void __init dec_ioasic_clocksource_init(void)

end = dec_ioasic_hpt_read(&clocksource_dec);

freq = (end - start) * 10;
freq = (end - start) * 8;
printk(KERN_INFO "I/O ASIC clock frequency %dHz\n", freq);

clocksource_dec.rating = 200 + freq / 10000000;
Expand Down
6 changes: 6 additions & 0 deletions arch/mips/kernel/relocate_kernel.S
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@ process_entry:
PTR_L s2, (s0)
PTR_ADD s0, s0, SZREG

/*
* In case of a kdump/crash kernel, the indirection page is not
* populated as the kernel is directly copied to a reserved location
*/
beqz s2, done

/* destination page */
and s3, s2, 0x1
beq s3, zero, 1f
Expand Down
99 changes: 48 additions & 51 deletions arch/mips/kernel/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -552,6 +552,52 @@ static void __init arch_mem_addpart(phys_t mem, phys_t end, int type)
add_memory_region(mem, size, type);
}

#ifdef CONFIG_KEXEC
static inline unsigned long long get_total_mem(void)
{
unsigned long long total;

total = max_pfn - min_low_pfn;
return total << PAGE_SHIFT;
}

static void __init mips_parse_crashkernel(void)
{
unsigned long long total_mem;
unsigned long long crash_size, crash_base;
int ret;

total_mem = get_total_mem();
ret = parse_crashkernel(boot_command_line, total_mem,
&crash_size, &crash_base);
if (ret != 0 || crash_size <= 0)
return;

crashk_res.start = crash_base;
crashk_res.end = crash_base + crash_size - 1;
}

static void __init request_crashkernel(struct resource *res)
{
int ret;

ret = request_resource(res, &crashk_res);
if (!ret)
pr_info("Reserving %ldMB of memory at %ldMB for crashkernel\n",
(unsigned long)((crashk_res.end -
crashk_res.start + 1) >> 20),
(unsigned long)(crashk_res.start >> 20));
}
#else /* !defined(CONFIG_KEXEC) */
static void __init mips_parse_crashkernel(void)
{
}

static void __init request_crashkernel(struct resource *res)
{
}
#endif /* !defined(CONFIG_KEXEC) */

static void __init arch_mem_init(char **cmdline_p)
{
extern void plat_mem_setup(void);
Expand Down Expand Up @@ -608,6 +654,8 @@ static void __init arch_mem_init(char **cmdline_p)
BOOTMEM_DEFAULT);
}
#endif

mips_parse_crashkernel();
#ifdef CONFIG_KEXEC
if (crashk_res.start != crashk_res.end)
reserve_bootmem(crashk_res.start,
Expand All @@ -620,52 +668,6 @@ static void __init arch_mem_init(char **cmdline_p)
paging_init();
}

#ifdef CONFIG_KEXEC
static inline unsigned long long get_total_mem(void)
{
unsigned long long total;

total = max_pfn - min_low_pfn;
return total << PAGE_SHIFT;
}

static void __init mips_parse_crashkernel(void)
{
unsigned long long total_mem;
unsigned long long crash_size, crash_base;
int ret;

total_mem = get_total_mem();
ret = parse_crashkernel(boot_command_line, total_mem,
&crash_size, &crash_base);
if (ret != 0 || crash_size <= 0)
return;

crashk_res.start = crash_base;
crashk_res.end = crash_base + crash_size - 1;
}

static void __init request_crashkernel(struct resource *res)
{
int ret;

ret = request_resource(res, &crashk_res);
if (!ret)
pr_info("Reserving %ldMB of memory at %ldMB for crashkernel\n",
(unsigned long)((crashk_res.end -
crashk_res.start + 1) >> 20),
(unsigned long)(crashk_res.start >> 20));
}
#else /* !defined(CONFIG_KEXEC) */
static void __init mips_parse_crashkernel(void)
{
}

static void __init request_crashkernel(struct resource *res)
{
}
#endif /* !defined(CONFIG_KEXEC) */

static void __init resource_init(void)
{
int i;
Expand All @@ -678,11 +680,6 @@ static void __init resource_init(void)
data_resource.start = __pa_symbol(&_etext);
data_resource.end = __pa_symbol(&_edata) - 1;

/*
* Request address space for all standard RAM.
*/
mips_parse_crashkernel();

for (i = 0; i < boot_mem_map.nr_map; i++) {
struct resource *res;
unsigned long start, end;
Expand Down
1 change: 1 addition & 0 deletions arch/mips/mm/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,7 @@ void copy_from_user_page(struct vm_area_struct *vma,
SetPageDcacheDirty(page);
}
}
EXPORT_SYMBOL_GPL(copy_from_user_page);

void __init fixrange_init(unsigned long start, unsigned long end,
pgd_t *pgd_base)
Expand Down

0 comments on commit 356948f

Please sign in to comment.