Lemote Loongson 2E patch update
Subsystems (2)
PATCH 1/1 define MODULE_PROC_FAMILY for Loongson2
In reply to [email protected]From: Fuxin Zhang <[email protected]>
--- arch/mips/mm/c-r4k.c | 57 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 57 insertions(+), 0 deletions(-)
arch/mips/mm/c-r4k.c +57 -0
@@ -335,6 +335,10 @@ static void r4k_flush_cache_all(void)static inline void local_r4k___flush_cache_all (void * args) { +#if defined(CONFIG_CPU_LOONGSON2 ) +r4k_blast_scache (); +return ; +#endif r4k_blast_dcache ();r4k_blast_icache ();
@@ -848,6 +852,26 @@ static void __init probe_pcache(void) c->options |=MIPS_CPU_PREFETCH ;break ; +case CPU_LOONGSON2 : + icache_size =1 << (12 + ((config &CONF_IC ) >>9 )); + c->icache.linesz =16 << ((config &CONF_IB ) >>5 ); +if (prid &0x3 ) { + c->icache.ways =4 ; + }else { + c->icache.ways =2 ; + } + c->icache.waybit=0 ; + + dcache_size =1 << (12 + ((config &CONF_DC ) >>6 )); + c->dcache.linesz =16 << ((config &CONF_DB ) >>4 ); +if (prid &0x3 ) { + c->dcache.ways =4 ; + }else { + c->dcache.ways =2 ; + } + c->dcache.waybit =0 ; +break ; +default :if (!(config &MIPS_CONF_M ))panic ("Don't know how to probe P-caches on this cpu." );
@@ -963,6 +987,14 @@ static void __init probe_pcache(void)break ; } +#ifdef CONFIG_CPU_LOONGSON2 +/* +* LOONGSON2 has 4 way icache, but when using indexed cache op, +* one op will act on all 4 ways +*/ + c->icache.ways =1 ; +#endif + printk("Primary instruction cache %ldkB, %s, %s, linesize %d bytes.\n", icache_size >> 10, cpu_has_vtag_icache ? "virtually tagged" : "physically tagged",
@@ -1036,6 +1068,25 @@ static int __init probe_scache(void)return 1 ; } +#if defined(CONFIG_CPU_LOONGSON2 ) +static void __init loongson2_sc_init (void ) +{ +struct cpuinfo_mips *c = ¤t_cpu_data; + + scache_size =512 *1024 ; + c->scache.linesz =32 ; + c->scache.ways =4 ; + c->scache.waybit =0 ; + c->scache.waysize = scache_size / (c->scache.ways); + c->scache.sets = scache_size /(c->scache.linesz * c->scache.ways); +printk ("Unified secondary cache %ldkB %s, linesize %d bytes.\n" , + scache_size >>10 , way_string[c->scache.ways], c->scache.linesz); + + c->options |=MIPS_CPU_INCLUSIVE_CACHES ; +return ; +} +#endif +extern int r5k_sc_init (void );extern int rm7k_sc_init (void );extern int mips_sc_init (void );
@@ -1085,6 +1136,12 @@ static void __init setup_scache(void)#endif return ; +#if defined(CONFIG_CPU_LOONGSON2 ) +case CPU_LOONGSON2 : +loongson2_sc_init (); +return ; +#endif +default : if (c->isa_level == MIPS_CPU_ISA_M32R1 || c->isa_level == MIPS_CPU_ISA_M32R2 ||
Signature · 1 line
1.5.2.1
PATCH 1/1 add MACH_GROUP_LEMOTE & MACH_LEMOTE_FULONG
In reply to [email protected]From: Fuxin Zhang <[email protected]>
--- include/asm-mips/bootinfo.h | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-)
include/asm-mips/bootinfo.h +6 -0
@@ -213,6 +213,12 @@#define MACH_GROUP_NEC_EMMA2RH 25/* NEC EMMA2RH (was 23) */ #define MACH_NEC_MARKEINS 0/* NEC EMMA2RH Mark-eins */ +/* +* Valid machtype for group LEMOTE +*/ +#define MACH_GROUP_LEMOTE 27 +#define MACH_LEMOTE_FULONG 0 +#define CL_SIZE COMMAND_LINE_SIZEconst char *get_system_type (void );
Signature · 1 line
1.5.2.1
PATCH 1/1 work around for more than 256MB memory support
In reply to [email protected]From: Fuxin Zhang <[email protected]>
--- drivers/char/mem.c | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-)
drivers/char/mem.c +4 -0
@@ -82,8 +82,12 @@ static inline int uncached_access(struct file *file, unsigned long addr)*/ if (file->f_flags &O_SYNC )return 1 ; +#if defined(CONFIG_LEMOTE_FULONG ) && defined(CONFIG_64BIT ) +return (addr >=__pa (high_memory)) || ((addr >=0x10000000 ) && (addr <0x20000000 )); +#else return addr >=__pa (high_memory);#endif +#endif }#ifndef ARCH_HAS_VALID_PHYS_ADDR_RANGE
Signature · 1 line
1.5.2.1
PATCH 1/1 TO_PHYS_MASK for loongson2
In reply to [email protected]From: Fuxin Zhang <[email protected]>
--- include/asm-mips/addrspace.h | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
include/asm-mips/addrspace.h +1 -1
@@ -144,7 +144,7 @@#define TO_PHYS_MASK _CONST64_(0x000000ffffffffff)/* 2^^40 - 1 */ #endif -#if defined (CONFIG_CPU_R10000 ) +#if defined (CONFIG_CPU_R10000 ) || defined (CONFIG_CPU_LOONGSON2 )#define TO_PHYS_MASK _CONST64_(0x000000ffffffffff)/* 2^^40 - 1 */ #endif
Signature · 1 line
1.5.2.1
PATCH 1/1 Kconfig update for lemote fulong miniPC
In reply to [email protected]From: Sun Haiyong <[email protected]>
--- arch/mips/Kconfig | 36 ++++++++++++++++++++++++++++++++++++ 1 files changed, 36 insertions(+), 0 deletions(-)
arch/mips/Kconfig +36 -0
@@ -14,6 +14,25 @@ config ZONE_DMA choice prompt "System type" default SGI_IP22 +config LEMOTE_FULONG + bool "Support for Lemote's fulong mini-PC" + select SYS_HAS_CPU_LOONGSON2 + select DMA_NONCOHERENT + select BOOT_ELF32 + select BOARD_SCACHE + select HW_HAS_PCI + select I8259 + select ISA + select IRQ_CPU + select SYS_SUPPORTS_32BIT_KERNEL + select SYS_SUPPORTS_64BIT_KERNEL + select SYS_SUPPORTS_LITTLE_ENDIAN + select SYS_SUPPORTS_HIGHMEM + select SYS_HAS_EARLY_PRINTK + select GENERIC_HARDIRQS_NO__DO_IRQ + select CPU_HAS_WB + help + Lemote Fulong mini-PC board, which uses Chinese Loongson-2E CPU and a fpga north bridge config MACH_ALCHEMY bool "Alchemy processor based machines"
@@ -944,6 +963,13 @@ choice prompt "CPU type" default CPU_R4X00 +config CPU_LOONGSON2 + bool "LOONGSON2" + depends on SYS_HAS_CPU_LOONGSON2 + select CPU_SUPPORTS_32BIT_KERNEL + select CPU_SUPPORTS_64BIT_KERNEL + select CPU_SUPPORTS_HIGHMEM + config CPU_MIPS32_R1 bool "MIPS32 Release 1" depends on SYS_HAS_CPU_MIPS32_R1
@@ -1154,6 +1180,9 @@ config CPU_SB1 endchoice +config SYS_HAS_CPU_LOONGSON2 + bool + config SYS_HAS_CPU_MIPS32_R1 bool
@@ -1487,6 +1516,13 @@ config CPU_HAS_SMARTMIPS config CPU_HAS_WB bool +config 64BIT_CONTEXT + bool "Save 64bit integer registers" if CPU_LOONGSON2 && 32BIT + help + Loongson2 CPU is 64bit , when used in 32BIT mode, its integer registers + can still be accessed as 64bit, mainly for multimedia instructions. We must have + all 64bit save/restored to make sure those instructions to get correct result. + # # Vectored interrupt mode is an R2 feature #
Signature · 1 line
1.5.2.1
PATCH 1/1 define MODULE_PROC_FAMILY for Loongson2
In reply to [email protected]From: Fuxin Zhang <[email protected]>
--- include/asm-mips/module.h | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-)
include/asm-mips/module.h +2 -0
@@ -112,6 +112,8 @@ search_module_dbetables(unsigned long addr)#define MODULE_PROC_FAMILY "RM9000 "#elif definedCONFIG_CPU_SB1 #define MODULE_PROC_FAMILY "SB1 " +#elif definedCONFIG_CPU_LOONGSON2 +#define MODULE_PROC_FAMILY "LOONGSON2 "#else #error MODULE_PROC_FAMILY undefined for your processor configuration#endif
Signature · 1 line
1.5.2.1
PATCH 1/1 cheat for support of more than 256MB memory
In reply to [email protected]From: Fuxin Zhang <[email protected]>
--- arch/mips/kernel/setup.c | 8 ++++++++ 1 files changed, 8 insertions(+), 0 deletions(-)
arch/mips/kernel/setup.c +8 -0
@@ -509,6 +509,14 @@ static void __init resource_init(void) res->end = end; res->flags =IORESOURCE_MEM |IORESOURCE_BUSY ; +#if defined(CONFIG_LEMOTE_FULONG ) && defined(CONFIG_64BIT ) +/* to keep memory continous, we tell system 0x10000000 - 0x20000000 is reserved +* for memory, in fact it is io region, don't occupy it +* +* SPARSEMEM? +*/ + if (boot_mem_map.map[i].type != BOOT_MEM_RESERVED) +#endif request_resource (&iomem_resource, res);/*
Signature · 1 line
1.5.2.1
PATCH 1/1 add Loongson processor definitions
In reply to [email protected]From: Fuxin Zhang <[email protected]>
--- include/asm-mips/cpu.h | 7 ++++++- 1 files changed, 6 insertions(+), 1 deletions(-)
include/asm-mips/cpu.h +6 -1
@@ -89,6 +89,8 @@#define PRID_IMP_34K 0x9500#define PRID_IMP_24KE 0x9600#define PRID_IMP_74K 0x9700 +#define PRID_IMP_LOONGSON1 0x4200 +#define PRID_IMP_LOONGSON2 0x6300/* * These are the PRID's for when 23:16 == PRID_COMP_SIBYTE
@@ -200,7 +202,10 @@#define CPU_SB1A 62#define CPU_74K 63#define CPU_R14000 64 -#define CPU_LAST 64 +#define CPU_LOONGSON1 65 +#define CPU_LOONGSON2 66 + +#define CPU_LAST 66/* * ISA Level encodings
Signature · 1 line
1.5.2.1
loongson 2e patch updated for 2.6.22-rc4
arch/mips/Kconfig | 37 ++ arch/mips/Makefile | 8 arch/mips/kernel/Makefile | 1 arch/mips/kernel/cpu-probe.c | 9 arch/mips/kernel/proc.c | 2 arch/mips/kernel/setup.c | 9 arch/mips/lemote/lm2e/Makefile | 7 arch/mips/lemote/lm2e/bonito-irq.c | 74 +++++ arch/mips/lemote/lm2e/dbg_io.c | 146 ++++++++++ arch/mips/lemote/lm2e/irq.c | 146 ++++++++++ arch/mips/lemote/lm2e/pci.c | 72 +++++ arch/mips/lemote/lm2e/prom.c | 109 +++++++ arch/mips/lemote/lm2e/reset.c | 49 +++ arch/mips/lemote/lm2e/setup.c | 144 ++++++++++ arch/mips/lib-32/Makefile | 1 arch/mips/lib-64/Makefile | 1 arch/mips/mm/Makefile | 1 arch/mips/mm/c-r4k.c | 58 ++++ arch/mips/mm/tlb-r4k.c | 23 + arch/mips/mm/tlbex.c | 9 arch/mips/pci/Makefile | 2 arch/mips/pci/fixup-lm2e.c | 255 ++++++++++++++++++ arch/mips/pci/ops-lm2e.c | 153 ++++++++++ drivers/char/mem.c | 5 include/asm-mips/addrspace.h | 3 include/asm-mips/bootinfo.h | 7 include/asm-mips/cacheops.h | 5 include/asm-mips/cpu.h | 8 include/asm-mips/mach-lemote/bonito.h | 381 +++++++++++++++++++++++++++ include/asm-mips/mach-lemote/dma-coherence.h | 43 +++ include/asm-mips/mach-lemote/mc146818rtc.h | 37 ++ include/asm-mips/module.h | 3 include/asm-mips/serial.h | 10 33 files changed, 1796 insertions(+), 22 deletions(-)
PATCH 1/1 arch related Makefile update for lemote fulong mini-PC
From: Fuxin Zhang <[email protected]>
--- arch/mips/Makefile | 8 ++++++++ arch/mips/kernel/Makefile | 1 + arch/mips/lib-32/Makefile | 1 + arch/mips/lib-64/Makefile | 1 + arch/mips/mm/Makefile | 1 + arch/mips/pci/Makefile | 1 + 6 files changed, 13 insertions(+), 0 deletions(-)
arch/mips/Makefile +8 -0
@@ -118,6 +118,7 @@ cflags-$(CONFIG_CPU_R4300) += -march=r4300 -Wa,--trap cflags-$(CONFIG_CPU_VR41XX) += -march=r4100 -Wa,--trap cflags-$(CONFIG_CPU_R4X00) += -march=r4600 -Wa,--trap cflags-$(CONFIG_CPU_TX49XX) += -march=r4600 -Wa,--trap +cflags-$(CONFIG_CPU_LOONGSON2) += -march=r4600 -Wa,--trap cflags-$(CONFIG_CPU_MIPS32_R1) += $(call cc-option,-march=mips32,-mips32 -U_MIPS_ISA -D_MIPS_ISA=_MIPS_ISA_MIPS32) \ -Wa,-mips32 -Wa,--trap cflags-$(CONFIG_CPU_MIPS32_R2) += $(call cc-option,-march=mips32r2,-mips32r2 -U_MIPS_ISA -D_MIPS_ISA=_MIPS_ISA_MIPS32) \
@@ -298,6 +299,13 @@ cflags-$(CONFIG_WR_PPMC) += -Iinclude/asm-mips/mach-wrppmc load-$(CONFIG_WR_PPMC) += 0xffffffff80100000 # +# lemote fulong mini-PC board +# +core-$(CONFIG_LEMOTE_FULONG) +=arch/mips/lemote/lm2e/ +load-$(CONFIG_LEMOTE_FULONG) +=0xffffffff80100000 +cflags-$(CONFIG_LEMOTE_FULONG) += -Iinclude/asm-mips/mach-lemote + +# # For all MIPS, Inc. eval boards # core-$(CONFIG_MIPS_BOARDS_GEN) += arch/mips/mips-boards/generic/
arch/mips/kernel/Makefile +1 -0
@@ -31,6 +31,7 @@ obj-$(CONFIG_CPU_R10000) += r4k_fpu.o r4k_switch.o obj-$(CONFIG_CPU_SB1) += r4k_fpu.o r4k_switch.o obj-$(CONFIG_CPU_MIPS32) += r4k_fpu.o r4k_switch.o obj-$(CONFIG_CPU_MIPS64) += r4k_fpu.o r4k_switch.o +obj-$(CONFIG_CPU_LOONGSON2) += r4k_fpu.o r4k_switch.o obj-$(CONFIG_CPU_R6000) += r6000_fpu.o r4k_switch.o obj-$(CONFIG_SMP) += smp.o
arch/mips/lib-32/Makefile +1 -0
@@ -21,3 +21,4 @@ obj-$(CONFIG_CPU_SB1) += dump_tlb.o obj-$(CONFIG_CPU_TX39XX) += r3k_dump_tlb.o obj-$(CONFIG_CPU_TX49XX) += dump_tlb.o obj-$(CONFIG_CPU_VR41XX) += dump_tlb.o +obj-$(CONFIG_CPU_LOONGSON2) += dump_tlb.o
arch/mips/lib-64/Makefile +1 -0
@@ -21,3 +21,4 @@ obj-$(CONFIG_CPU_SB1) += dump_tlb.o obj-$(CONFIG_CPU_TX39XX) += r3k_dump_tlb.o obj-$(CONFIG_CPU_TX49XX) += dump_tlb.o obj-$(CONFIG_CPU_VR41XX) += dump_tlb.o +obj-$(CONFIG_CPU_LOONGSON2) += dump_tlb.o
arch/mips/mm/Makefile +1 -0
@@ -21,6 +21,7 @@ obj-$(CONFIG_CPU_R5432) += c-r4k.o cex-gen.o pg-r4k.o tlb-r4k.o obj-$(CONFIG_CPU_R8000) += c-r4k.o cex-gen.o pg-r4k.o tlb-r8k.o obj-$(CONFIG_CPU_RM7000) += c-r4k.o cex-gen.o pg-r4k.o tlb-r4k.o obj-$(CONFIG_CPU_RM9000) += c-r4k.o cex-gen.o pg-r4k.o tlb-r4k.o +obj-$(CONFIG_CPU_LOONGSON2) += c-r4k.o cex-gen.o pg-r4k.o tlb-r4k.o obj-$(CONFIG_CPU_SB1) += c-sb1.o cerr-sb1.o cex-sb1.o pg-sb1.o \ tlb-r4k.o obj-$(CONFIG_CPU_TX39XX) += c-tx39.o pg-r4k.o tlb-r3k.o
arch/mips/pci/Makefile +1 -0
@@ -50,3 +50,4 @@ obj-$(CONFIG_TOSHIBA_RBTX4938) += fixup-tx4938.o ops-tx4938.o obj-$(CONFIG_VICTOR_MPC30X) += fixup-mpc30x.o obj-$(CONFIG_ZAO_CAPCELLA) += fixup-capcella.o obj-$(CONFIG_WR_PPMC) += fixup-wrppmc.o +obj-$(CONFIG_LEMOTE_FULONG) += fixup-lm2e.o ops-lm2e.o
Signature · 1 line
1.5.2.1
PATCH 1/1 define Hit_Invalidate_I to Index_Invalidate_I for loongson2
In reply to [email protected]From: Fuxin Zhang <[email protected]>
--- include/asm-mips/cacheops.h | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-)
include/asm-mips/cacheops.h +4 -0
@@ -20,7 +20,11 @@#define Index_Load_Tag_D 0x05#define Index_Store_Tag_I 0x08#define Index_Store_Tag_D 0x09 +#if defined(CONFIG_CPU_LOONGSON2 ) +#define Hit_Invalidate_I 0x00 +#else #define Hit_Invalidate_I 0x10 +#endif #define Hit_Invalidate_D 0x11#define Hit_Writeback_Inv_D 0x15
Signature · 1 line
1.5.2.1
PATCH 1/1 add serial port definition for lemote fulong
In reply to [email protected]From: Songmao Tian <[email protected]>
--- include/asm-mips/serial.h | 9 ++++++++- 1 files changed, 8 insertions(+), 1 deletions(-)
include/asm-mips/serial.h +8 -1
@@ -164,6 +164,12 @@#define IP32_SERIAL_PORT_DEFNS #endif /* CONFIG_SGI_IP32 */ +#if defined(CONFIG_LEMOTE_FULONG ) +#define LEMOTE_FULONG_SERIAL_PORT_DEFNS \ +/* UART CLK PORT IRQ FLAGS */ \ + { 0, BASE_BAUD, 0x3F8, 4, STD_COM_FLAGS },/* ttyS0 */ +#endif +#define SERIAL_PORT_DFNS \ DDB5477_SERIAL_PORT_DEFNS \ EV64120_SERIAL_PORT_DEFNS \
@@ -172,6 +178,7 @@STD_SERIAL_PORT_DEFNS \ MOMENCO_OCELOT_C_SERIAL_PORT_DEFNS \ MOMENCO_OCELOT_SERIAL_PORT_DEFNS \ - MOMENCO_OCELOT_3_SERIAL_PORT_DEFNS + MOMENCO_OCELOT_3_SERIAL_PORT_DEFNS \ + LEMOTE_FULONG_SERIAL_PORT_DEFNS#endif /* _ASM_SERIAL_H */
Signature · 1 line
1.5.2.1
PATCH 1/1 tlb handling support for Loongson2 processor
In reply to [email protected]From: Fuxin Zhang <[email protected]>
--- arch/mips/mm/tlb-r4k.c | 23 ++++++++++++++++++++++- arch/mips/mm/tlbex.c | 8 +++++--- 2 files changed, 27 insertions(+), 4 deletions(-)
arch/mips/mm/tlb-r4k.c +22 -1
@@ -48,6 +48,22 @@ extern void build_tlb_refill_handler(void);#endif /* CONFIG_MIPS_MT_SMTC */ +#if defined(CONFIG_CPU_LOONGSON2 ) +/* +* LOONGSON2 has a 4 entry itlb which is a subset of dtlb, +* unfortrunately, itlb is not totally transparent to software. +*/ +#define FLUSH_ITLB write_c0_diag(4); + +#define FLUSH_ITLB_VM (vma) { if ((vma)->vm_flags & VM_EXEC) write_c0_diag(4); } + +#else + +#define FLUSH_ITLB +#define FLUSH_ITLB_VM (vma) + +#endif +void local_flush_tlb_all (void ) {unsigned long flags;
@@ -73,6 +89,7 @@ void local_flush_tlb_all(void) }tlbw_use_hazard ();write_c0_entryhi (old_ctx); +FLUSH_ITLB ;EXIT_CRITICAL (flags); }
@@ -136,6 +153,7 @@ void local_flush_tlb_range(struct vm_area_struct *vma, unsigned long start, }else {drop_mmu_context (mm, cpu); } +FLUSH_ITLB ;EXIT_CRITICAL (flags); } }
@@ -178,6 +196,7 @@ void local_flush_tlb_kernel_range(unsigned long start, unsigned long end) }else {local_flush_tlb_all (); } +FLUSH_ITLB ;EXIT_CRITICAL (flags); }
@@ -210,6 +229,7 @@ void local_flush_tlb_page(struct vm_area_struct *vma, unsigned long page) finish:write_c0_entryhi (oldpid); +FLUSH_ITLB_VM (vma);EXIT_CRITICAL (flags); } }
@@ -241,7 +261,7 @@ void local_flush_tlb_one(unsigned long page)tlbw_use_hazard (); }write_c0_entryhi (oldpid); - +FLUSH_ITLB ;EXIT_CRITICAL (flags); }
@@ -293,6 +313,7 @@ void __update_tlb(struct vm_area_struct * vma, unsigned long address, pte_t pte)else tlb_write_indexed ();tlbw_use_hazard (); +FLUSH_ITLB_VM (vma);EXIT_CRITICAL (flags); }
arch/mips/mm/tlbex.c +5 -3
@@ -893,6 +893,7 @@ static __init void build_tlb_write_entry(u32 **p, struct label **l,case CPU_4KSC :case CPU_20KC :case CPU_25KF : +case CPU_LOONGSON2 :tlbw (p);break ;
@@ -1276,7 +1277,8 @@ static void __init build_r4000_tlb_refill_handler(void)* need three, with the second nop'ed and the third being * unused. */ -#ifdef CONFIG_32BIT +/* Loongson2 ebase is different than r4k, we have more space */ +#if defined(CONFIG_32BIT ) || defined(CONFIG_CPU_LOONGSON2 )if ((p - tlb_handler) >64 )panic ("TLB refill handler space exceeded" );#else
@@ -1289,7 +1291,7 @@ static void __init build_r4000_tlb_refill_handler(void)/* * Now fold the handler in the TLB refill handler space. */ -#ifdef CONFIG_32BIT +#if defined(CONFIG_32BIT ) || defined(CONFIG_CPU_LOONGSON2 ) f = final_handler;/* Simplest case, just copy the handler. */ copy_handler (relocs, labels, tlb_handler, p, f);
@@ -1336,7 +1338,7 @@ static void __init build_r4000_tlb_refill_handler(void) final_len); f = final_handler; -#ifdef CONFIG_64BIT +#if defined(CONFIG_64BIT ) && !defined(CONFIG_CPU_LOONGSON2 )if (final_len >32 ) final_len =64 ;else
Signature · 1 line
1.5.2.1
PATCH 1/1 new files for lemote fulong mini-PC support
In reply to [email protected]From: Songmao Tian <[email protected]>
--- arch/mips/lemote/lm2e/Makefile | 7 + arch/mips/lemote/lm2e/bonito-irq.c | 74 +++++ arch/mips/lemote/lm2e/dbg_io.c | 146 ++++++++++ arch/mips/lemote/lm2e/irq.c | 146 ++++++++++ arch/mips/lemote/lm2e/pci.c | 72 +++++ arch/mips/lemote/lm2e/prom.c | 109 ++++++++ arch/mips/lemote/lm2e/reset.c | 49 ++++ arch/mips/lemote/lm2e/setup.c | 144 ++++++++++ arch/mips/pci/fixup-lm2e.c | 255 +++++++++++++++++ arch/mips/pci/ops-lm2e.c | 153 +++++++++++ include/asm-mips/mach-lemote/bonito.h | 381 ++++++++++++++++++++++++++ include/asm-mips/mach-lemote/dma-coherence.h | 43 +++ include/asm-mips/mach-lemote/mc146818rtc.h | 36 +++ 13 files changed, 1615 insertions(+), 0 deletions(-) create mode 100644 arch/mips/lemote/lm2e/Makefile create mode 100644 arch/mips/lemote/lm2e/bonito-irq.c create mode 100644 arch/mips/lemote/lm2e/dbg_io.c create mode 100644 arch/mips/lemote/lm2e/irq.c create mode 100644 arch/mips/lemote/lm2e/pci.c create mode 100644 arch/mips/lemote/lm2e/prom.c create mode 100644 arch/mips/lemote/lm2e/reset.c create mode 100644 arch/mips/lemote/lm2e/setup.c create mode 100644 arch/mips/pci/fixup-lm2e.c create mode 100644 arch/mips/pci/ops-lm2e.c create mode 100644 include/asm-mips/mach-lemote/bonito.h create mode 100644 include/asm-mips/mach-lemote/dma-coherence.h create mode 100644 include/asm-mips/mach-lemote/mc146818rtc.h
arch/mips/lemote/lm2e/Makefile new file +7 -0
@@ -0,0 +1,7 @@ +# +# Makefile for Lemote Fulong mini-PC board. +# + +obj-y += setup.o prom.o reset.o irq.o pci.o bonito-irq.o dbg_io.o +EXTRA_AFLAGS := $(CFLAGS) +
arch/mips/lemote/lm2e/bonito-irq.c new file +74 -0
74 lines not on this page · raw message
arch/mips/lemote/lm2e/dbg_io.c new file +146 -0
146 lines not on this page · raw message
arch/mips/lemote/lm2e/irq.c new file +146 -0
146 lines not on this page · raw message
arch/mips/lemote/lm2e/pci.c new file +72 -0
72 lines not on this page · raw message
arch/mips/lemote/lm2e/prom.c new file +109 -0
109 lines not on this page · raw message
arch/mips/lemote/lm2e/reset.c new file +49 -0
49 lines not on this page · raw message
arch/mips/lemote/lm2e/setup.c new file +144 -0
144 lines not on this page · raw message
arch/mips/pci/fixup-lm2e.c new file +255 -0
255 lines not on this page · raw message
arch/mips/pci/ops-lm2e.c new file +153 -0
153 lines not on this page · raw message
include/asm-mips/mach-lemote/bonito.h new file +381 -0
381 lines not on this page · raw message
include/asm-mips/mach-lemote/dma-coherence.h new file +43 -0
43 lines not on this page · raw message
include/asm-mips/mach-lemote/mc146818rtc.h new file +36 -0
@@ -0,0 +1,36 @@ +/* +* This file is subject to the terms and conditions of the GNU General Public +* License. See the file "COPYING" in the main directory of this archive +* for more details. +* +* Copyright (C) 1998, 2001, 03 by Ralf Baechle +* +* RTC routines for PC style attached Dallas chip. +*/ +#ifndef __ASM_MACH_GENERIC_MC146818RTC_H +#define __ASM_MACH_GENERIC_MC146818RTC_H + +#include <asm/io.h> + +#define RTC_PORT (x) (0x70 + (x)) +#define RTC_IRQ 8 + +static inline unsigned char CMOS_READ (unsigned long addr) +{ +outb_p (addr,RTC_PORT (0 )); +return inb_p (RTC_PORT (1 )); +} + +static inline void CMOS_WRITE (unsigned char data,unsigned long addr) +{ +outb_p (addr,RTC_PORT (0 )); +outb_p (data,RTC_PORT (1 )); +} + +#define RTC_ALWAYS_BCD 0 + +#ifndef mc146818_decode_year +#define mc146818_decode_year (year) ((year) < 70 ? (year) + 2000 : (year) + 1970) +#endif + +#endif /* __ASM_MACH_GENERIC_MC146818RTC_H */
Signature · 1 line
1.5.2.1
PATCH 1/1 make cpu_probe recognize Loongson2
In reply to [email protected]From: Fuxin Zhang <[email protected]>
--- arch/mips/kernel/cpu-probe.c | 8 ++++++++ 1 files changed, 8 insertions(+), 0 deletions(-)
arch/mips/kernel/cpu-probe.c +8 -0
@@ -464,6 +464,14 @@ static inline void cpu_probe_legacy(struct cpuinfo_mips *c)MIPS_CPU_LLSC ; c->tlbsize =64 ;break ; +case PRID_IMP_LOONGSON2 : + c->cputype =CPU_LOONGSON2 ; + c->isa_level =MIPS_CPU_ISA_III ; + c->options =R4K_OPTS | +MIPS_CPU_FPU |MIPS_CPU_LLSC | +MIPS_CPU_32FPR ; + c->tlbsize =64 ; +break ; } }
Signature · 1 line
1.5.2.1
PATCH 1/1 add Loongson support to /proc/cpuinfo
In reply to [email protected]From: Fuxin Zhang <[email protected]>
--- arch/mips/kernel/proc.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)
arch/mips/kernel/proc.c +1 -0
@@ -84,6 +84,7 @@ static const char *cpu_name[] = { [CPU_VR4181A] = "NEC VR4181A", [CPU_SR71000] = "Sandcraft SR71000", [CPU_PR4450] = "Philips PR4450", + [CPU_LOONGSON2] = "ICT Loongson-2", };
Signature · 1 line
1.5.2.1
Re: [PATCH] cheat for support of more than 256MB memory
In reply to [email protected]Hi,
Quoted 12 lines · On 6/6/07, [email protected] <[email protected]> wrote:
From: Fuxin Zhang <[email protected]>
Signed-off-by Fuxin Zhang <[email protected]>--- arch/mips/kernel/setup.c | 8 ++++++++ 1 files changed, 8 insertions(+), 0 deletions(-)arch/mips/kernel/setup.c +0
-0
arch/mips/kernel/setup.c static void __init resource_init(void) · line 516
Quoted 8 lines
arch/mips/kernel/setup.c +5
-0@@ -509,6 +509,14 @@ static void __init resource_init(void) res->end = end; res->flags =IORESOURCE_MEM |IORESOURCE_BUSY ; +#if defined(CONFIG_LEMOTE_FULONG ) && defined(CONFIG_64BIT ) +/* to keep memory continous, we tell system 0x10000000 - 0x20000000 is reserved +* for memory, in fact it is io region, don't occupy it +* +* SPARSEMEM?
Definetly yes ! It has been designed for such issue and it should save you some memory.
Signature · 1 line
Franck
No comment on the patches, but...
Any chance I'm ever going to be able to buy one of these in the USA?
John
Signature · 2 lines
John W. Linville [email protected]
Re: [PATCH] cheat for support of more than 256MB memory
In reply to Franck Bui-HuuQuoted 7 lines · Franck Bui-Huu
Quoted 7 lines
arch/mips/kernel/setup.c +0
-0@@ -509,6 +509,14 @@ static void __init resource_init(void) res->end = end;
Quoted 10 lines
arch/mips/kernel/setup.c static void __init resource_init(void) · line 516
Quoted 7 lines
arch/mips/kernel/setup.c +2
-0res->flags =IORESOURCE_MEM |IORESOURCE_BUSY ; +#if defined(CONFIG_LEMOTE_FULONG ) && defined(CONFIG_64BIT ) +/* to keep memory continous, we tell system 0x10000000 -
0x20000000is reservedarch/mips/kernel/setup.c +3
-0+* for memory, in fact it is io region, don't occupy it +* +* SPARSEMEM? Definetly yes ! It has been designed for such issue and it should save you some memory.
A hole of 256MB size in the memory address map will cost 3.5MB with a 64-bit kernel. The other reason why I don't like this patch is that it drags platform specific code into the generic MIPS code.
Ralf
Quoted 1 line · John W. Linville
Any chance I'm ever going to be able to buy one of these in the USA?
I haven't heared of a distributor for these boxes outside of China yet. As I understand the few Lemots that are out in the wild are still not from mass production. But I guess Fuxin may answer that better than I can.
Ralf
Quoted 5 lines · Ralf Baechle
Quoted 2 lines · John W. Linville
Any chance I'm ever going to be able to buy one of these in the USA?
Strictly speaking we cannot sell to USA yet, because we did not get some required certifications for USA and Europe market(e.g. FCC, RoHS). But we can provide a sample if the customer can understand the status.
Quoted 6 lines
I haven't heared of a distributor for these boxes outside of China yet. As I understand the few Lemots that are out in the wild are still not from mass production. But I guess Fuxin may answer that better than I can.
Lemote has sold out around 1000 sets of Fulong, most users are in China. We don't have a distributor ourside of China yet, due to the lack of certifications and experience of oversea business. I think we will probably get some such distributors within this year, along with the upgraded versions of Fulong.
Quoted 6 lines
Ralf
Signature · 13 lines
------------------------------------------------ 张福新 江苏中科龙梦科技有限公司 地址:江苏省常熟市虞山镇梦兰工业园 General Manager JiangSu Lemote Corp. Ltd. MengLan, Yushan, Changshu, JiangSu Province, China ZIP: 215500 Tel: 86-512-52308679 Fax: 86-512-52308688 Email: [email protected] http://www.lemote.com ------------------------------------------------
Re: [PATCH] cheat for support of more than 256MB memory
In reply to Ralf BaechleQuoted 22 lines · Ralf Baechle
Quoted 7 lines · Franck Bui-Huu
Quoted 7 lines
arch/mips/kernel/setup.c +0
-0@@ -509,6 +509,14 @@ static void __init resource_init(void) res->end = end;Quoted 11 lines
arch/mips/kernel/setup.c
Quoted 8 lines
arch/mips/kernel/setup.c +2
-0res->flags =IORESOURCE_MEM |IORESOURCE_BUSY ; +#if defined(CONFIG_LEMOTE_FULONG ) && defined(CONFIG_64BIT ) +/* to keep memory continous, we tell system 0x10000000 -
0x20000000is reservedarch/mips/kernel/setup.c +3
-0+* for memory, in fact it is io region, don't occupy it +* +* SPARSEMEM? Definetly yes ! It has been designed for such issue and it should save you some memory.
Quoted 8 lines
A hole of 256MB size in the memory address map will cost 3.5MB with a 64-bit kernel. The other reason why I don't like this patch is that it drags platform specific code into the generic MIPS code.
Ralf
we use 16k page,so it's cheaper than that:)
Before I work out sparse memory solution, I think I can drop this patch and make some trivial fix of the first patch.
Subject: [PATCH] simply ignore the memory hole
---arch/mips/lemote/lm2e/setup.c | 1 -
1 files changed, 0 insertions(+), 1 deletions(-)
arch/mips/lemote/lm2e/setup.c +0 -0
@@ -112,7 +112,6 @@ void __init plat_mem_setup(void)add_memory_region (0x0 , (memsize <<20 ),BOOT_MEM_RAM );
#ifdef CONFIG_64BIT
if (highmemsize > 0) {
- add_memory_region(0x10000000, 0x10000000, BOOT_MEM_RESERVED);
add_memory_region(0x20000000, highmemsize << 20, BOOT_MEM_RAM);
}#endif
Re: [PATCH] cheat for support of more than 256MB memory
Quoted 51 lines · Tian
Quoted 23 lines · Ralf Baechle
Quoted 7 lines · Franck Bui-Huu
Quoted 7 lines
arch/mips/kernel/setup.c +0
-0@@ -509,6 +509,14 @@ static void __init resource_init(void) res->end = end;Quoted 12 lines
arch/mips/kernel/setup.c
Quoted 9 lines
arch/mips/kernel/setup.c +2
-0res->flags =IORESOURCE_MEM |IORESOURCE_BUSY ; +#if defined(CONFIG_LEMOTE_FULONG ) && defined(CONFIG_64BIT ) +/* to keep memory continous, we tell system
0x10000000-0x20000000is reserved
+ * for memory, in fact it is io region, don't
occupy itarch/mips/kernel/setup.c +2
-0+* +* SPARSEMEM? Definetly yes ! It has been designed for such issue and it should save you some memory.
Quoted 8 lines
A hole of 256MB size in the memory address map will cost 3.5MB with a 64-bit kernel. The other reason why I don't like this patch is that it drags platform specific code into the generic MIPS code.
Ralf
we use 16k page,so it's cheaper than that:)
Before I work out sparse memory solution, I think I can drop this patch and make some trivial fix of the first patch.
Subject: [PATCH] simply ignore the memory hole
Signed-off-by Songmao Tian <[email protected]>---
arch/mips/lemote/lm2e/setup.c| 1 -1 files changed, 0 insertions(+), 1 deletions(-)arch/mips/lemote/lm2e/setup.c +0
-0
arch/mips/lemote/lm2e/setup.c void __init plat_mem_setup(void) · line 117
Quoted 7 lines
arch/mips/lemote/lm2e/setup.c +0
-1@@ -112,7 +112,6 @@ void __init plat_mem_setup(void)add_memory_region (0x0 , (memsize <<20 ),BOOT_MEM_RAM );#ifdef CONFIG_64BIT if (highmemsize >0 ) { -add_memory_region (0x10000000 ,0x10000000 ,BOOT_MEM_RESERVED );add_memory_region (0x20000000 , highmemsize <<20 ,BOOT_MEM_RAM ); }#endif
It seems it's no need to modify code, just config to use sparse memory will be ok, paging_init can handle the non-flat-memory situatioins, and i notify the pages drop down as expected.
Subject: [PATCH] use SPARSEMEM to deal with the memory hole of peripheral IO
---arch/mips/Kconfig | 1 +arch/mips/configs/fulong_defconfig | 13 +++++++------
2 files changed, 8 insertions(+), 6 deletions(-)
arch/mips/Kconfig +1 -0
@@ -957,6 +957,7 @@ config CPU_LOONGSON2 depends on SYS_HAS_CPU_LOONGSON2 select CPU_SUPPORTS_32BIT_KERNEL select CPU_SUPPORTS_64BIT_KERNEL + select ARCH_SPARSEMEM_ENABLE select CPU_SUPPORTS_HIGHMEM
config CPU_MIPS32_R1
arch/mips/configs/fulong_defconfig +0 -0
@@ -1,7 +1,7 @@
#
# Automatically generated make config: don't edit
# Linux kernel version: 2.6.22-rc3
-# Wed Jun 6 11:42:13 2007
+# Fri Jun 8 15:09:24 2007
#CONFIG_MIPS=y
@@ -118,13 +118,14 @@ CONFIG_GENERIC_IRQ_PROBE=yCONFIG_CPU_SUPPORTS_HIGHMEM=yCONFIG_SYS_SUPPORTS_HIGHMEM=yCONFIG_ARCH_FLATMEM_ENABLE=y
+CONFIG_ARCH_SPARSEMEM_ENABLE=yCONFIG_SELECT_MEMORY_MODEL=y
-CONFIG_FLATMEM_MANUAL=y
+# CONFIG_FLATMEM_MANUAL is not set
# CONFIG_DISCONTIGMEM_MANUAL is not set
-# CONFIG_SPARSEMEM_MANUAL is not set
-CONFIG_FLATMEM=y
-CONFIG_FLAT_NODE_MEM_MAP=y
-# CONFIG_SPARSEMEM_STATIC is not set
+CONFIG_SPARSEMEM_MANUAL=y
+CONFIG_SPARSEMEM=y
+CONFIG_HAVE_MEMORY_PRESENT=y
+CONFIG_SPARSEMEM_STATIC=yCONFIG_SPLIT_PTLOCK_CPUS=4CONFIG_RESOURCES_64BIT=yCONFIG_ZONE_DMA_FLAG=0
Re: [PATCH] cheat for support of more than 256MB memory
Quoted 54 lines · Tian
Quoted 53 lines · Tian
Quoted 23 lines · Ralf Baechle
Quoted 7 lines · Franck Bui-Huu
Quoted 7 lines
arch/mips/kernel/setup.c +0
-0@@ -509,6 +509,14 @@ static void __init resource_init(void) res->end = end;Quoted 12 lines
arch/mips/kernel/setup.c
Quoted 9 lines
arch/mips/kernel/setup.c +2
-0res->flags =IORESOURCE_MEM |IORESOURCE_BUSY ; +#if defined(CONFIG_LEMOTE_FULONG ) && defined(CONFIG_64BIT ) +/* to keep memory continous, we tell system
0x10000000-0x20000000is reserved
+ * for memory, in fact it is io region, don't
occupy itarch/mips/kernel/setup.c +2
-0+* +* SPARSEMEM? Definetly yes ! It has been designed for such issue and it should save you some memory.
Quoted 8 lines
A hole of 256MB size in the memory address map will cost 3.5MB with a 64-bit kernel. The other reason why I don't like this patch is that it drags platform specific code into the generic MIPS code.
Ralf
we use 16k page,so it's cheaper than that:)
Before I work out sparse memory solution, I think I can drop this patch and make some trivial fix of the first patch.
Subject: [PATCH] simply ignore the memory hole
Signed-off-by Songmao Tian <[email protected]>---
arch/mips/lemote/lm2e/setup.c| 1 -1 files changed, 0 insertions(+), 1 deletions(-)arch/mips/lemote/lm2e/setup.c +0
-1@@ -112,7 +112,6 @@ void __init plat_mem_setup(void)add_memory_region (0x0 , (memsize <<20 ),BOOT_MEM_RAM );#ifdef CONFIG_64BIT if (highmemsize >0 ) { -add_memory_region (0x10000000 ,0x10000000 ,BOOT_MEM_RESERVED );add_memory_region (0x20000000 , highmemsize <<20 ,BOOT_MEM_RAM );
Quoted 8 lines
arch/mips/lemote/lm2e/setup.c void __init plat_mem_setup(void) · line 117
Quoted 5 lines
arch/mips/lemote/lm2e/setup.c +0
-0}#endif It seems it's no need to modify code, just config to use sparse memory will be ok,
paging_initcan handle the non-flat-memory situatioins, and i notify the pages drop down as expected.
Well, I mean notice...forgive me, I don't speak english often:)
Quoted 57 lines
Subject: [PATCH] use SPARSEMEM to deal with the memory hole of peripheral IO
Signed-off-by Songmao Tian <[email protected]>---
arch/mips/Kconfig| 1 +arch/mips/configs/fulong_defconfig| 13 +++++++------2 files changed, 8 insertions(+), 6 deletions(-)arch/mips/Kconfig +1
-0@@ -957,6 +957,7 @@ config CPU_LOONGSON2 depends on SYS_HAS_CPU_LOONGSON2 select CPU_SUPPORTS_32BIT_KERNEL select CPU_SUPPORTS_64BIT_KERNEL + select ARCH_SPARSEMEM_ENABLE select CPU_SUPPORTS_HIGHMEMconfig
CPU_MIPS32_R1arch/mips/configs/fulong_defconfig +1
-1@@ -1,7 +1,7 @@ # # Automatically generated make config: don't edit # Linux kernel version: 2.6.22-rc3 -# Wed Jun 6 11:42:13 2007 +# Fri Jun 8 15:09:24 2007 #
CONFIG_MIPS=yarch/mips/configs/fulong_defconfig +0
-0@@ -118,13 +118,14 @@ CONFIG_GENERIC_IRQ_PROBE=y
CONFIG_CPU_SUPPORTS_HIGHMEM=yCONFIG_SYS_SUPPORTS_HIGHMEM=yCONFIG_ARCH_FLATMEM_ENABLE=y
+CONFIG_ARCH_SPARSEMEM_ENABLE=yCONFIG_SELECT_MEMORY_MODEL=yarch/mips/configs/fulong_defconfig +1
-1-CONFIG_FLATMEM_MANUAL=y +# CONFIG_FLATMEM_MANUAL is not set#
CONFIG_DISCONTIGMEM_MANUALis not setarch/mips/configs/fulong_defconfig +4
-4-# CONFIG_SPARSEMEM_MANUAL is not set -CONFIG_FLATMEM=y -CONFIG_FLAT_NODE_MEM_MAP=y -# CONFIG_SPARSEMEM_STATIC is not set +CONFIG_SPARSEMEM_MANUAL=y +CONFIG_SPARSEMEM=y +CONFIG_HAVE_MEMORY_PRESENT=y +CONFIG_SPARSEMEM_STATIC=y
CONFIG_SPLIT_PTLOCK_CPUS=4CONFIG_RESOURCES_64BIT=yCONFIG_ZONE_DMA_FLAG=0