ts72xx: minimum fixes needed to boot From: Christian Gagneraud --- arch/arm/Kconfig | 1 + arch/arm/include/asm/memory.h | 2 ++ arch/arm/kernel/head.S | 3 +++ arch/arm/mach-ep93xx/Kconfig | 16 +++++++++++++++ arch/arm/mach-ep93xx/include/mach/memory.h | 30 ++++++++++++++++++++++++++++ arch/arm/mm/proc-arm920.S | 3 +++ kernel/printk.c | 7 +++++++ mm/Kconfig | 2 +- 8 files changed, 63 insertions(+), 1 deletions(-) diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index 1c4119c..0f1d52f 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -288,6 +288,7 @@ config ARCH_EP93XX select CPU_ARM920T select ARM_AMBA select ARM_VIC + select ARCH_SPARSEMEM_ENABLE select GENERIC_GPIO select HAVE_CLK select COMMON_CLKDEV diff --git a/arch/arm/include/asm/memory.h b/arch/arm/include/asm/memory.h index cefedf0..6be9d9b 100644 --- a/arch/arm/include/asm/memory.h +++ b/arch/arm/include/asm/memory.h @@ -125,8 +125,10 @@ * private definitions which should NOT be used outside memory.h * files. Use virt_to_phys/phys_to_virt/__pa/__va instead. */ +#ifndef __phys_to_virt #define __virt_to_phys(x) ((x) - PAGE_OFFSET + PHYS_OFFSET) #define __phys_to_virt(x) ((x) - PHYS_OFFSET + PAGE_OFFSET) +#endif /* * Convert a physical address to a Page Frame Number and back diff --git a/arch/arm/kernel/head.S b/arch/arm/kernel/head.S index 38ccbe1..c2e4514 100644 --- a/arch/arm/kernel/head.S +++ b/arch/arm/kernel/head.S @@ -82,6 +82,9 @@ ENTRY(stext) bl __lookup_processor_type @ r5=procinfo r9=cpuid movs r10, r5 @ invalid processor (r5=0)? beq __error_p @ yes, error 'p' +#ifdef CONFIG_MACH_TS72XX_FORCE_MACHINEID + ldr r1, =0x2a1 +#endif bl __lookup_machine_type @ r5=machinfo movs r8, r5 @ invalid machine (r5=0)? beq __error_a @ yes, error 'a' diff --git a/arch/arm/mach-ep93xx/Kconfig b/arch/arm/mach-ep93xx/Kconfig index 9167c3d..a909303 100644 --- a/arch/arm/mach-ep93xx/Kconfig +++ b/arch/arm/mach-ep93xx/Kconfig @@ -7,6 +7,15 @@ config CRUNCH help Enable kernel support for MaverickCrunch. +config CR1_NFBIT + bool "Turn on nF bit in ControlRegister 1" + help + Say 'Y' here to force the nF bit on. Usually this is set + by the bootrom. If it is not set, then the CPU core will + run from HCLK instead of FCLK, and performance will suffer. + If you see BogoMIPS of about 1/4 of your CPU clock, try + turning this on; your performance should double. + comment "EP93xx Platforms" choice @@ -182,6 +191,13 @@ config EP93XX_EARLY_UART3 endchoice +config MACH_TS72XX_FORCE_MACHINEID + bool "Force Machine ID" + depends on MACH_TS72XX + help + Say 'Y' here to force Machine ID to 0x2A1 (MACH_TYPE_TS72XX legacy value) + In early days Technologic Systems fixed the 0x163 value in redboot. + endmenu endif diff --git a/arch/arm/mach-ep93xx/include/mach/memory.h b/arch/arm/mach-ep93xx/include/mach/memory.h index 554064e..4cb3329 100644 --- a/arch/arm/mach-ep93xx/include/mach/memory.h +++ b/arch/arm/mach-ep93xx/include/mach/memory.h @@ -19,4 +19,34 @@ #error "Kconfig bug: No EP93xx PHYS_OFFSET set" #endif +#ifdef CONFIG_MACH_TS72XX +/* + * Non-linear mapping like so: + * phys => virt + * 0x00000000 => 0xc0000000 + * 0x01000000 => 0xc1000000 + * 0x04000000 => 0xc4000000 + * 0x05000000 => 0xc5000000 + * 0xe0000000 => 0xc8000000 + * 0xe1000000 => 0xc9000000 + * 0xe4000000 => 0xcc000000 + * 0xe5000000 => 0xcd000000 + * + * As suggested here: http://marc.info/?l=linux-arm&m=122754446724900&w=2 + * + * Note that static inline functions won't work here because + * arch/arm/include/asm/memory.h uses "#ifndef __virt_to_phys" to check whether to + * use generic functions or not. + */ +#define __phys_to_virt(p) \ + (((p) & 0x07ffffff) | (((p) & 0xe0000000) ? 0x08000000 : 0) | PAGE_OFFSET) + +#define __virt_to_phys(v) \ + (((v) & 0x07ffffff) | (((v) & 0x08000000) ? 0xe0000000 : 0 )) + +#define SECTION_SIZE_BITS 24 +#define MAX_PHYSMEM_BITS 32 + +#endif /* CONFIG_ARCH_TS72XX */ + #endif diff --git a/arch/arm/mm/proc-arm920.S b/arch/arm/mm/proc-arm920.S index 2b7c197..863a43d 100644 --- a/arch/arm/mm/proc-arm920.S +++ b/arch/arm/mm/proc-arm920.S @@ -373,6 +373,9 @@ __arm920_setup: mrc p15, 0, r0, c1, c0 @ get control register v4 bic r0, r0, r5 orr r0, r0, r6 +#ifdef CONFIG_CR1_NFBIT + orr r0, r0, #0x40000000 @ set nF +#endif mov pc, lr .size __arm920_setup, . - __arm920_setup diff --git a/kernel/printk.c b/kernel/printk.c index f38b07f..865c111 100644 --- a/kernel/printk.c +++ b/kernel/printk.c @@ -714,6 +714,12 @@ asmlinkage int vprintk(const char *fmt, va_list args) printed_len += vscnprintf(printk_buf + printed_len, sizeof(printk_buf) - printed_len, fmt, args); +#if 0 + /* Temporary debugging */ + extern void printascii(const char *); + printascii(printk_buf); + goto out_lockdepon; +#endif p = printk_buf; @@ -778,6 +784,7 @@ asmlinkage int vprintk(const char *fmt, va_list args) new_text_line = 1; } +out_lockdepon: /* * Try to acquire and then immediately release the * console semaphore. The release will do all the diff --git a/mm/Kconfig b/mm/Kconfig index 57963c6..f791196 100644 --- a/mm/Kconfig +++ b/mm/Kconfig @@ -67,7 +67,7 @@ config DISCONTIGMEM config SPARSEMEM def_bool y - depends on SPARSEMEM_MANUAL + depends on (!SELECT_MEMORY_MODEL && ARCH_SPARSEMEM_ENABLE) || SPARSEMEM_MANUAL config FLATMEM def_bool y