From fa43972fab24a3c050e880a7831f9378c6cebc0b Mon Sep 17 00:00:00 2001 From: Paul Mundt Date: Thu, 4 Sep 2008 18:53:58 +0900 Subject: sh: fixup many sparse errors. Signed-off-by: Paul Mundt --- arch/sh/kernel/setup.c | 1 + 1 file changed, 1 insertion(+) (limited to 'arch/sh/kernel/setup.c') diff --git a/arch/sh/kernel/setup.c b/arch/sh/kernel/setup.c index de832056bf1..6d0899e890d 100644 --- a/arch/sh/kernel/setup.c +++ b/arch/sh/kernel/setup.c @@ -26,6 +26,7 @@ #include #include #include +#include #include #include #include -- cgit v1.2.3 From 28d6e52cf7e881834d2dab370afa20b6223f726c Mon Sep 17 00:00:00 2001 From: Stuart Menefy Date: Fri, 5 Sep 2008 16:14:17 +0900 Subject: sh: Fix up broken 32-bit initrd support. Signed-off-by: Stuart Menefy Signed-off-by: Paul Mundt --- arch/sh/kernel/setup.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'arch/sh/kernel/setup.c') diff --git a/arch/sh/kernel/setup.c b/arch/sh/kernel/setup.c index 6d0899e890d..fc7171a9c80 100644 --- a/arch/sh/kernel/setup.c +++ b/arch/sh/kernel/setup.c @@ -249,17 +249,18 @@ void __init setup_bootmem_allocator(unsigned long free_pfn) ROOT_DEV = Root_RAM0; if (LOADER_TYPE && INITRD_START) { - if (INITRD_START + INITRD_SIZE <= (max_low_pfn << PAGE_SHIFT)) { - reserve_bootmem(INITRD_START + __MEMORY_START, - INITRD_SIZE, BOOTMEM_DEFAULT); - initrd_start = INITRD_START + PAGE_OFFSET + - __MEMORY_START; + unsigned long initrd_start_phys = INITRD_START + __MEMORY_START; + + if (initrd_start_phys + INITRD_SIZE <= PFN_PHYS(max_low_pfn)) { + reserve_bootmem(initrd_start_phys, INITRD_SIZE, + BOOTMEM_DEFAULT); + initrd_start = (unsigned long)__va(initrd_start_phys); initrd_end = initrd_start + INITRD_SIZE; } else { printk("initrd extends beyond end of memory " - "(0x%08lx > 0x%08lx)\ndisabling initrd\n", - INITRD_START + INITRD_SIZE, - max_low_pfn << PAGE_SHIFT); + "(0x%08lx > 0x%08lx)\ndisabling initrd\n", + initrd_start_phys + INITRD_SIZE, + PFN_PHYS(max_low_pfn)); initrd_start = 0; } } -- cgit v1.2.3 From f040ddaf4cfd28f25ea9d6a42d3c734d5c3f6798 Mon Sep 17 00:00:00 2001 From: Stuart Menefy Date: Fri, 5 Sep 2008 16:29:40 +0900 Subject: sh: Fix an unusual memory initialisation error. This fixes a problems with the set up of Linux memory: - When reserving memory at boot time, the code previously reserved the bottom page of memory, and then from one page up to the end of the bootmap. This had the desired effect, but was strictly speaking wrong, as the one page was actually whatever CONFIG_ZERO_PAGE_OFFSET had been set to. Signed-off-by: Stuart Menefy Signed-off-by: Paul Mundt --- arch/sh/kernel/setup.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'arch/sh/kernel/setup.c') diff --git a/arch/sh/kernel/setup.c b/arch/sh/kernel/setup.c index fc7171a9c80..fc098c8af05 100644 --- a/arch/sh/kernel/setup.c +++ b/arch/sh/kernel/setup.c @@ -233,15 +233,17 @@ void __init setup_bootmem_allocator(unsigned long free_pfn) * case of us accidentally initializing the bootmem allocator with * an invalid RAM area. */ - reserve_bootmem(__MEMORY_START+PAGE_SIZE, - (PFN_PHYS(free_pfn)+bootmap_size+PAGE_SIZE-1)-__MEMORY_START, - BOOTMEM_DEFAULT); + reserve_bootmem(__MEMORY_START + CONFIG_ZERO_PAGE_OFFSET, + (PFN_PHYS(free_pfn) + bootmap_size + PAGE_SIZE - 1) - + (__MEMORY_START + CONFIG_ZERO_PAGE_OFFSET), + BOOTMEM_DEFAULT); /* * reserve physical page 0 - it's a special BIOS page on many boxes, * enabling clean reboots, SMP operation, laptop functions. */ - reserve_bootmem(__MEMORY_START, PAGE_SIZE, BOOTMEM_DEFAULT); + reserve_bootmem(__MEMORY_START, CONFIG_ZERO_PAGE_OFFSET, + BOOTMEM_DEFAULT); sparse_memory_present_with_active_regions(0); -- cgit v1.2.3 From cf204fa797cf968de8043491cd469ad0321d0940 Mon Sep 17 00:00:00 2001 From: Paul Mundt Date: Mon, 8 Sep 2008 20:47:42 +0900 Subject: sh: Derive calibrate_delay lpj from clk fwk. All CPUs must have a sensible cpu_clk definition these days, which we can safely use for deriving the preset loops_per_jiffy. The only odd one out is SH-5, which hasn't been hammered in to the framework yet. Based on the ST patch. Signed-off-by: Francesco Virlinzi Signed-off-by: Carl Shaw Signed-off-by: Paul Mundt --- arch/sh/kernel/setup.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'arch/sh/kernel/setup.c') diff --git a/arch/sh/kernel/setup.c b/arch/sh/kernel/setup.c index fc098c8af05..267b344099c 100644 --- a/arch/sh/kernel/setup.c +++ b/arch/sh/kernel/setup.c @@ -27,6 +27,8 @@ #include #include #include +#include +#include #include #include #include @@ -180,6 +182,24 @@ static inline void __init reserve_crashkernel(void) {} #endif +#ifndef CONFIG_GENERIC_CALIBRATE_DELAY +void __cpuinit calibrate_delay(void) +{ + struct clk *clk = clk_get(NULL, "cpu_clk"); + + if (IS_ERR(clk)) + panic("Need a sane CPU clock definition!"); + + loops_per_jiffy = (clk_get_rate(clk) >> 1) / HZ; + + printk(KERN_INFO "Calibrating delay loop (skipped)... " + "%lu.%02lu BogoMIPS PRESET (lpj=%lu)\n", + loops_per_jiffy/(500000/HZ), + (loops_per_jiffy/(5000/HZ)) % 100, + loops_per_jiffy); +} +#endif + void __init __add_active_range(unsigned int nid, unsigned long start_pfn, unsigned long end_pfn) { -- cgit v1.2.3 From 9986b311efdc9727a5a48f03c3dac3d536fbaa74 Mon Sep 17 00:00:00 2001 From: Zhaolei Date: Fri, 17 Oct 2008 19:25:03 +0800 Subject: Fix debugfs_create_dir's error checking method for arch/sh/kernel/ debugfs_create_dir() returns NULL if an error occurs, returns -ENODEV when debugfs is not enabled in the kernel. Signed-off-by: Zhao Lei Signed-off-by: Paul Mundt --- arch/sh/kernel/setup.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'arch/sh/kernel/setup.c') diff --git a/arch/sh/kernel/setup.c b/arch/sh/kernel/setup.c index 267b344099c..836e80d5cb9 100644 --- a/arch/sh/kernel/setup.c +++ b/arch/sh/kernel/setup.c @@ -554,6 +554,8 @@ struct dentry *sh_debugfs_root; static int __init sh_debugfs_init(void) { sh_debugfs_root = debugfs_create_dir("sh", NULL); + if (!sh_debugfs_root) + return -ENOMEM; if (IS_ERR(sh_debugfs_root)) return PTR_ERR(sh_debugfs_root); -- cgit v1.2.3 From 9a19eb2a6607f2f6329efb3c4637fe23afae2cd7 Mon Sep 17 00:00:00 2001 From: Paul Mundt Date: Mon, 20 Oct 2008 11:37:58 +0900 Subject: sh: Fix up some merge damage. Signed-off-by: Paul Mundt --- arch/sh/kernel/setup.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'arch/sh/kernel/setup.c') diff --git a/arch/sh/kernel/setup.c b/arch/sh/kernel/setup.c index 836e80d5cb9..5767f0a84cd 100644 --- a/arch/sh/kernel/setup.c +++ b/arch/sh/kernel/setup.c @@ -282,7 +282,7 @@ void __init setup_bootmem_allocator(unsigned long free_pfn) printk("initrd extends beyond end of memory " "(0x%08lx > 0x%08lx)\ndisabling initrd\n", initrd_start_phys + INITRD_SIZE, - PFN_PHYS(max_low_pfn)); + (unsigned long)PFN_PHYS(max_low_pfn)); initrd_start = 0; } } -- cgit v1.2.3 From 4aeaa223433355a281559033f1e7600bfd73238e Mon Sep 17 00:00:00 2001 From: Magnus Damm Date: Thu, 9 Oct 2008 18:42:55 +0900 Subject: sh: add dynamic crash base address support Add support for dynamic crash kernel base address. Signed-off-by: Magnus Damm Signed-off-by: Paul Mundt --- arch/sh/kernel/setup.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'arch/sh/kernel/setup.c') diff --git a/arch/sh/kernel/setup.c b/arch/sh/kernel/setup.c index 5767f0a84cd..e7152cc6930 100644 --- a/arch/sh/kernel/setup.c +++ b/arch/sh/kernel/setup.c @@ -147,6 +147,7 @@ static void __init reserve_crashkernel(void) { unsigned long long free_mem; unsigned long long crash_size, crash_base; + void *vp; int ret; free_mem = ((unsigned long long)max_low_pfn - min_low_pfn) << PAGE_SHIFT; @@ -155,12 +156,14 @@ static void __init reserve_crashkernel(void) &crash_size, &crash_base); if (ret == 0 && crash_size) { if (crash_base <= 0) { - printk(KERN_INFO "crashkernel reservation failed - " - "you have to specify a base address\n"); - return; - } - - if (reserve_bootmem(crash_base, crash_size, + vp = alloc_bootmem_nopanic(crash_size); + if (!vp) { + printk(KERN_INFO "crashkernel allocation " + "failed\n"); + return; + } + crash_base = __pa(vp); + } else if (reserve_bootmem(crash_base, crash_size, BOOTMEM_EXCLUSIVE) < 0) { printk(KERN_INFO "crashkernel reservation failed - " "memory is in use\n"); -- cgit v1.2.3 From 2825999e8a9bd7ab7e25a7e7475c7cdd10371a13 Mon Sep 17 00:00:00 2001 From: Peter Griffin Date: Fri, 28 Nov 2008 22:48:20 +0900 Subject: sh: Add support for SH7201 CPU subtype. This patch adds support for the SH-2A FPU based SH7201 processor subtype. Signed-off-by: Peter Griffin Signed-off-by: Paul Mundt --- arch/sh/kernel/setup.c | 1 + 1 file changed, 1 insertion(+) (limited to 'arch/sh/kernel/setup.c') diff --git a/arch/sh/kernel/setup.c b/arch/sh/kernel/setup.c index e7152cc6930..53424750857 100644 --- a/arch/sh/kernel/setup.c +++ b/arch/sh/kernel/setup.c @@ -417,6 +417,7 @@ void __init setup_arch(char **cmdline_p) } static const char *cpu_name[] = { + [CPU_SH7201] = "SH7201", [CPU_SH7203] = "SH7203", [CPU_SH7263] = "SH7263", [CPU_SH7206] = "SH7206", [CPU_SH7619] = "SH7619", [CPU_SH7705] = "SH7705", [CPU_SH7706] = "SH7706", -- cgit v1.2.3