-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MIPS: Loongson: Split common loongson source code out
To share common loongson source code between all of the loongson-based machines. there is a need to split it out of the fuloong-2e/ directory. at the same time, other according tuning is needed. the machine-specific parts are defined as macros in relative header file, pci.h, mem.h, machine.h. Signed-off-by: Wu Zhangjin <wuzhangjin@gmail.com> Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
- Loading branch information
Wu Zhangjin
authored and
Ralf Baechle
committed
Sep 17, 2009
1 parent
8e49711
commit 85749d2
Showing
24 changed files
with
351 additions
and
133 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
/* | ||
* Copyright (C) 2009 Lemote, Inc. & Institute of Computing Technology | ||
* Author: Wu Zhangjin <wuzj@lemote.com> | ||
* | ||
* This program is free software; you can redistribute it and/or modify it | ||
* under the terms of the GNU General Public License as published by the | ||
* Free Software Foundation; either version 2 of the License, or (at your | ||
* option) any later version. | ||
*/ | ||
|
||
#ifndef __ASM_MACH_LOONGSON_MACHINE_H | ||
#define __ASM_MACH_LOONGSON_MACHINE_H | ||
|
||
#ifdef CONFIG_LEMOTE_FULOONG2E | ||
|
||
#define LOONGSON_UART_BASE (BONITO_PCIIO_BASE + 0x3f8) | ||
|
||
#define LOONGSON_MACHNAME "lemote-fuloong-2e-box" | ||
|
||
#endif | ||
|
||
#endif /* __ASM_MACH_LOONGSON_MACHINE_H */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
/* | ||
* Copyright (C) 2009 Lemote, Inc. & Institute of Computing Technology | ||
* Author: Wu Zhangjin <wuzj@lemote.com> | ||
* | ||
* This program is free software; you can redistribute it and/or modify it | ||
* under the terms of the GNU General Public License as published by the | ||
* Free Software Foundation; either version 2 of the License, or (at your | ||
* option) any later version. | ||
*/ | ||
|
||
#ifndef __ASM_MACH_LOONGSON_MEM_H | ||
#define __ASM_MACH_LOONGSON_MEM_H | ||
|
||
/* | ||
* On Lemote Loongson 2e | ||
* | ||
* the high memory space starts from 512M. | ||
* the peripheral registers reside between 0x1000:0000 and 0x2000:0000. | ||
*/ | ||
|
||
#ifdef CONFIG_LEMOTE_FULOONG2E | ||
|
||
#define LOONGSON_HIGHMEM_START 0x20000000 | ||
|
||
#define LOONGSON_MMIO_MEM_START 0x10000000 | ||
#define LOONGSON_MMIO_MEM_END 0x20000000 | ||
|
||
#endif | ||
|
||
#endif /* __ASM_MACH_LOONGSON_MEM_H */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
choice | ||
prompt "Machine Type" | ||
depends on MACH_LOONGSON | ||
|
||
config LEMOTE_FULOONG2E | ||
bool "Lemote Fuloong(2e) mini-PC" | ||
select ARCH_SPARSEMEM_ENABLE | ||
select CEVT_R4K | ||
select CSRC_R4K | ||
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 GENERIC_ISA_DMA_SUPPORT_BROKEN | ||
select CPU_HAS_WB | ||
help | ||
Lemote Fuloong(2e) mini-PC board based on the Chinese Loongson-2E CPU and | ||
an FPGA northbridge | ||
|
||
Lemote Fuloong(2e) mini PC have a VIA686B south bridge. | ||
endchoice |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# | ||
# Common code for all Loongson based systems | ||
# | ||
|
||
obj-$(CONFIG_MACH_LOONGSON) += common/ | ||
|
||
# | ||
# Lemote Fuloong mini-PC (Loongson 2E-based) | ||
# | ||
|
||
obj-$(CONFIG_LEMOTE_FULOONG2E) += fuloong-2e/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# | ||
# Makefile for loongson based machines. | ||
# | ||
|
||
obj-y += setup.o init.o cmdline.o env.o time.o reset.o irq.o \ | ||
pci.o bonito-irq.o mem.o | ||
|
||
# | ||
# Early printk support | ||
# | ||
obj-$(CONFIG_EARLY_PRINTK) += early_printk.o |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
/* | ||
* Copyright (C) 2007 Lemote Inc. & Insititute of Computing Technology | ||
* Author: Fuxin Zhang, zhangfx@lemote.com | ||
* | ||
* This program is free software; you can redistribute it and/or modify it | ||
* under the terms of the GNU General Public License as published by the | ||
* Free Software Foundation; either version 2 of the License, or (at your | ||
* option) any later version. | ||
*/ | ||
#include <linux/delay.h> | ||
#include <linux/interrupt.h> | ||
|
||
#include <loongson.h> | ||
/* | ||
* the first level int-handler will jump here if it is a bonito irq | ||
*/ | ||
void bonito_irqdispatch(void) | ||
{ | ||
u32 int_status; | ||
int i; | ||
|
||
/* workaround the IO dma problem: let cpu looping to allow DMA finish */ | ||
int_status = BONITO_INTISR; | ||
if (int_status & (1 << 10)) { | ||
while (int_status & (1 << 10)) { | ||
udelay(1); | ||
int_status = BONITO_INTISR; | ||
} | ||
} | ||
|
||
/* Get pending sources, masked by current enables */ | ||
int_status = BONITO_INTISR & BONITO_INTEN; | ||
|
||
if (int_status != 0) { | ||
i = __ffs(int_status); | ||
int_status &= ~(1 << i); | ||
do_IRQ(BONITO_IRQ_BASE + i); | ||
} | ||
} | ||
|
||
asmlinkage void plat_irq_dispatch(void) | ||
{ | ||
unsigned int pending; | ||
|
||
pending = read_c0_cause() & read_c0_status() & ST0_IM; | ||
|
||
/* machine-specific plat_irq_dispatch */ | ||
mach_irq_dispatch(pending); | ||
} | ||
|
||
void __init arch_init_irq(void) | ||
{ | ||
/* | ||
* Clear all of the interrupts while we change the able around a bit. | ||
* int-handler is not on bootstrap | ||
*/ | ||
clear_c0_status(ST0_IM | ST0_BEV); | ||
local_irq_disable(); | ||
|
||
/* setting irq trigger mode */ | ||
set_irq_trigger_mode(); | ||
|
||
/* no steer */ | ||
BONITO_INTSTEER = 0; | ||
|
||
/* | ||
* Mask out all interrupt by writing "1" to all bit position in | ||
* the interrupt reset reg. | ||
*/ | ||
BONITO_INTENCLR = ~0; | ||
|
||
/* machine specific irq init */ | ||
mach_init_irq(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.