Skip to contentSkip to conversation

remove reference to bonito64.h

PATCH In review [email protected] 4 participants 34 messages Jun 4, 2009 – Jun 11, 2009 1 message not in the archive

Subsystems (4)
lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

PATCH 4/25 change the naming methods

From: Wu Zhangjin <[email protected]>

to support loongson-based machines made by non-lemote companies, some lemote* names should be changed to loongson* names, and to support the future loongson2f-based fulong machines, the current fulong's name should be fuloong-2e or fuloong2e, and also, FULONG to FULOONG2E, lm2e to fuloong2e, LEMOTE to LOONGSON.

at the same time, tons of lines have been cleaned up with the help of scripts/checkpatch.pl

---
 arch/mips/Kconfig                                  |    4 +-
 arch/mips/Makefile                                 |    6 +-
 .../asm/mach-lemote/cpu-feature-overrides.h        |   59 -----
 arch/mips/include/asm/mach-lemote/dma-coherence.h  |   66 ------
 arch/mips/include/asm/mach-lemote/mc146818rtc.h    |   36 ---
 arch/mips/include/asm/mach-lemote/pci.h            |   30 ---
 arch/mips/include/asm/mach-lemote/war.h            |   25 --
 .../asm/mach-loongson/cpu-feature-overrides.h      |   59 +++++
 .../mips/include/asm/mach-loongson/dma-coherence.h |   66 ++++++
 arch/mips/include/asm/mach-loongson/loongson.h     |   14 ++
 arch/mips/include/asm/mach-loongson/mc146818rtc.h  |   36 +++
 arch/mips/include/asm/mach-loongson/pci.h          |   32 +++
 arch/mips/include/asm/mach-loongson/war.h          |   25 ++
 arch/mips/include/asm/mips-boards/bonito64.h       |    2 +-
 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                        |  143 ------------
 arch/mips/lemote/lm2e/mem.c                        |   23 --
 arch/mips/lemote/lm2e/pci.c                        |   97 --------
 arch/mips/lemote/lm2e/prom.c                       |   97 --------
 arch/mips/lemote/lm2e/reset.c                      |   41 ----
 arch/mips/lemote/lm2e/setup.c                      |  111 ---------
 arch/mips/loongson/fuloong-2e/Makefile             |    7 +
 arch/mips/loongson/fuloong-2e/bonito-irq.c         |   73 ++++++
 arch/mips/loongson/fuloong-2e/dbg_io.c             |  153 ++++++++++++
 arch/mips/loongson/fuloong-2e/irq.c                |  139 +++++++++++
 arch/mips/loongson/fuloong-2e/mem.c                |   23 ++
 arch/mips/loongson/fuloong-2e/pci.c                |   95 ++++++++
 arch/mips/loongson/fuloong-2e/prom.c               |   90 ++++++++
 arch/mips/loongson/fuloong-2e/reset.c              |   37 +++
 arch/mips/loongson/fuloong-2e/setup.c              |  108 +++++++++
 arch/mips/pci/Makefile                             |    2 +-
 arch/mips/pci/fixup-fuloong2e.c                    |  242 ++++++++++++++++++++
 arch/mips/pci/fixup-lm2e.c                         |  242 --------------------
 arch/mips/pci/ops-bonito64.c                       |   16 +-
 36 files changed, 1215 insertions(+), 1211 deletions(-)
 delete mode 100644 arch/mips/include/asm/mach-lemote/cpu-feature-overrides.h
 delete mode 100644 arch/mips/include/asm/mach-lemote/dma-coherence.h
 delete mode 100644 arch/mips/include/asm/mach-lemote/mc146818rtc.h
 delete mode 100644 arch/mips/include/asm/mach-lemote/pci.h
 delete mode 100644 arch/mips/include/asm/mach-lemote/war.h
 create mode 100644 arch/mips/include/asm/mach-loongson/cpu-feature-overrides.h
 create mode 100644 arch/mips/include/asm/mach-loongson/dma-coherence.h
 create mode 100644 arch/mips/include/asm/mach-loongson/loongson.h
 create mode 100644 arch/mips/include/asm/mach-loongson/mc146818rtc.h
 create mode 100644 arch/mips/include/asm/mach-loongson/pci.h
 create mode 100644 arch/mips/include/asm/mach-loongson/war.h
 delete mode 100644 arch/mips/lemote/lm2e/Makefile
 delete mode 100644 arch/mips/lemote/lm2e/bonito-irq.c
 delete mode 100644 arch/mips/lemote/lm2e/dbg_io.c
 delete mode 100644 arch/mips/lemote/lm2e/irq.c
 delete mode 100644 arch/mips/lemote/lm2e/mem.c
 delete mode 100644 arch/mips/lemote/lm2e/pci.c
 delete mode 100644 arch/mips/lemote/lm2e/prom.c
 delete mode 100644 arch/mips/lemote/lm2e/reset.c
 delete mode 100644 arch/mips/lemote/lm2e/setup.c
 create mode 100644 arch/mips/loongson/fuloong-2e/Makefile
 create mode 100644 arch/mips/loongson/fuloong-2e/bonito-irq.c
 create mode 100644 arch/mips/loongson/fuloong-2e/dbg_io.c
 create mode 100644 arch/mips/loongson/fuloong-2e/irq.c
 create mode 100644 arch/mips/loongson/fuloong-2e/mem.c
 create mode 100644 arch/mips/loongson/fuloong-2e/pci.c
 create mode 100644 arch/mips/loongson/fuloong-2e/prom.c
 create mode 100644 arch/mips/loongson/fuloong-2e/reset.c
 create mode 100644 arch/mips/loongson/fuloong-2e/setup.c
 create mode 100644 arch/mips/pci/fixup-fuloong2e.c
 delete mode 100644 arch/mips/pci/fixup-lm2e.c
arch/mips/Kconfig +2 -2
index 09b1287..7897861 100644
@@ -153,8 +153,8 @@ config LASAT
 	select SYS_SUPPORTS_64BIT_KERNEL if BROKEN
 	select SYS_SUPPORTS_LITTLE_ENDIAN
 
-config LEMOTE_FULONG
-	bool "Lemote Fulong mini-PC"
+config LEMOTE_FULOONG2E
+	bool "Lemote Fuloong(2e) mini-PC"
 	select ARCH_SPARSEMEM_ENABLE
 	select CEVT_R4K
 	select CSRC_R4K
arch/mips/Makefile +3 -3
index c4cae9e..55181a4 100644
@@ -307,9 +307,9 @@ 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) += -I$(srctree)/arch/mips/include/asm/mach-lemote
+core-$(CONFIG_LEMOTE_FULOONG2E) +=arch/mips/loongson/fuloong-2e/
+load-$(CONFIG_LEMOTE_FULOONG2E) +=0xffffffff80100000
+cflags-$(CONFIG_LEMOTE_FULOONG2E) += -I$(srctree)/arch/mips/include/asm/mach-loongson
 
 #
 # MIPS Malta board
arch/mips/include/asm/mach-lemote/cpu-feature-overrides.h deleted +0 -59

59 lines not on this page · raw message

arch/mips/include/asm/mach-lemote/dma-coherence.h deleted +0 -66

66 lines not on this page · raw message

arch/mips/include/asm/mach-lemote/mc146818rtc.h deleted +0 -36
deleted file mode 100644
index ed5147e..0000000
@@ -1,36 +0,0 @@
-/*
- * 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, 07 by Ralf Baechle ([email protected])
- *
- * RTC routines for PC style attached Dallas chip.
- */
-#ifndef __ASM_MACH_LEMOTE_MC146818RTC_H
-#define __ASM_MACH_LEMOTE_MC146818RTC_H
-
-#include <linux/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_LEMOTE_MC146818RTC_H */
arch/mips/include/asm/mach-lemote/pci.h deleted +0 -30
deleted file mode 100644
index ea6aa14..0000000
@@ -1,30 +0,0 @@
-/*
- * Copyright (c) 2008 Zhang Le <[email protected]>
- *
- * 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.
- *
- * This program is distributed in the hope that it will be
- * useful, but WITHOUT ANY WARRANTY; without even the implied
- * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE.  See the GNU General Public License for more
- * details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program; if not, write to the Free
- * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA
- * 02139, USA.
- */
-
-#ifndef _LEMOTE_PCI_H_
-#define _LEMOTE_PCI_H_
-
-#define LOONGSON2E_PCI_MEM_START	0x14000000UL
-#define LOONGSON2E_PCI_MEM_END		0x1fffffffUL
-#define LOONGSON2E_PCI_IO_START		0x00004000UL
-#define LOONGSON2E_IO_PORT_BASE		0x1fd00000UL
-
-#endif /* !_LEMOTE_PCI_H_ */
arch/mips/include/asm/mach-lemote/war.h deleted +0 -25
deleted file mode 100644
index 05f89e0..0000000
@@ -1,25 +0,0 @@
-/*
- * 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) 2002, 2004, 2007 by Ralf Baechle <[email protected]>
- */
-#ifndef __ASM_MIPS_MACH_LEMOTE_WAR_H
-#define __ASM_MIPS_MACH_LEMOTE_WAR_H
-
-#define R4600_V1_INDEX_ICACHEOP_WAR	0
-#define R4600_V1_HIT_CACHEOP_WAR	0
-#define R4600_V2_HIT_CACHEOP_WAR	0
-#define R5432_CP0_INTERRUPT_WAR		0
-#define BCM1250_M3_WAR			0
-#define SIBYTE_1956_WAR			0
-#define MIPS4K_ICACHE_REFILL_WAR	0
-#define MIPS_CACHE_SYNC_WAR		0
-#define TX49XX_ICACHE_INDEX_INV_WAR	0
-#define RM9000_CDEX_SMP_WAR		0
-#define ICACHE_REFILLS_WORKAROUND_WAR	0
-#define R10000_LLSC_WAR			0
-#define MIPS34K_MISSED_ITLB_WAR		0
-
-#endif /* __ASM_MIPS_MACH_LEMOTE_WAR_H */
arch/mips/include/asm/mach-loongson/cpu-feature-overrides.h new file +59 -0

59 lines not on this page · raw message

arch/mips/include/asm/mach-loongson/dma-coherence.h new file +66 -0

66 lines not on this page · raw message

arch/mips/include/asm/mach-loongson/loongson.h new file +14 -0
new file mode 100644
index 0000000..18ebef1
@@ -0,0 +1,14 @@
+/*
+ * loongson-specific header file
+ */
+
+/* loongson internal northbridge initialization */
+extern void bonito_irq_init(void);
+
+/* command line */
+extern unsigned long bus_clock, cpu_clock_freq;
+extern unsigned long memsize, highmemsize;
+
+/* loongson-based machines specific reboot setup */
+extern void loongson_reboot_setup(void);
+
arch/mips/include/asm/mach-loongson/mc146818rtc.h new file +36 -0
new file mode 100644
index 0000000..ed7fe97
@@ -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, 07 by Ralf Baechle ([email protected])
+ *
+ * RTC routines for PC style attached Dallas chip.
+ */
+#ifndef __ASM_MACH_LOONGSON_MC146818RTC_H
+#define __ASM_MACH_LOONGSON_MC146818RTC_H
+
+#include <linux/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_LOONGSON_MC146818RTC_H */
arch/mips/include/asm/mach-loongson/pci.h new file +32 -0
new file mode 100644
index 0000000..e685096
@@ -0,0 +1,32 @@
+/*
+ * Copyright (c) 2008 Zhang Le <[email protected]>
+ *
+ * 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.
+ *
+ * This program is distributed in the hope that it will be
+ * useful, but WITHOUT ANY WARRANTY; without even the implied
+ * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ * PURPOSE.  See the GNU General Public License for more
+ * details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program; if not, write to the Free
+ * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA
+ * 02139, USA.
+ */
+
+#ifndef _LOONGSON_PCI_H_
+#define _LOONGSON_PCI_H_
+
+extern struct pci_ops bonito64_pci_ops;
+
+#define LOONGSON2E_PCI_MEM_START	0x14000000UL
+#define LOONGSON2E_PCI_MEM_END		0x1fffffffUL
+#define LOONGSON2E_PCI_IO_START		0x00004000UL
+#define LOONGSON2E_IO_PORT_BASE		0x1fd00000UL
+
+#endif /* !_LOONGSON_PCI_H_ */
arch/mips/include/asm/mach-loongson/war.h new file +25 -0
new file mode 100644
index 0000000..e42cace
@@ -0,0 +1,25 @@
+/*
+ * 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) 2002, 2004, 2007 by Ralf Baechle <[email protected]>
+ */
+#ifndef __ASM_MIPS_MACH_LOONGSON_WAR_H
+#define __ASM_MIPS_MACH_LOONGSON_WAR_H
+
+#define R4600_V1_INDEX_ICACHEOP_WAR	0
+#define R4600_V1_HIT_CACHEOP_WAR	0
+#define R4600_V2_HIT_CACHEOP_WAR	0
+#define R5432_CP0_INTERRUPT_WAR		0
+#define BCM1250_M3_WAR			0
+#define SIBYTE_1956_WAR			0
+#define MIPS4K_ICACHE_REFILL_WAR	0
+#define MIPS_CACHE_SYNC_WAR		0
+#define TX49XX_ICACHE_INDEX_INV_WAR	0
+#define RM9000_CDEX_SMP_WAR		0
+#define ICACHE_REFILLS_WORKAROUND_WAR	0
+#define R10000_LLSC_WAR			0
+#define MIPS34K_MISSED_ITLB_WAR		0
+
+#endif /* __ASM_MIPS_MACH_LOONGSON_WAR_H */
arch/mips/include/asm/mips-boards/bonito64.h +1 -1
index a0f04bb..a576ce0 100644
@@ -26,7 +26,7 @@
 /* offsets from base register */
 #define BONITO(x)	(x)
 
-#elif defined(CONFIG_LEMOTE_FULONG)
+#elif defined(CONFIG_LEMOTE_FULOONG2E)
 
 #define BONITO(x) (*(volatile u32 *)((char *)CKSEG1ADDR(BONITO_REG_BASE) + (x)))
 #define BONITO_IRQ_BASE   32
arch/mips/lemote/lm2e/Makefile deleted +0 -7
deleted file mode 100644
index d34671d..0000000
@@ -1,7 +0,0 @@
-#
-# 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 mem.o
-
-EXTRA_CFLAGS += -Werror
arch/mips/lemote/lm2e/bonito-irq.c deleted +0 -74

74 lines not on this page · raw message

arch/mips/lemote/lm2e/dbg_io.c deleted +0 -146

146 lines not on this page · raw message

arch/mips/lemote/lm2e/irq.c deleted +0 -143

143 lines not on this page · raw message

arch/mips/lemote/lm2e/mem.c deleted +0 -23
deleted file mode 100644
index 16cd215..0000000
@@ -1,23 +0,0 @@
-/*
- * 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/fs.h>
-#include <linux/fcntl.h>
-#include <linux/mm.h>
-
-/* override of arch/mips/mm/cache.c: __uncached_access */
-int __uncached_access(struct file *file, unsigned long addr)
-{
-	if (file->f_flags & O_SYNC)
-		return 1;
-
-	/*
-	 * On the Lemote Loongson 2e system, the peripheral registers
-	 * reside between 0x1000:0000 and 0x2000:0000.
-	 */
-	return addr >= __pa(high_memory) ||
-		((addr >= 0x10000000) && (addr < 0x20000000));
-}
arch/mips/lemote/lm2e/pci.c deleted +0 -97

97 lines not on this page · raw message

arch/mips/lemote/lm2e/prom.c deleted +0 -97

97 lines not on this page · raw message

arch/mips/lemote/lm2e/reset.c deleted +0 -41

41 lines not on this page · raw message

arch/mips/lemote/lm2e/setup.c deleted +0 -111

111 lines not on this page · raw message

arch/mips/loongson/fuloong-2e/Makefile new file +7 -0
new file mode 100644
index 0000000..d34671d
@@ -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 mem.o
+
+EXTRA_CFLAGS += -Werror
arch/mips/loongson/fuloong-2e/bonito-irq.c new file +73 -0

73 lines not on this page · raw message

arch/mips/loongson/fuloong-2e/dbg_io.c new file +153 -0

153 lines not on this page · raw message

arch/mips/loongson/fuloong-2e/irq.c new file +139 -0

139 lines not on this page · raw message

arch/mips/loongson/fuloong-2e/mem.c new file +23 -0
new file mode 100644
index 0000000..16cd215
@@ -0,0 +1,23 @@
+/*
+ * 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/fs.h>
+#include <linux/fcntl.h>
+#include <linux/mm.h>
+
+/* override of arch/mips/mm/cache.c: __uncached_access */
+int __uncached_access(struct file *file, unsigned long addr)
+{
+	if (file->f_flags & O_SYNC)
+		return 1;
+
+	/*
+	 * On the Lemote Loongson 2e system, the peripheral registers
+	 * reside between 0x1000:0000 and 0x2000:0000.
+	 */
+	return addr >= __pa(high_memory) ||
+		((addr >= 0x10000000) && (addr < 0x20000000));
+}
arch/mips/loongson/fuloong-2e/pci.c new file +95 -0

95 lines not on this page · raw message

arch/mips/loongson/fuloong-2e/prom.c new file +90 -0

90 lines not on this page · raw message

arch/mips/loongson/fuloong-2e/reset.c new file +37 -0
new file mode 100644
index 0000000..769a2ce
@@ -0,0 +1,37 @@
+/*
+ * 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.
+ *
+ * Copyright (C) 2007 Lemote, Inc. & Institute of Computing Technology
+ * Author: Fuxin Zhang, [email protected]
+ */
+#include <linux/pm.h>
+
+#include <asm/reboot.h>
+
+static void loongson_restart(char *command)
+{
+#ifdef CONFIG_32BIT
+	*(unsigned long *)0xbfe00104 &= ~(1 << 2);
+	*(unsigned long *)0xbfe00104 |= (1 << 2);
+#else
+	*(unsigned long *)0xffffffffbfe00104 &= ~(1 << 2);
+	*(unsigned long *)0xffffffffbfe00104 |= (1 << 2);
+#endif
+	__asm__ __volatile__("jr\t%0" : : "r"(0xbfc00000));
+}
+
+static void loongson_halt(void)
+{
+	while (1)
+		;
+}
+
+void loongson_reboot_setup(void)
+{
+	_machine_restart = loongson_restart;
+	_machine_halt = loongson_halt;
+	pm_power_off = loongson_halt;
+}
arch/mips/loongson/fuloong-2e/setup.c new file +108 -0

108 lines not on this page · raw message

arch/mips/pci/Makefile +1 -1
index e8a97f5..1c66fc0 100644
@@ -26,7 +26,7 @@ obj-$(CONFIG_MIPS_COBALT)	+= fixup-cobalt.o
 obj-$(CONFIG_SOC_AU1500)	+= fixup-au1000.o ops-au1000.o
 obj-$(CONFIG_SOC_AU1550)	+= fixup-au1000.o ops-au1000.o
 obj-$(CONFIG_SOC_PNX8550)	+= fixup-pnx8550.o ops-pnx8550.o
-obj-$(CONFIG_LEMOTE_FULONG)	+= fixup-lm2e.o ops-bonito64.o
+obj-$(CONFIG_LEMOTE_FULOONG2E)	+= fixup-fuloong2e.o ops-bonito64.o
 obj-$(CONFIG_MIPS_MALTA)	+= fixup-malta.o
 obj-$(CONFIG_PMC_MSP7120_GW)	+= fixup-pmcmsp.o ops-pmcmsp.o
 obj-$(CONFIG_PMC_MSP7120_EVAL)	+= fixup-pmcmsp.o ops-pmcmsp.o
arch/mips/pci/fixup-fuloong2e.c new file +242 -0

242 lines not on this page · raw message

arch/mips/pci/fixup-lm2e.c deleted +0 -242

242 lines not on this page · raw message

arch/mips/pci/ops-bonito64.c +9 -7
index f742c51..e3b091d 100644
@@ -29,11 +29,12 @@
 #define PCI_ACCESS_READ  0
 #define PCI_ACCESS_WRITE 1
 
-#ifdef CONFIG_LEMOTE_FULONG
+#ifdef CONFIG_LEMOTE_FULOONG2E
 #define CFG_SPACE_REG(offset) (void *)CKSEG1ADDR(BONITO_PCICFG_BASE | (offset))
 #define ID_SEL_BEGIN 11
 #else
-#define CFG_SPACE_REG(offset) (void *)CKSEG1ADDR(_pcictrl_bonito_pcicfg + (offset))
+#define CFG_SPACE_REG(offset) \
+	(void *)CKSEG1ADDR(_pcictrl_bonito_pcicfg + (offset))
 #define ID_SEL_BEGIN 10
 #endif
 #define MAX_DEV_NUM (31 - ID_SEL_BEGIN)
@@ -42,7 +43,7 @@
 static int bonito64_pcibios_config_access(unsigned char access_type,
 				      struct pci_bus *bus,
 				      unsigned int devfn, int where,
-				      u32 * data)
+				      u32 *data)
 {
 	u32 busnum = bus->number;
 	u32 addr, type;
@@ -77,9 +78,10 @@ static int bonito64_pcibios_config_access(unsigned char access_type,
 	addrp = CFG_SPACE_REG(addr & 0xffff);
 	if (access_type == PCI_ACCESS_WRITE) {
 		writel(cpu_to_le32(*data), addrp);
-#ifndef CONFIG_LEMOTE_FULONG
+#ifndef CONFIG_LEMOTE_FULOONG2E
 		/* Wait till done */
-		while (BONITO_PCIMSTAT & 0xF);
+		while (BONITO_PCIMSTAT & 0xF)
+			;
 #endif
 	} else {
 		*data = le32_to_cpu(readl(addrp));
@@ -107,7 +109,7 @@ static int bonito64_pcibios_config_access(unsigned char access_type,
  * read/write a 32bit word and mask/modify the data we actually want.
  */
 static int bonito64_pcibios_read(struct pci_bus *bus, unsigned int devfn,
-			     int where, int size, u32 * val)
+			     int where, int size, u32 *val)
 {
 	u32 data = 0;
 
@@ -144,7 +146,7 @@ static int bonito64_pcibios_write(struct pci_bus *bus, unsigned int devfn,
 		data = val;
 	else {
 		if (bonito64_pcibios_config_access(PCI_ACCESS_READ, bus, devfn,
-		                               where, &data))
+					where, &data))
 			return -1;
 
 		if (size == 1)
Signature · 1 line
1.6.0.4
#2 lore raw

PATCH 5/25 remove reference to bonito64.h

In reply to a message not in the archive

From: Wu Zhangjin <[email protected]>

in loongson2e, there is an internal bonito64 compatiable north bridge, but in loongson2f and the later loongson revisions, this will change a lot, so, remove reference from bonito64.h and create a new loongson.h is better.

---
 arch/mips/include/asm/mach-loongson/loongson.h |  194 +++++++++++++++++++++++-
 arch/mips/include/asm/mach-loongson/pci.h      |    2 +-
 arch/mips/include/asm/mips-boards/bonito64.h   |    5 -
 arch/mips/loongson/fuloong-2e/bonito-irq.c     |   10 +-
 arch/mips/loongson/fuloong-2e/irq.c            |   23 ++--
 arch/mips/loongson/fuloong-2e/pci.c            |   15 +-
 arch/mips/pci/Makefile                         |    2 +-
 arch/mips/pci/fixup-fuloong2e.c                |    5 +-
 arch/mips/pci/ops-bonito64.c                   |    7 -
 arch/mips/pci/ops-fuloong2e.c                  |  160 +++++++++++++++++++
 10 files changed, 382 insertions(+), 41 deletions(-)
 create mode 100644 arch/mips/pci/ops-fuloong2e.c
arch/mips/include/asm/mach-loongson/loongson.h +193 -1
index 18ebef1..26308b5 100644
@@ -1,7 +1,19 @@
 /*
- * loongson-specific header file
+ * Copyright (c) 2009 Philippe Vachon <[email protected]>
+ *
+ * Copyright (C) 2009 Lemote, Inc. & Institute of Computing Technology
+ * Author: Wu Zhangjin <[email protected]>
+ *
+ * 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 __LOONGSON_H
+#define __LOONGSON_H
+
 /* loongson internal northbridge initialization */
 extern void bonito_irq_init(void);
 
@@ -12,3 +24,183 @@ extern unsigned long memsize, highmemsize;
 /* loongson-based machines specific reboot setup */
 extern void loongson_reboot_setup(void);
 
+#define LOONGSON_REG(x) \
+	(*(u32 *)((char *)CKSEG1ADDR(LOONGSON_REG_BASE) + (x)))
+#define LOONGSON_IRQ_BASE	32
+
+#define LOONGSON_FLASH_BASE	0x1c000000
+#define LOONGSON_FLASH_SIZE	0x02000000	/* 32M */
+#define LOONGSON_FLASH_TOP	(LOONGSON_FLASH_BASE+LOONGSON_FLASH_SIZE-1)
+
+#define LOONGSON_LIO0_BASE	0x1e000000
+#define LOONGSON_LIO0_SIZE	0x01C00000	/* 28M */
+#define LOONGSON_LIO0_TOP	(LOONGSON_LIO0_BASE+LOONGSON_LIO0_SIZE-1)
+
+#define LOONGSON_BOOT_BASE	0x1fc00000
+#define LOONGSON_BOOT_SIZE	0x00100000	/* 1M */
+#define LOONGSON_BOOT_TOP 	(LOONGSON_BOOT_BASE+LOONGSON_BOOT_SIZE-1)
+#define LOONGSON_REG_BASE 	0x1fe00000
+#define LOONGSON_REG_SIZE 	0x00100000	/* 256Bytes + 256Bytes + ??? */
+#define LOONGSON_REG_TOP	(LOONGSON_REG_BASE+LOONGSON_REG_SIZE-1)
+
+#define LOONGSON_LIO1_BASE 	0x1ff00000
+#define LOONGSON_LIO1_SIZE 	0x00100000	/* 1M */
+#define LOONGSON_LIO1_TOP	(LOONGSON_LIO1_BASE+LOONGSON_LIO1_SIZE-1)
+
+#define LOONGSON_PCILO0_BASE	0x10000000
+#define LOONGSON_PCILO1_BASE	0x14000000
+#define LOONGSON_PCILO2_BASE	0x18000000
+#define LOONGSON_PCILO_BASE	LOONGSON_PCILO0_BASE
+#define LOONGSON_PCILO_SIZE	0x0c000000	/* 64M * 3 */
+#define LOONGSON_PCILO_TOP	(LOONGSON_PCILO0_BASE+LOONGSON_PCILO_SIZE-1)
+
+#define LOONGSON_PCICFG_BASE	0x1fe80000
+#define LOONGSON_PCICFG_SIZE	0x00000800	/* 2K */
+#define LOONGSON_PCICFG_TOP	(LOONGSON_PCICFG_BASE+LOONGSON_PCICFG_SIZE-1)
+#define LOONGSON_PCIIO_BASE	0x1fd00000
+#define LOONGSON_PCIIO_SIZE	0x00100000	/* 1M */
+#define LOONGSON_PCIIO_TOP	(LOONGSON_PCIIO_BASE+LOONGSON_PCIIO_SIZE-1)
+
+/* Loongson Register Bases */
+
+#define LOONGSON_PCICONFIGBASE	0x00
+#define LOONGSON_REGBASE	0x100
+
+/* PCI Configuration Registers */
+
+#define LOONGSON_PCI_REG(x)	LOONGSON_REG(LOONGSON_PCICONFIGBASE + (x))
+#define LOONGSON_PCIDID		LOONGSON_PCI_REG(0x00)
+#define LOONGSON_PCICMD		LOONGSON_PCI_REG(0x04)
+#define LOONGSON_PCICLASS 	LOONGSON_PCI_REG(0x08)
+#define LOONGSON_PCILTIMER	LOONGSON_PCI_REG(0x0c)
+#define LOONGSON_PCIBASE0 	LOONGSON_PCI_REG(0x10)
+#define LOONGSON_PCIBASE1 	LOONGSON_PCI_REG(0x14)
+#define LOONGSON_PCIBASE2 	LOONGSON_PCI_REG(0x18)
+#define LOONGSON_PCIBASE3 	LOONGSON_PCI_REG(0x1c)
+#define LOONGSON_PCIBASE4 	LOONGSON_PCI_REG(0x20)
+#define LOONGSON_PCIEXPRBASE	LOONGSON_PCI_REG(0x30)
+#define LOONGSON_PCIINT		LOONGSON_PCI_REG(0x3c)
+
+#define LOONGSON_PCI_ISR4C	LOONGSON_PCI_REG(0x4c)
+
+#define LOONGSON_PCICMD_PERR_CLR	0x80000000
+#define LOONGSON_PCICMD_SERR_CLR	0x40000000
+#define LOONGSON_PCICMD_MABORT_CLR	0x20000000
+#define LOONGSON_PCICMD_MTABORT_CLR	0x10000000
+#define LOONGSON_PCICMD_TABORT_CLR	0x08000000
+#define LOONGSON_PCICMD_MPERR_CLR 	0x01000000
+#define LOONGSON_PCICMD_PERRRESPEN	0x00000040
+#define LOONGSON_PCICMD_ASTEPEN		0x00000080
+#define LOONGSON_PCICMD_SERREN		0x00000100
+#define LOONGSON_PCILTIMER_BUSLATENCY	0x0000ff00
+#define LOONGSON_PCILTIMER_BUSLATENCY_SHIFT	8
+
+/* Loongson h/w Configuration */
+
+#define LOONGSON_GENCFG_OFFSET		0x4
+#define LOONGSON_GENCFG	LOONGSON_REG(LOONGSON_REGBASE + LOONGSON_GENCFG_OFFSET)
+
+#define LOONGSON_GENCFG_DEBUGMODE	0x00000001
+#define LOONGSON_GENCFG_SNOOPEN		0x00000002
+#define LOONGSON_GENCFG_CPUSELFRESET	0x00000004
+
+#define LOONGSON_GENCFG_FORCE_IRQA	0x00000008
+#define LOONGSON_GENCFG_IRQA_ISOUT	0x00000010
+#define LOONGSON_GENCFG_IRQA_FROM_INT1	0x00000020
+#define LOONGSON_GENCFG_BYTESWAP	0x00000040
+
+#define LOONGSON_GENCFG_UNCACHED	0x00000080
+#define LOONGSON_GENCFG_PREFETCHEN	0x00000100
+#define LOONGSON_GENCFG_WBEHINDEN	0x00000200
+#define LOONGSON_GENCFG_CACHEALG	0x00000c00
+#define LOONGSON_GENCFG_CACHEALG_SHIFT	10
+#define LOONGSON_GENCFG_PCIQUEUE	0x00001000
+#define LOONGSON_GENCFG_CACHESTOP	0x00002000
+#define LOONGSON_GENCFG_MSTRBYTESWAP	0x00004000
+#define LOONGSON_GENCFG_BUSERREN	0x00008000
+#define LOONGSON_GENCFG_NORETRYTIMEOUT	0x00010000
+#define LOONGSON_GENCFG_SHORTCOPYTIMEOUT	0x00020000
+
+/* PCI address map control */
+
+#define LOONGSON_PCIMAP			LOONGSON_REG(LOONGSON_REGBASE + 0x10)
+#define LOONGSON_PCIMEMBASECFG		LOONGSON_REG(LOONGSON_REGBASE + 0x14)
+#define LOONGSON_PCIMAP_CFG		LOONGSON_REG(LOONGSON_REGBASE + 0x18)
+
+/* GPIO Regs - r/w */
+
+#define LOONGSON_GPIODATA 		LOONGSON_REG(LOONGSON_REGBASE + 0x1c)
+#define LOONGSON_GPIOIE			LOONGSON_REG(LOONGSON_REGBASE + 0x20)
+
+/* ICU Configuration Regs - r/w */
+
+#define LOONGSON_INTEDGE		LOONGSON_REG(LOONGSON_REGBASE + 0x24)
+#define LOONGSON_INTSTEER 		LOONGSON_REG(LOONGSON_REGBASE + 0x28)
+#define LOONGSON_INTPOL			LOONGSON_REG(LOONGSON_REGBASE + 0x2c)
+
+/* ICU Enable Regs - IntEn & IntISR are r/o. */
+
+#define LOONGSON_INTENSET 		LOONGSON_REG(LOONGSON_REGBASE + 0x30)
+#define LOONGSON_INTENCLR 		LOONGSON_REG(LOONGSON_REGBASE + 0x34)
+#define LOONGSON_INTEN			LOONGSON_REG(LOONGSON_REGBASE + 0x38)
+#define LOONGSON_INTISR			LOONGSON_REG(LOONGSON_REGBASE + 0x3c)
+
+/* ICU */
+#define LOONGSON_ICU_MBOXES		0x0000000f
+#define LOONGSON_ICU_MBOXES_SHIFT 	0
+#define LOONGSON_ICU_DMARDY		0x00000010
+#define LOONGSON_ICU_DMAEMPTY		0x00000020
+#define LOONGSON_ICU_COPYRDY		0x00000040
+#define LOONGSON_ICU_COPYEMPTY		0x00000080
+#define LOONGSON_ICU_COPYERR		0x00000100
+#define LOONGSON_ICU_PCIIRQ		0x00000200
+#define LOONGSON_ICU_MASTERERR		0x00000400
+#define LOONGSON_ICU_SYSTEMERR		0x00000800
+#define LOONGSON_ICU_DRAMPERR		0x00001000
+#define LOONGSON_ICU_RETRYERR		0x00002000
+#define LOONGSON_ICU_GPIOS		0x01ff0000
+#define LOONGSON_ICU_GPIOS_SHIFT		16
+#define LOONGSON_ICU_GPINS		0x7e000000
+#define LOONGSON_ICU_GPINS_SHIFT		25
+#define LOONGSON_ICU_MBOX(N)		(1<<(LOONGSON_ICU_MBOXES_SHIFT+(N)))
+#define LOONGSON_ICU_GPIO(N)		(1<<(LOONGSON_ICU_GPIOS_SHIFT+(N)))
+#define LOONGSON_ICU_GPIN(N)		(1<<(LOONGSON_ICU_GPINS_SHIFT+(N)))
+
+/* PCI prefetch window base & mask */
+
+#define LOONGSON_MEM_WIN_BASE_L 	LOONGSON_REG(LOONGSON_REGBASE + 0x40)
+#define LOONGSON_MEM_WIN_BASE_H 	LOONGSON_REG(LOONGSON_REGBASE + 0x44)
+#define LOONGSON_MEM_WIN_MASK_L 	LOONGSON_REG(LOONGSON_REGBASE + 0x48)
+#define LOONGSON_MEM_WIN_MASK_H 	LOONGSON_REG(LOONGSON_REGBASE + 0x4c)
+
+/* PCI_Hit*_Sel_* */
+
+#define LOONGSON_PCI_HIT0_SEL_L		LOONGSON_REG(LOONGSON_REGBASE + 0x50)
+#define LOONGSON_PCI_HIT0_SEL_H		LOONGSON_REG(LOONGSON_REGBASE + 0x54)
+#define LOONGSON_PCI_HIT1_SEL_L		LOONGSON_REG(LOONGSON_REGBASE + 0x58)
+#define LOONGSON_PCI_HIT1_SEL_H		LOONGSON_REG(LOONGSON_REGBASE + 0x5c)
+#define LOONGSON_PCI_HIT2_SEL_L		LOONGSON_REG(LOONGSON_REGBASE + 0x60)
+#define LOONGSON_PCI_HIT2_SEL_H		LOONGSON_REG(LOONGSON_REGBASE + 0x64)
+
+/* PXArb Config & Status */
+
+#define LOONGSON_PXARB_CFG		LOONGSON_REG(LOONGSON_REGBASE + 0x68)
+#define LOONGSON_PXARB_STATUS		LOONGSON_REG(LOONGSON_REGBASE + 0x6c)
+
+/* Chip Config */
+#define LOONGSON_CHIPCFG0		LOONGSON_REG(LOONGSON_REGBASE + 0x80)
+
+/* pcimap */
+
+#define LOONGSON_PCIMAP_PCIMAP_LO0	0x0000003f
+#define LOONGSON_PCIMAP_PCIMAP_LO0_SHIFT	0
+#define LOONGSON_PCIMAP_PCIMAP_LO1	0x00000fc0
+#define LOONGSON_PCIMAP_PCIMAP_LO1_SHIFT	6
+#define LOONGSON_PCIMAP_PCIMAP_LO2	0x0003f000
+#define LOONGSON_PCIMAP_PCIMAP_LO2_SHIFT	12
+#define LOONGSON_PCIMAP_PCIMAP_2	0x00040000
+#define LOONGSON_PCIMAP_WIN(WIN, ADDR)	\
+	((((ADDR)>>26) & LOONGSON_PCIMAP_PCIMAP_LO0) << ((WIN)*6))
+
+#endif				/* __LOONGSON_H */
+
arch/mips/include/asm/mach-loongson/pci.h +1 -1
index e685096..9a351be 100644
@@ -22,7 +22,7 @@
 #ifndef _LOONGSON_PCI_H_
 #define _LOONGSON_PCI_H_
 
-extern struct pci_ops bonito64_pci_ops;
+extern struct pci_ops loongson_pci_ops;
 
 #define LOONGSON2E_PCI_MEM_START	0x14000000UL
 #define LOONGSON2E_PCI_MEM_END		0x1fffffffUL
arch/mips/include/asm/mips-boards/bonito64.h +0 -5
index a576ce0..d14e2ad 100644
@@ -26,11 +26,6 @@
 /* offsets from base register */
 #define BONITO(x)	(x)
 
-#elif defined(CONFIG_LEMOTE_FULOONG2E)
-
-#define BONITO(x) (*(volatile u32 *)((char *)CKSEG1ADDR(BONITO_REG_BASE) + (x)))
-#define BONITO_IRQ_BASE   32
-
 #else
 
 /*
arch/mips/loongson/fuloong-2e/bonito-irq.c +5 -5
index 5adf373..91b9c08 100644
@@ -34,18 +34,18 @@
 #include <linux/interrupt.h>
 #include <linux/irq.h>
 
-#include <asm/mips-boards/bonito64.h>
+#include <loongson.h>
 
 
 static inline void bonito_irq_enable(unsigned int irq)
 {
-	BONITO_INTENSET = (1 << (irq - BONITO_IRQ_BASE));
+	LOONGSON_INTENSET = (1 << (irq - LOONGSON_IRQ_BASE));
 	mmiowb();
 }
 
 static inline void bonito_irq_disable(unsigned int irq)
 {
-	BONITO_INTENCLR = (1 << (irq - BONITO_IRQ_BASE));
+	LOONGSON_INTENCLR = (1 << (irq - LOONGSON_IRQ_BASE));
 	mmiowb();
 }
 
@@ -66,8 +66,8 @@ void bonito_irq_init(void)
 {
 	u32 i;
 
-	for (i = BONITO_IRQ_BASE; i < BONITO_IRQ_BASE + 32; i++)
+	for (i = LOONGSON_IRQ_BASE; i < LOONGSON_IRQ_BASE + 32; i++)
 		set_irq_chip_and_handler(i, &bonito_irq_type, handle_level_irq);
 
-	setup_irq(BONITO_IRQ_BASE + 10, &dma_timeout_irqaction);
+	setup_irq(LOONGSON_IRQ_BASE + 10, &dma_timeout_irqaction);
 }
arch/mips/loongson/fuloong-2e/irq.c +11 -12
index 1b0d491..20030c0 100644
@@ -32,7 +32,6 @@
 #include <asm/irq_cpu.h>
 #include <asm/i8259.h>
 #include <asm/mipsregs.h>
-#include <asm/mips-boards/bonito64.h>
 
 #include <loongson.h>
 
@@ -45,21 +44,21 @@ static void bonito_irqdispatch(void)
 	int i;
 
 	/* workaround the IO dma problem: let cpu looping to allow DMA finish */
-	int_status = BONITO_INTISR;
+	int_status = LOONGSON_INTISR;
 	if (int_status & (1 << 10)) {
 		while (int_status & (1 << 10)) {
 			udelay(1);
-			int_status = BONITO_INTISR;
+			int_status = LOONGSON_INTISR;
 		}
 	}
 
 	/* Get pending sources, masked by current enables */
-	int_status = BONITO_INTISR & BONITO_INTEN;
+	int_status = LOONGSON_INTISR & LOONGSON_INTEN;
 
 	if (int_status != 0) {
 		i = __ffs(int_status);
 		int_status &= ~(1 << i);
-		do_IRQ(BONITO_IRQ_BASE + i);
+		do_IRQ(LOONGSON_IRQ_BASE + i);
 	}
 }
 
@@ -103,15 +102,15 @@ void __init arch_init_irq(void)
 	local_irq_disable();
 
 	/* most bonito irq should be level triggered */
-	BONITO_INTEDGE = BONITO_ICU_SYSTEMERR | BONITO_ICU_MASTERERR |
-		BONITO_ICU_RETRYERR | BONITO_ICU_MBOXES;
-	BONITO_INTSTEER = 0;
+	LOONGSON_INTEDGE = LOONGSON_ICU_SYSTEMERR | LOONGSON_ICU_MASTERERR |
+		LOONGSON_ICU_RETRYERR | LOONGSON_ICU_MBOXES;
+	LOONGSON_INTSTEER = 0;
 
 	/*
 	 * Mask out all interrupt by writing "1" to all bit position in
 	 * the interrupt reset reg.
 	 */
-	BONITO_INTENCLR = ~0;
+	LOONGSON_INTENCLR = ~0;
 
 	/* init all controller
 	 *   0-15         ------> i8259 interrupt
@@ -125,10 +124,10 @@ void __init arch_init_irq(void)
 	bonito_irq_init();
 
 	/*
-	printk("GPIODATA=%x, GPIOIE=%x\n", BONITO_GPIODATA, BONITO_GPIOIE);
+	printk("GPIODATA=%x, GPIOIE=%x\n", LOONGSON_GPIODATA, LOONGSON_GPIOIE);
 	printk("INTEN=%x, INTSET=%x, INTCLR=%x, INTISR=%x\n",
-			BONITO_INTEN, BONITO_INTENSET,
-			BONITO_INTENCLR, BONITO_INTISR);
+			LOONGSON_INTEN, LOONGSON_INTENSET,
+			LOONGSON_INTENCLR, LOONGSON_INTISR);
 	*/
 
 	/* bonito irq at IP2 */
arch/mips/loongson/fuloong-2e/pci.c +8 -7
index 4c4bc07..1d81110 100644
@@ -29,7 +29,8 @@
 #include <linux/pci.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
-#include <asm/mips-boards/bonito64.h>
+
+#include <loongson.h>
 #include <pci.h>
 
 static struct resource loongson2e_pci_mem_resource = {
@@ -47,7 +48,7 @@ static struct resource loongson2e_pci_io_resource = {
 };
 
 static struct pci_controller  loongson2e_pci_controller = {
-	.pci_ops        = &bonito64_pci_ops,
+	.pci_ops        = &loongson_pci_ops,
 	.io_resource    = &loongson2e_pci_io_resource,
 	.mem_resource   = &loongson2e_pci_mem_resource,
 	.mem_offset     = 0x00000000UL,
@@ -64,17 +65,17 @@ static void __init ict_pcimap(void)
 	 * pcimap: bit18,pcimap_2; bit[17-12],lo2;bit[11-6],lo1;bit[5-0],lo0
 	 */
 	/* 1,00 0110 ,0001 01,00 0000 */
-	BONITO_PCIMAP = 0x46140;
+	LOONGSON_PCIMAP = 0x46140;
 
 	/* 1, 00 0010, 0000,01, 00 0000 */
-	/* BONITO_PCIMAP = 0x42040; */
+	/* LOONGSON_PCIMAP = 0x42040; */
 
 	/*
 	 * PCI to local mapping: [2G,2G+256M] -> [0,256M]
 	 */
-	BONITO_PCIBASE0 = 0x80000000;
-	BONITO_PCIBASE1 = 0x00800000;
-	BONITO_PCIBASE2 = 0x90000000;
+	LOONGSON_PCIBASE0 = 0x80000000;
+	LOONGSON_PCIBASE1 = 0x00800000;
+	LOONGSON_PCIBASE2 = 0x90000000;
 
 }
 
arch/mips/pci/Makefile +1 -1
index 1c66fc0..a0cc238 100644
@@ -26,7 +26,7 @@ obj-$(CONFIG_MIPS_COBALT)	+= fixup-cobalt.o
 obj-$(CONFIG_SOC_AU1500)	+= fixup-au1000.o ops-au1000.o
 obj-$(CONFIG_SOC_AU1550)	+= fixup-au1000.o ops-au1000.o
 obj-$(CONFIG_SOC_PNX8550)	+= fixup-pnx8550.o ops-pnx8550.o
-obj-$(CONFIG_LEMOTE_FULOONG2E)	+= fixup-fuloong2e.o ops-bonito64.o
+obj-$(CONFIG_LEMOTE_FULOONG2E)	+= fixup-fuloong2e.o ops-fuloong2e.o
 obj-$(CONFIG_MIPS_MALTA)	+= fixup-malta.o
 obj-$(CONFIG_PMC_MSP7120_GW)	+= fixup-pmcmsp.o ops-pmcmsp.o
 obj-$(CONFIG_PMC_MSP7120_EVAL)	+= fixup-pmcmsp.o ops-pmcmsp.o
arch/mips/pci/fixup-fuloong2e.c +3 -2
index bd26008..0e3c5de 100644
@@ -31,7 +31,8 @@
  */
 #include <linux/init.h>
 #include <linux/pci.h>
-#include <asm/mips-boards/bonito64.h>
+
+#include <loongson.h>
 
 /* South bridge slot number is set by the pci probe process */
 static u8 sb_slot = 5;
@@ -53,7 +54,7 @@ int __init pcibios_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
 			break;
 		}
 	} else {
-		irq = BONITO_IRQ_BASE + 25 + pin;
+		irq = LOONGSON_IRQ_BASE + 25 + pin;
 	}
 	return irq;
 
arch/mips/pci/ops-bonito64.c +0 -7
index e3b091d..39de8cb 100644
@@ -29,14 +29,9 @@
 #define PCI_ACCESS_READ  0
 #define PCI_ACCESS_WRITE 1
 
-#ifdef CONFIG_LEMOTE_FULOONG2E
-#define CFG_SPACE_REG(offset) (void *)CKSEG1ADDR(BONITO_PCICFG_BASE | (offset))
-#define ID_SEL_BEGIN 11
-#else
 #define CFG_SPACE_REG(offset) \
 	(void *)CKSEG1ADDR(_pcictrl_bonito_pcicfg + (offset))
 #define ID_SEL_BEGIN 10
-#endif
 #define MAX_DEV_NUM (31 - ID_SEL_BEGIN)
 
 
@@ -78,11 +73,9 @@ static int bonito64_pcibios_config_access(unsigned char access_type,
 	addrp = CFG_SPACE_REG(addr & 0xffff);
 	if (access_type == PCI_ACCESS_WRITE) {
 		writel(cpu_to_le32(*data), addrp);
-#ifndef CONFIG_LEMOTE_FULOONG2E
 		/* Wait till done */
 		while (BONITO_PCIMSTAT & 0xF)
 			;
-#endif
 	} else {
 		*data = le32_to_cpu(readl(addrp));
 	}
arch/mips/pci/ops-fuloong2e.c new file +160 -0

160 lines not on this page · raw message

Signature · 1 line
1.6.0.4
#3 lore raw

PATCH 6/25 divide the files to the smallest logic unit

In reply to a message not in the archive

From: Wu Zhangjin <[email protected]>

to enhance the maintainability and scalability of the source code, there is a need to divide the files to the smallest logic function unit.

at the same time, the header files references are cleaned up, and some loongson2e* names are changed to loongson* for future source code sharing between loongson-2e and loongson-2f

---
 arch/mips/include/asm/mach-loongson/loongson.h |    4 +
 arch/mips/include/asm/mach-loongson/pci.h      |    7 +-
 arch/mips/loongson/fuloong-2e/Makefile         |    3 +-
 arch/mips/loongson/fuloong-2e/bonito-irq.c     |    7 +--
 arch/mips/loongson/fuloong-2e/cmdline.c        |   77 ++++++++++++++++++
 arch/mips/loongson/fuloong-2e/init.c           |   40 +++++++++
 arch/mips/loongson/fuloong-2e/irq.c            |    5 +-
 arch/mips/loongson/fuloong-2e/mem.c            |   18 ++++-
 arch/mips/loongson/fuloong-2e/misc.c           |   13 +++
 arch/mips/loongson/fuloong-2e/pci.c            |   30 +++----
 arch/mips/loongson/fuloong-2e/prom.c           |   90 ---------------------
 arch/mips/loongson/fuloong-2e/setup.c          |  103 ++++++++----------------
 arch/mips/loongson/fuloong-2e/time.c           |   27 ++++++
 13 files changed, 230 insertions(+), 194 deletions(-)
 create mode 100644 arch/mips/loongson/fuloong-2e/cmdline.c
 create mode 100644 arch/mips/loongson/fuloong-2e/init.c
 create mode 100644 arch/mips/loongson/fuloong-2e/misc.c
 delete mode 100644 arch/mips/loongson/fuloong-2e/prom.c
 create mode 100644 arch/mips/loongson/fuloong-2e/time.c
arch/mips/include/asm/mach-loongson/loongson.h +4 -0
index 26308b5..bce85a8 100644
@@ -24,6 +24,10 @@ extern unsigned long memsize, highmemsize;
 /* loongson-based machines specific reboot setup */
 extern void loongson_reboot_setup(void);
 
+/* loongson-specific command line and memory initialization */
+extern void __init prom_init_memory(void);
+extern void __init prom_init_cmdline(void);
+
 #define LOONGSON_REG(x) \
 	(*(u32 *)((char *)CKSEG1ADDR(LOONGSON_REG_BASE) + (x)))
 #define LOONGSON_IRQ_BASE	32
arch/mips/include/asm/mach-loongson/pci.h +3 -4
index 9a351be..8f02486 100644
@@ -24,9 +24,8 @@
 
 extern struct pci_ops loongson_pci_ops;
 
-#define LOONGSON2E_PCI_MEM_START	0x14000000UL
-#define LOONGSON2E_PCI_MEM_END		0x1fffffffUL
-#define LOONGSON2E_PCI_IO_START		0x00004000UL
-#define LOONGSON2E_IO_PORT_BASE		0x1fd00000UL
+#define LOONGSON_PCI_MEM_START	0x14000000UL
+#define LOONGSON_PCI_MEM_END	0x1fffffffUL
+#define LOONGSON_PCI_IO_START	0x00004000UL
 
 #endif /* !_LOONGSON_PCI_H_ */
arch/mips/loongson/fuloong-2e/Makefile +2 -1
index d34671d..796e729 100644
@@ -2,6 +2,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 mem.o
+obj-y += setup.o init.o cmdline.o time.o reset.o irq.o \
+	pci.o bonito-irq.o dbg_io.o mem.o misc.o
 
 EXTRA_CFLAGS += -Werror
arch/mips/loongson/fuloong-2e/bonito-irq.c +1 -6
index 91b9c08..8a32651 100644
@@ -27,16 +27,11 @@
  *  675 Mass Ave, Cambridge, MA 02139, USA.
  *
  */
-#include <linux/errno.h>
-#include <linux/init.h>
-#include <linux/io.h>
-#include <linux/types.h>
+
 #include <linux/interrupt.h>
-#include <linux/irq.h>
 
 #include <loongson.h>
 
-
 static inline void bonito_irq_enable(unsigned int irq)
 {
 	LOONGSON_INTENSET = (1 << (irq - LOONGSON_IRQ_BASE));
arch/mips/loongson/fuloong-2e/cmdline.c new file +77 -0

77 lines not on this page · raw message

arch/mips/loongson/fuloong-2e/init.c new file +40 -0
new file mode 100644
index 0000000..76e6fda
@@ -0,0 +1,40 @@
+/*
+ * Based on Ocelot Linux port, which is
+ * Copyright 2001 MontaVista Software Inc.
+ * Author: [email protected] or [email protected]
+ *
+ * Copyright 2003 ICT CAS
+ * Author: Michael Guo <[email protected]>
+ *
+ * Copyright (C) 2007 Lemote Inc. & Insititute of Computing Technology
+ * Author: Fuxin Zhang, [email protected]
+ *
+ * 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/bootmem.h>
+
+#include <asm/bootinfo.h>
+#include <asm/cpu.h>
+
+#include <loongson.h>
+
+void __init prom_init(void)
+{
+	/* init mach type, does we need to init it?? */
+	mips_machtype = PRID_IMP_LOONGSON2;
+
+	/* init several base address */
+	set_io_port_base((unsigned long)
+			 ioremap(LOONGSON_PCIIO_BASE, LOONGSON_PCIIO_SIZE));
+
+	prom_init_cmdline();
+	prom_init_memory();
+}
+
+void __init prom_free_prom_memory(void)
+{
+}
arch/mips/loongson/fuloong-2e/irq.c +1 -4
index 20030c0..d4db5e1 100644
@@ -23,15 +23,12 @@
  *  675 Mass Ave, Cambridge, MA 02139, USA.
  *
  */
+
 #include <linux/delay.h>
-#include <linux/io.h>
-#include <linux/init.h>
 #include <linux/interrupt.h>
-#include <linux/irq.h>
 
 #include <asm/irq_cpu.h>
 #include <asm/i8259.h>
-#include <asm/mipsregs.h>
 
 #include <loongson.h>
 
arch/mips/loongson/fuloong-2e/mem.c +17 -1
index 16cd215..2a0f4e6 100644
@@ -4,9 +4,25 @@
  * Free Software Foundation;  either version 2 of the  License, or (at your
  * option) any later version.
  */
+
 #include <linux/fs.h>
-#include <linux/fcntl.h>
 #include <linux/mm.h>
+#include <linux/init.h>
+
+#include <asm/bootinfo.h>
+
+#include <loongson.h>
+
+void __init prom_init_memory(void)
+{
+	add_memory_region(0x0, (memsize << 20), BOOT_MEM_RAM);
+#ifdef CONFIG_64BIT
+	if (highmemsize > 0) {
+		add_memory_region(0x20000000,
+				  highmemsize << 20, BOOT_MEM_RAM);
+	}
+#endif				/* CONFIG_64BIT */
+}
 
 /* override of arch/mips/mm/cache.c: __uncached_access */
 int __uncached_access(struct file *file, unsigned long addr)
arch/mips/loongson/fuloong-2e/misc.c new file +13 -0
new file mode 100644
index 0000000..d9532ca
@@ -0,0 +1,13 @@
+/* Copyright (C) 2009 Lemote Inc. & Insititute of Computing Technology
+ * Author: Wu Zhangjin, [email protected]
+ *
+ * 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.
+ */
+
+const char *get_system_type(void)
+{
+	return "fuloong-2e";
+}
arch/mips/loongson/fuloong-2e/pci.c +12 -18
index 1d81110..cfc09a1 100644
@@ -25,32 +25,29 @@
  *  675 Mass Ave, Cambridge, MA 02139, USA.
  *
  */
-#include <linux/types.h>
 #include <linux/pci.h>
-#include <linux/kernel.h>
-#include <linux/init.h>
 
 #include <loongson.h>
 #include <pci.h>
 
-static struct resource loongson2e_pci_mem_resource = {
-	.name   = "LOONGSON2E PCI MEM",
-	.start  = LOONGSON2E_PCI_MEM_START,
-	.end    = LOONGSON2E_PCI_MEM_END,
+static struct resource loongson_pci_mem_resource = {
+	.name   = "LOONGSON PCI MEM",
+	.start  = LOONGSON_PCI_MEM_START,
+	.end    = LOONGSON_PCI_MEM_END,
 	.flags  = IORESOURCE_MEM,
 };
 
-static struct resource loongson2e_pci_io_resource = {
-	.name   = "LOONGSON2E PCI IO MEM",
-	.start  = LOONGSON2E_PCI_IO_START,
+static struct resource loongson_pci_io_resource = {
+	.name   = "LOONGSON PCI IO MEM",
+	.start  = LOONGSON_PCI_IO_START,
 	.end    = IO_SPACE_LIMIT,
 	.flags  = IORESOURCE_IO,
 };
 
-static struct pci_controller  loongson2e_pci_controller = {
+static struct pci_controller  loongson_pci_controller = {
 	.pci_ops        = &loongson_pci_ops,
-	.io_resource    = &loongson2e_pci_io_resource,
-	.mem_resource   = &loongson2e_pci_mem_resource,
+	.io_resource    = &loongson_pci_io_resource,
+	.mem_resource   = &loongson_pci_mem_resource,
 	.mem_offset     = 0x00000000UL,
 	.io_offset      = 0x00000000UL,
 };
@@ -83,12 +80,9 @@ static int __init pcibios_init(void)
 {
 	ict_pcimap();
 
-	loongson2e_pci_controller.io_map_base =
-	    (unsigned long) ioremap(LOONGSON2E_IO_PORT_BASE,
-				    loongson2e_pci_io_resource.end -
-				    loongson2e_pci_io_resource.start + 1);
+	loongson_pci_controller.io_map_base = mips_io_port_base;
 
-	register_pci_controller(&loongson2e_pci_controller);
+	register_pci_controller(&loongson_pci_controller);
 
 	return 0;
 }
arch/mips/loongson/fuloong-2e/prom.c deleted +0 -90

90 lines not on this page · raw message

arch/mips/loongson/fuloong-2e/setup.c +33 -70

141 lines not on this page · raw message

arch/mips/loongson/fuloong-2e/time.c new file +27 -0
new file mode 100644
index 0000000..231f0c2
@@ -0,0 +1,27 @@
+/*
+ * board dependent boot routines
+ *
+ * Copyright (C) 2007 Lemote Inc. & Insititute of Computing Technology
+ * Author: Fuxin Zhang, [email protected]
+ *
+ *  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 <asm/mc146818-time.h>
+#include <asm/time.h>
+
+#include <loongson.h>
+
+unsigned long read_persistent_clock(void)
+{
+	return mc146818_get_cmos_time();
+}
+
+void __init plat_time_init(void)
+{
+	/* setup mips r4k timer */
+	mips_hpt_frequency = cpu_clock_freq / 2;
+}
Signature · 1 line
1.6.0.4
#4 lore raw

PATCH 7/25 replace tons of magic numbers by understandable symbols

In reply to a message not in the archive

From: Wu Zhangjin <[email protected]>

tons of magic numbers are replaced by understandable symbols, and two new header files are added to support this substitution.

---
 arch/mips/include/asm/mach-loongson/loongson.h |    3 ++
 arch/mips/include/asm/mach-loongson/machine.h  |   27 ++++++++++++++++++
 arch/mips/include/asm/mach-loongson/mem.h      |    8 +++++
 arch/mips/loongson/fuloong-2e/bonito-irq.c     |    3 +-
 arch/mips/loongson/fuloong-2e/dbg_io.c         |   12 +++----
 arch/mips/loongson/fuloong-2e/irq.c            |    7 ++--
 arch/mips/loongson/fuloong-2e/mem.c            |    9 +++--
 arch/mips/loongson/fuloong-2e/misc.c           |    4 ++-
 arch/mips/loongson/fuloong-2e/pci.c            |   36 ++++++++++++++++--------
 arch/mips/loongson/fuloong-2e/reset.c          |   19 +++++++-----
 arch/mips/loongson/fuloong-2e/setup.c          |    5 ++-
 11 files changed, 96 insertions(+), 37 deletions(-)
 create mode 100644 arch/mips/include/asm/mach-loongson/machine.h
 create mode 100644 arch/mips/include/asm/mach-loongson/mem.h
arch/mips/include/asm/mach-loongson/loongson.h +3 -0
index bce85a8..5ad629e 100644
@@ -14,6 +14,9 @@
 #ifndef __LOONGSON_H
 #define __LOONGSON_H
 
+#include <linux/io.h>
+#include <linux/init.h>
+
 /* loongson internal northbridge initialization */
 extern void bonito_irq_init(void);
 
arch/mips/include/asm/mach-loongson/machine.h new file +27 -0
new file mode 100644
index 0000000..651a35d
@@ -0,0 +1,27 @@
+/*
+ * board-specific header file
+ *
+ * Copyright (c) 2009 Wu Zhangjin <[email protected]>
+ *
+ * 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 __MACHINE_H
+#define __MACHINE_H
+
+#define MACH_NAME			"lemote-fuloong(2e)"
+
+#define LOONGSON_UART_BASE		(LOONGSON_PCIIO_BASE + 0x3f8)
+
+#define LOONGSON_NORTH_BRIDGE_IRQ	(MIPS_CPU_IRQ_BASE + 2)
+#define LOONGSON_UART_IRQ		(MIPS_CPU_IRQ_BASE + 4)
+#define LOONGSON_SOUTH_BRIDGE_IRQ 	(MIPS_CPU_IRQ_BASE + 5)
+#define LOONGSON_TIMER_IRQ        	(MIPS_CPU_IRQ_BASE + 7)
+#define LOONGSON_DMATIMEOUT_IRQ		(LOONGSON_IRQ_BASE + 10)
+
+
+#endif				/* ! __MACHINE_H */
arch/mips/include/asm/mach-loongson/mem.h new file +8 -0
new file mode 100644
index 0000000..ad01dc2
@@ -0,0 +1,8 @@
+#ifndef __MEM_H
+#define __MEM_H
+
+#define LOONGSON_HIGHMEM_START	0x20000000
+#define LOONGSON_MMIO_MEM_START 0x10000000
+#define LOONGSON_MMIO_MEM_END	0x20000000
+
+#endif	/* !__MEM_H */
arch/mips/loongson/fuloong-2e/bonito-irq.c +2 -1
index 8a32651..1f43447 100644
@@ -31,6 +31,7 @@
 #include <linux/interrupt.h>
 
 #include <loongson.h>
+#include <machine.h>
 
 static inline void bonito_irq_enable(unsigned int irq)
 {
@@ -64,5 +65,5 @@ void bonito_irq_init(void)
 	for (i = LOONGSON_IRQ_BASE; i < LOONGSON_IRQ_BASE + 32; i++)
 		set_irq_chip_and_handler(i, &bonito_irq_type, handle_level_irq);
 
-	setup_irq(LOONGSON_IRQ_BASE + 10, &dma_timeout_irqaction);
+	setup_irq(LOONGSON_DMATIMEOUT_IRQ, &dma_timeout_irqaction);
 }
arch/mips/loongson/fuloong-2e/dbg_io.c +5 -7
index 84f8320..1ace08f 100644
@@ -28,12 +28,13 @@
  *
  */
 
-#include <linux/io.h>
-#include <linux/init.h>
 #include <linux/types.h>
 
 #include <asm/serial.h>
 
+#include <loongson.h>
+#include <machine.h>
+
 #define         UART16550_BAUD_2400             2400
 #define         UART16550_BAUD_4800             4800
 #define         UART16550_BAUD_9600             9600
@@ -59,11 +60,8 @@
 /* ----------------------------------------------------- */
 
 /* === CONFIG === */
-#ifdef CONFIG_64BIT
-#define         BASE                    (0xffffffffbfd003f8)
-#else
-#define         BASE                    (0xbfd003f8)
-#endif
+
+#define		BASE			ioremap_nocache(LOONGSON_UART_BASE, 8)
 
 #define         MAX_BAUD                BASE_BAUD
 /* === END OF CONFIG === */
arch/mips/loongson/fuloong-2e/irq.c +4 -3
index d4db5e1..7bf9e18 100644
@@ -31,6 +31,7 @@
 #include <asm/i8259.h>
 
 #include <loongson.h>
+#include <machine.h>
 
 /*
  * the first level int-handler will jump here if it is a bonito irq
@@ -75,7 +76,7 @@ asmlinkage void plat_irq_dispatch(void)
 	unsigned int pending = read_c0_cause() & read_c0_status() & ST0_IM;
 
 	if (pending & CAUSEF_IP7)
-		do_IRQ(MIPS_CPU_IRQ_BASE + 7);
+		do_IRQ(LOONGSON_TIMER_IRQ);
 	else if (pending & CAUSEF_IP5)
 		i8259_irqdispatch();
 	else if (pending & CAUSEF_IP2)
@@ -128,8 +129,8 @@ void __init arch_init_irq(void)
 	*/
 
 	/* bonito irq at IP2 */
-	setup_irq(MIPS_CPU_IRQ_BASE + 2, &cascade_irqaction);
+	setup_irq(LOONGSON_NORTH_BRIDGE_IRQ, &cascade_irqaction);
 	/* 8259 irq at IP5 */
-	setup_irq(MIPS_CPU_IRQ_BASE + 5, &cascade_irqaction);
+	setup_irq(LOONGSON_SOUTH_BRIDGE_IRQ, &cascade_irqaction);
 
 }
arch/mips/loongson/fuloong-2e/mem.c +5 -4
index 2a0f4e6..7f6ee37 100644
@@ -7,18 +7,18 @@
 
 #include <linux/fs.h>
 #include <linux/mm.h>
-#include <linux/init.h>
 
 #include <asm/bootinfo.h>
 
 #include <loongson.h>
+#include <mem.h>
 
 void __init prom_init_memory(void)
 {
 	add_memory_region(0x0, (memsize << 20), BOOT_MEM_RAM);
 #ifdef CONFIG_64BIT
 	if (highmemsize > 0) {
-		add_memory_region(0x20000000,
+		add_memory_region(LOONGSON_HIGHMEM_START,
 				  highmemsize << 20, BOOT_MEM_RAM);
 	}
 #endif				/* CONFIG_64BIT */
@@ -34,6 +34,7 @@ int __uncached_access(struct file *file, unsigned long addr)
 	 * On the Lemote Loongson 2e system, the peripheral registers
 	 * reside between 0x1000:0000 and 0x2000:0000.
 	 */
-	return addr >= __pa(high_memory) ||
-		((addr >= 0x10000000) && (addr < 0x20000000));
+	return addr >= __pa(high_memory) || \
+		((addr >= LOONGSON_MMIO_MEM_START) && \
+			(addr < LOONGSON_MMIO_MEM_END));
 }
arch/mips/loongson/fuloong-2e/misc.c +3 -1
index d9532ca..1b8044c 100644
@@ -7,7 +7,9 @@
  * option) any later version.
  */
 
+#include <machine.h>
+
 const char *get_system_type(void)
 {
-	return "fuloong-2e";
+	return MACH_NAME;
 }
arch/mips/loongson/fuloong-2e/pci.c +24 -12
index cfc09a1..89bc1af 100644
@@ -55,25 +55,37 @@ static struct pci_controller  loongson_pci_controller = {
 static void __init ict_pcimap(void)
 {
 	/*
-	 * local to PCI mapping: [256M,512M] -> [256M,512M]; differ from PMON
+	 * local to PCI mapping for CPU accessing PCI space
 	 *
 	 * CPU address space [256M,448M] is window for accessing pci space
-	 * we set pcimap_lo[0,1,2] to map it to pci space [256M,448M]
-	 * pcimap: bit18,pcimap_2; bit[17-12],lo2;bit[11-6],lo1;bit[5-0],lo0
+	 * we set pcimap_lo[0,1,2] to map it to pci space[0M, 64M], [320M,448M]
+	 *
+	 * pcimap:  PCI_MAP2  PCI_Mem_Lo2 PCI_Mem_Lo1 PCI_Mem_Lo0
+	 *            [<2G]   [384M,448M] [320M,384M] [0M,64M]
 	 */
-	/* 1,00 0110 ,0001 01,00 0000 */
-	LOONGSON_PCIMAP = 0x46140;
-
-	/* 1, 00 0010, 0000,01, 00 0000 */
-	/* LOONGSON_PCIMAP = 0x42040; */
+	LOONGSON_PCIMAP = LOONGSON_PCIMAP_PCIMAP_2 |
+	    LOONGSON_PCIMAP_WIN(2, 0x18000000) |
+	    LOONGSON_PCIMAP_WIN(1, 0x14000000) |
+	    LOONGSON_PCIMAP_WIN(0, 0);
 
 	/*
-	 * PCI to local mapping: [2G,2G+256M] -> [0,256M]
+	 * PCI-DMA to local mapping: [2G,2G+256M] -> [0M,256M]
 	 */
-	LOONGSON_PCIBASE0 = 0x80000000;
-	LOONGSON_PCIBASE1 = 0x00800000;
-	LOONGSON_PCIBASE2 = 0x90000000;
+	LOONGSON_PCIBASE0 = 0x80000000ul;	/* base: 2G -> mmap: 0M */
+	/* size: 256M, burst transmission, pre-fetch enable, 64bit */
+	LOONGSON_PCI_HIT0_SEL_L = 0xc000000cul;
+	LOONGSON_PCI_HIT0_SEL_H = 0xfffffffful;
+	LOONGSON_PCI_HIT1_SEL_L = 0x00000006ul;	/* set this BAR as invalid */
+	LOONGSON_PCI_HIT1_SEL_H = 0x00000000ul;
+	LOONGSON_PCI_HIT2_SEL_L = 0x00000006ul;	/* set this BAR as invalid */
+	LOONGSON_PCI_HIT2_SEL_H = 0x00000000ul;
+
+	/* avoid deadlock of PCI reading/writing lock operation */
+	LOONGSON_PCI_ISR4C = 0xd2000001ul;
 
+	/* can not change gnt to break pci transfer when device's gnt not
+	deassert for some broken device */
+	LOONGSON_PXARB_CFG = 0x00fe0105ul;
 }
 
 static int __init pcibios_init(void)
arch/mips/loongson/fuloong-2e/reset.c +11 -8
index 769a2ce..87244a1 100644
@@ -6,21 +6,24 @@
  *
  * Copyright (C) 2007 Lemote, Inc. & Institute of Computing Technology
  * Author: Fuxin Zhang, [email protected]
+ *
+ * Copyright (c) 2009 Philippe Vachon <[email protected]>
+ *
+ * Copyright (c) 2009 Lemote, Inc. & Institute of Computing Technology
+ * Author: Wu Zhangjin, [email protected]
  */
 #include <linux/pm.h>
 
 #include <asm/reboot.h>
+#include <loongson.h>
 
 static void loongson_restart(char *command)
 {
-#ifdef CONFIG_32BIT
-	*(unsigned long *)0xbfe00104 &= ~(1 << 2);
-	*(unsigned long *)0xbfe00104 |= (1 << 2);
-#else
-	*(unsigned long *)0xffffffffbfe00104 &= ~(1 << 2);
-	*(unsigned long *)0xffffffffbfe00104 |= (1 << 2);
-#endif
-	__asm__ __volatile__("jr\t%0" : : "r"(0xbfc00000));
+	LOONGSON_GENCFG &= ~LOONGSON_GENCFG_CPUSELFRESET;
+	LOONGSON_GENCFG |= LOONGSON_GENCFG_CPUSELFRESET;
+
+	/* reboot via jumping to 0xbfc00000 */
+	((void (*)(void))ioremap_nocache(LOONGSON_BOOT_BASE, 4)) ();
 }
 
 static void loongson_halt(void)
arch/mips/loongson/fuloong-2e/setup.c +4 -1
index 770d7b5..4fcbe48 100644
@@ -27,7 +27,10 @@ static void loongson_wbflush(void)
 	asm(".set\tpush\n\t"
 	    ".set\tnoreorder\n\t"
 	    ".set mips3\n\t"
-	    "sync\n\t" "nop\n\t" ".set\tpop\n\t" ".set mips0\n\t");
+	    "sync\n\t"
+	    "nop\n\t"
+	    ".set\tpop\n\t"
+	    ".set mips0\n\t");
 }
 
 void __init loongson_wbflush_setup(void)
Signature · 1 line
1.6.0.4
#5 lore raw

PATCH 8/25 clean up the early printk support for fuloong(2e)

In reply to a message not in the archive

From: Wu Zhangjin <[email protected]>

this is originally from the lm2e-fixes branch of Philippe's
git://git.linux-cisco.org/linux-mips.git

---
 arch/mips/loongson/fuloong-2e/Makefile       |    7 +-
 arch/mips/loongson/fuloong-2e/dbg_io.c       |  151 --------------------------
 arch/mips/loongson/fuloong-2e/early_printk.c |   28 +++++
 3 files changed, 34 insertions(+), 152 deletions(-)
 delete mode 100644 arch/mips/loongson/fuloong-2e/dbg_io.c
 create mode 100644 arch/mips/loongson/fuloong-2e/early_printk.c
arch/mips/loongson/fuloong-2e/Makefile +6 -1
index 796e729..035e04c 100644
@@ -3,6 +3,11 @@
 #
 
 obj-y += setup.o init.o cmdline.o time.o reset.o irq.o \
-	pci.o bonito-irq.o dbg_io.o mem.o misc.o
+	pci.o bonito-irq.o mem.o misc.o
+
+#
+# Early printk support
+#
+obj-$(CONFIG_EARLY_PRINTK) += early_printk.o
 
 EXTRA_CFLAGS += -Werror
arch/mips/loongson/fuloong-2e/dbg_io.c deleted +0 -151

151 lines not on this page · raw message

arch/mips/loongson/fuloong-2e/early_printk.c new file +28 -0
new file mode 100644
index 0000000..9f4b881
@@ -0,0 +1,28 @@
+/*  early printk support
+ *
+ *  Copyright (c) 2009 Philippe Vachon <[email protected]>
+ *
+ *  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/types.h>
+#include <linux/serial_reg.h>
+
+#include <loongson.h>
+#include <machine.h>
+
+void prom_putchar(char c)
+{
+	int timeout;
+	phys_addr_t uart_base =
+	    (phys_addr_t) ioremap_nocache(LOONGSON_UART_BASE, 8);
+	char reg = readb((u8 *) (uart_base + UART_LSR)) & UART_LSR_THRE;
+
+	for (timeout = 1024; reg == 0 && timeout > 0; timeout--)
+		reg = readb((u8 *) (uart_base + UART_LSR)) & UART_LSR_THRE;
+
+	writeb(c, (u8 *) (uart_base + UART_TX));
+}
Signature · 1 line
1.6.0.4
#6 lore raw

PATCH 9/25 enable Real Time Clock Support for fuloong(2e)

In reply to a message not in the archive

From: Wu Zhangjin <[email protected]>

by default, RTC_LIB is selected by MIPS, but if RTC_LIB is enabled, Enhanced Real Time Clock Support(RTC) will be disabled, so, to enable it, not select RTC_LIB in LEMOTE_FULOONG2E will fix this problem.

RTC support is needed by some tools like hwclock, if you want hwclock work well, these two jobs need to do:

kernel configuration:

Device Drivers --->
Character devices --->
<*> Enhanced Real Time Clock Support (legacy PC RTC driver)

user-space configuration:

$ mknod /dev/rtc c 10 135

and there is another RTC support in linux, whose kernel option is RTC_CLASS, it should be fixed for fuloong(2e) via enabling the binary mode in driver/rtc/rtc-cmos.c and register the RTC device resource in a machine specific rtc.c

to make hwclock work with it normally, please do:

kernel configuration:

Device Drivers --->
<*> Real Time Clock --->

	<*>   PC-style 'CMOS'

user-space configuration:

$ mknod /dev/rtc0 c 254 0

/dev/rtc0 is the default RTC device file.

---
 arch/mips/Kconfig                      |    2 +-
 arch/mips/loongson/fuloong-2e/Makefile |    7 ++++
 arch/mips/loongson/fuloong-2e/rtc.c    |   55 ++++++++++++++++++++++++++++++++
 drivers/rtc/rtc-cmos.c                 |    8 ++--
 4 files changed, 67 insertions(+), 5 deletions(-)
 create mode 100644 arch/mips/loongson/fuloong-2e/rtc.c
arch/mips/Kconfig +1 -1
index 7897861..4a7e61f 100644
@@ -6,7 +6,7 @@ config MIPS
 	select HAVE_ARCH_KGDB
 	# Horrible source of confusion.  Die, die, die ...
 	select EMBEDDED
-	select RTC_LIB
+	select RTC_LIB if !LEMOTE_FULOONG2E
 
 mainmenu "Linux/MIPS Kernel Configuration"
 
arch/mips/loongson/fuloong-2e/Makefile +7 -0
index 035e04c..76904da 100644
@@ -10,4 +10,11 @@ obj-y += setup.o init.o cmdline.o time.o reset.o irq.o \
 #
 obj-$(CONFIG_EARLY_PRINTK) += early_printk.o
 
+#
+# Enable RTC Class support
+#
+# please enable CONFIG_RTC_DRV_CMOS
+#
+obj-$(CONFIG_RTC_DRV_CMOS) += rtc.o
+
 EXTRA_CFLAGS += -Werror
arch/mips/loongson/fuloong-2e/rtc.c new file +55 -0

55 lines not on this page · raw message

drivers/rtc/rtc-cmos.c +4 -4
index 23e10b6..6f32ac5 100644
@@ -691,7 +691,8 @@ cmos_do_probe(struct device *dev, struct resource *ports, int rtc_irq)
 	 */
 #if	defined(CONFIG_ATARI)
 	address_space = 64;
-#elif defined(__i386__) || defined(__x86_64__) || defined(__arm__) || defined(__sparc__)
+#elif defined(__i386__) || defined(__x86_64__) || defined(__arm__) \
+			|| defined(__sparc__) || defined(__mips__)
 	address_space = 128;
 #else
 #warning Assuming 128 bytes of RTC+NVRAM address space, not 64 bytes.
@@ -756,9 +757,8 @@ cmos_do_probe(struct device *dev, struct resource *ports, int rtc_irq)
 	/* FIXME teach the alarm code how to handle binary mode;
 	 * <asm-generic/rtc.h> doesn't know 12-hour mode either.
 	 */
-	if (is_valid_irq(rtc_irq) &&
-	    (!(rtc_control & RTC_24H) || (rtc_control & (RTC_DM_BINARY)))) {
-		dev_dbg(dev, "only 24-hr BCD mode supported\n");
+	if (is_valid_irq(rtc_irq) && !(rtc_control & RTC_24H)) {
+		dev_dbg(dev, "only 24-hr supported\n");
 		retval = -ENXIO;
 		goto cleanup1;
 	}
Signature · 1 line
1.6.0.4
#7 lore raw

PATCH 10/25 split the loongson-specific part out

In reply to a message not in the archive

From: Wu Zhangjin <[email protected]>

for sharing lots of loongson-specific source code among loongson-based machines, there is a need to split the loongson-specific part out to a common/ directory.

and the machine-specific files are put in the machine-name/ directory.

---
 arch/mips/Kconfig                              |   52 +++++-------
 arch/mips/Makefile                             |    5 +-
 arch/mips/include/asm/mach-loongson/loongson.h |   14 +++-
 arch/mips/loongson/Kconfig                     |   31 +++++++
 arch/mips/loongson/Makefile                    |   11 +++
 arch/mips/loongson/common/Makefile             |   20 +++++
 arch/mips/loongson/common/bonito-irq.c         |   69 +++++++++++++++
 arch/mips/loongson/common/cmdline.c            |   80 +++++++++++++++++
 arch/mips/loongson/common/early_printk.c       |   28 ++++++
 arch/mips/loongson/common/init.c               |   40 +++++++++
 arch/mips/loongson/common/irq.c                |  109 ++++++++++++++++++++++++
 arch/mips/loongson/common/mem.c                |   40 +++++++++
 arch/mips/loongson/common/misc.c               |   15 +++
 arch/mips/loongson/common/pci.c                |  101 ++++++++++++++++++++++
 arch/mips/loongson/common/reset.c              |   38 ++++++++
 arch/mips/loongson/common/rtc.c                |   54 ++++++++++++
 arch/mips/loongson/common/setup.c              |   74 ++++++++++++++++
 arch/mips/loongson/common/time.c               |   27 ++++++
 arch/mips/loongson/fuloong-2e/Makefile         |   17 +---
 arch/mips/loongson/fuloong-2e/bonito-irq.c     |   69 ---------------
 arch/mips/loongson/fuloong-2e/cmdline.c        |   77 -----------------
 arch/mips/loongson/fuloong-2e/early_printk.c   |   28 ------
 arch/mips/loongson/fuloong-2e/init.c           |   40 ---------
 arch/mips/loongson/fuloong-2e/irq.c            |   88 +------------------
 arch/mips/loongson/fuloong-2e/mem.c            |   40 ---------
 arch/mips/loongson/fuloong-2e/misc.c           |   15 ---
 arch/mips/loongson/fuloong-2e/pci.c            |  102 ----------------------
 arch/mips/loongson/fuloong-2e/reset.c          |   36 +++------
 arch/mips/loongson/fuloong-2e/rtc.c            |   55 ------------
 arch/mips/loongson/fuloong-2e/setup.c          |   74 ----------------
 arch/mips/loongson/fuloong-2e/time.c           |   27 ------
 31 files changed, 791 insertions(+), 685 deletions(-)
 create mode 100644 arch/mips/loongson/Kconfig
 create mode 100644 arch/mips/loongson/Makefile
 create mode 100644 arch/mips/loongson/common/Makefile
 create mode 100644 arch/mips/loongson/common/bonito-irq.c
 create mode 100644 arch/mips/loongson/common/cmdline.c
 create mode 100644 arch/mips/loongson/common/early_printk.c
 create mode 100644 arch/mips/loongson/common/init.c
 create mode 100644 arch/mips/loongson/common/irq.c
 create mode 100644 arch/mips/loongson/common/mem.c
 create mode 100644 arch/mips/loongson/common/misc.c
 create mode 100644 arch/mips/loongson/common/pci.c
 create mode 100644 arch/mips/loongson/common/reset.c
 create mode 100644 arch/mips/loongson/common/rtc.c
 create mode 100644 arch/mips/loongson/common/setup.c
 create mode 100644 arch/mips/loongson/common/time.c
 delete mode 100644 arch/mips/loongson/fuloong-2e/bonito-irq.c
 delete mode 100644 arch/mips/loongson/fuloong-2e/cmdline.c
 delete mode 100644 arch/mips/loongson/fuloong-2e/early_printk.c
 delete mode 100644 arch/mips/loongson/fuloong-2e/init.c
 delete mode 100644 arch/mips/loongson/fuloong-2e/mem.c
 delete mode 100644 arch/mips/loongson/fuloong-2e/misc.c
 delete mode 100644 arch/mips/loongson/fuloong-2e/pci.c
 delete mode 100644 arch/mips/loongson/fuloong-2e/rtc.c
 delete mode 100644 arch/mips/loongson/fuloong-2e/setup.c
 delete mode 100644 arch/mips/loongson/fuloong-2e/time.c
arch/mips/Kconfig +21 -31
index 4a7e61f..33a3bc6 100644
@@ -6,7 +6,7 @@ config MIPS
 	select HAVE_ARCH_KGDB
 	# Horrible source of confusion.  Die, die, die ...
 	select EMBEDDED
-	select RTC_LIB if !LEMOTE_FULOONG2E
+	select RTC_LIB if !LOONGSON_SYSTEMS
 
 mainmenu "Linux/MIPS Kernel Configuration"
 
@@ -153,30 +153,15 @@ config LASAT
 	select SYS_SUPPORTS_64BIT_KERNEL if BROKEN
 	select SYS_SUPPORTS_LITTLE_ENDIAN
 
-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 HAVE_STD_PC_SERIAL_PORT
-	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_ISA_DMA_SUPPORT_BROKEN
-	select CPU_HAS_WB
+config LOONGSON_SYSTEMS
+	bool "Loongson Based Machines"
 	help
-	  Lemote Fulong mini-PC board based on the Chinese Loongson-2E CPU and
-	  an FPGA northbridge
+	  This enables the support of Loongson based machines.
+
+	  Loongson is a family of general-purpose MIPS-compatible CPUs.
+	  developed at Institute of Computing Technology (ICT),
+	  Chinese Academy of Sciences (CAS) in the People's Republic
+	  of China. The chief architect is Professor Weiwu Hu.
 
 config MIPS_MALTA
 	bool "MIPS Malta board"
@@ -642,6 +627,7 @@ source "arch/mips/sibyte/Kconfig"
 source "arch/mips/txx9/Kconfig"
 source "arch/mips/vr41xx/Kconfig"
 source "arch/mips/cavium-octeon/Kconfig"
+source "arch/mips/loongson/Kconfig"
 
 endmenu
 
@@ -1004,12 +990,10 @@ choice
 	prompt "CPU type"
 	default CPU_R4X00
 
-config CPU_LOONGSON2
-	bool "Loongson 2"
-	depends on SYS_HAS_CPU_LOONGSON2
-	select CPU_SUPPORTS_32BIT_KERNEL
-	select CPU_SUPPORTS_64BIT_KERNEL
-	select CPU_SUPPORTS_HIGHMEM
+config CPU_LOONGSON2E
+	bool "Loongson 2E"
+	depends on SYS_HAS_CPU_LOONGSON2E
+	select CPU_LOONGSON2
 	help
 	  The Loongson 2E processor implements the MIPS III instruction set
 	  with many extensions.
@@ -1252,7 +1236,13 @@ config CPU_CAVIUM_OCTEON
 
 endchoice
 
-config SYS_HAS_CPU_LOONGSON2
+config CPU_LOONGSON2
+	bool
+	select CPU_SUPPORTS_32BIT_KERNEL
+	select CPU_SUPPORTS_64BIT_KERNEL
+	select CPU_SUPPORTS_HIGHMEM
+
+config SYS_HAS_CPU_LOONGSON2E
 	bool
 
 config SYS_HAS_CPU_MIPS32_R1
arch/mips/Makefile +3 -2
index 55181a4..6801baa 100644
@@ -307,9 +307,10 @@ load-$(CONFIG_WR_PPMC)		+= 0xffffffff80100000
 #
 # lemote fulong mini-PC board
 #
-core-$(CONFIG_LEMOTE_FULOONG2E) +=arch/mips/loongson/fuloong-2e/
+core-$(CONFIG_LOONGSON_SYSTEMS) +=arch/mips/loongson/
+cflags-$(CONFIG_LOONGSON_SYSTEMS) += -I$(srctree)/arch/mips/include/asm/mach-loongson \
+					-mno-branch-likely
 load-$(CONFIG_LEMOTE_FULOONG2E) +=0xffffffff80100000
-cflags-$(CONFIG_LEMOTE_FULOONG2E) += -I$(srctree)/arch/mips/include/asm/mach-loongson
 
 #
 # MIPS Malta board
arch/mips/include/asm/mach-loongson/loongson.h +13 -1
index 5ad629e..656511e 100644
@@ -20,7 +20,7 @@
 /* loongson internal northbridge initialization */
 extern void bonito_irq_init(void);
 
-/* command line */
+/* command line arguments */
 extern unsigned long bus_clock, cpu_clock_freq;
 extern unsigned long memsize, highmemsize;
 
@@ -31,6 +31,18 @@ extern void loongson_reboot_setup(void);
 extern void __init prom_init_memory(void);
 extern void __init prom_init_cmdline(void);
 
+/* irq operation functions */
+extern void bonito_irqdispatch(void);
+extern void i8259_irqdispatch(void);
+extern void __init bonito_irq_init(void);
+extern void __init set_irq_trigger_mode(void);
+extern int mach_i8259_irq(void);
+extern void mach_irq_dispatch(unsigned int pending);
+
+/* machine-specific reboot/halt operation */
+extern void mach_prepare_reboot(void);
+extern void mach_prepare_shutdown(void);
+
 #define LOONGSON_REG(x) \
 	(*(u32 *)((char *)CKSEG1ADDR(LOONGSON_REG_BASE) + (x)))
 #define LOONGSON_IRQ_BASE	32
arch/mips/loongson/Kconfig new file +31 -0
new file mode 100644
index 0000000..5874bf6
@@ -0,0 +1,31 @@
+choice
+	prompt "Machine Type"
+	depends on LOONGSON_SYSTEMS
+
+config LEMOTE_FULOONG2E
+	bool "Lemote Fuloong(2e) mini-PC"
+	select ARCH_SPARSEMEM_ENABLE
+	select CEVT_R4K
+	select CSRC_R4K
+	select SYS_HAS_CPU_LOONGSON2E
+	select DMA_NONCOHERENT
+	select BOOT_ELF32
+	select BOARD_SCACHE
+	select HAVE_STD_PC_SERIAL_PORT
+	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 Fulong mini-PC board based on the Chinese Loongson-2E CPU and
+	  an FPGA northbridge
+
+endchoice
arch/mips/loongson/Makefile new file +11 -0
new file mode 100644
index 0000000..cc9f1c8
@@ -0,0 +1,11 @@
+#
+# Common code for all Loongson based systems
+#
+
+obj-$(CONFIG_LOONGSON_SYSTEMS) += common/
+
+#
+# Lemote Fuloong mini-PC (Loongson 2E-based)
+#
+
+obj-$(CONFIG_LEMOTE_FULOONG2E)	+= fuloong-2e/
arch/mips/loongson/common/Makefile new file +20 -0
new file mode 100644
index 0000000..79b2736
@@ -0,0 +1,20 @@
+#
+# Makefile for loongson based machines.
+#
+
+obj-y += setup.o init.o cmdline.o time.o reset.o irq.o \
+	pci.o bonito-irq.o mem.o misc.o
+
+#
+# Early printk support
+#
+obj-$(CONFIG_EARLY_PRINTK) += early_printk.o
+
+#
+# Enable RTC Class support
+#
+# please enable CONFIG_RTC_DRV_CMOS
+#
+obj-$(CONFIG_RTC_DRV_CMOS) += rtc.o
+
+EXTRA_CFLAGS += -Werror
arch/mips/loongson/common/bonito-irq.c new file +69 -0

69 lines not on this page · raw message

arch/mips/loongson/common/cmdline.c new file +80 -0

80 lines not on this page · raw message

arch/mips/loongson/common/early_printk.c new file +28 -0
new file mode 100644
index 0000000..9f4b881
@@ -0,0 +1,28 @@
+/*  early printk support
+ *
+ *  Copyright (c) 2009 Philippe Vachon <[email protected]>
+ *
+ *  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/types.h>
+#include <linux/serial_reg.h>
+
+#include <loongson.h>
+#include <machine.h>
+
+void prom_putchar(char c)
+{
+	int timeout;
+	phys_addr_t uart_base =
+	    (phys_addr_t) ioremap_nocache(LOONGSON_UART_BASE, 8);
+	char reg = readb((u8 *) (uart_base + UART_LSR)) & UART_LSR_THRE;
+
+	for (timeout = 1024; reg == 0 && timeout > 0; timeout--)
+		reg = readb((u8 *) (uart_base + UART_LSR)) & UART_LSR_THRE;
+
+	writeb(c, (u8 *) (uart_base + UART_TX));
+}
arch/mips/loongson/common/init.c new file +40 -0
new file mode 100644
index 0000000..76e6fda
@@ -0,0 +1,40 @@
+/*
+ * Based on Ocelot Linux port, which is
+ * Copyright 2001 MontaVista Software Inc.
+ * Author: [email protected] or [email protected]
+ *
+ * Copyright 2003 ICT CAS
+ * Author: Michael Guo <[email protected]>
+ *
+ * Copyright (C) 2007 Lemote Inc. & Insititute of Computing Technology
+ * Author: Fuxin Zhang, [email protected]
+ *
+ * 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/bootmem.h>
+
+#include <asm/bootinfo.h>
+#include <asm/cpu.h>
+
+#include <loongson.h>
+
+void __init prom_init(void)
+{
+	/* init mach type, does we need to init it?? */
+	mips_machtype = PRID_IMP_LOONGSON2;
+
+	/* init several base address */
+	set_io_port_base((unsigned long)
+			 ioremap(LOONGSON_PCIIO_BASE, LOONGSON_PCIIO_SIZE));
+
+	prom_init_cmdline();
+	prom_init_memory();
+}
+
+void __init prom_free_prom_memory(void)
+{
+}
arch/mips/loongson/common/irq.c new file +109 -0

109 lines not on this page · raw message

arch/mips/loongson/common/mem.c new file +40 -0
new file mode 100644
index 0000000..17a7278
@@ -0,0 +1,40 @@
+/*
+ * 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/fs.h>
+#include <linux/mm.h>
+
+#include <asm/bootinfo.h>
+
+#include <loongson.h>
+#include <mem.h>
+
+void __init prom_init_memory(void)
+{
+	add_memory_region(0x0, (memsize << 20), BOOT_MEM_RAM);
+#ifdef CONFIG_64BIT
+	if (highmemsize > 0) {
+		add_memory_region(LOONGSON_HIGHMEM_START,
+				  highmemsize << 20, BOOT_MEM_RAM);
+	}
+#endif				/* CONFIG_64BIT */
+}
+
+/* override of arch/mips/mm/cache.c: __uncached_access */
+int __uncached_access(struct file *file, unsigned long addr)
+{
+	if (file->f_flags & O_SYNC)
+		return 1;
+
+	/*
+	 * On the Lemote Loongson 2e system, the peripheral registers
+	 * reside between 0x1000:0000 and 0x2000:0000.
+	 */
+	return addr >= __pa(high_memory) ||
+		((addr >= LOONGSON_MMIO_MEM_START) && \
+			(addr < LOONGSON_MMIO_MEM_END));
+}
arch/mips/loongson/common/misc.c new file +15 -0
new file mode 100644
index 0000000..1b8044c
@@ -0,0 +1,15 @@
+/* Copyright (C) 2009 Lemote Inc. & Insititute of Computing Technology
+ * Author: Wu Zhangjin, [email protected]
+ *
+ * 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 <machine.h>
+
+const char *get_system_type(void)
+{
+	return MACH_NAME;
+}
arch/mips/loongson/common/pci.c new file +101 -0

101 lines not on this page · raw message

arch/mips/loongson/common/reset.c new file +38 -0
new file mode 100644
index 0000000..c3431fb
@@ -0,0 +1,38 @@
+/*
+ * 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.
+ *
+ * Copyright (C) 2007 Lemote, Inc. & Institute of Computing Technology
+ * Author: Fuxin Zhang, [email protected]
+ */
+
+#include <linux/pm.h>
+
+#include <asm/reboot.h>
+
+#include <loongson.h>
+
+static void loongson_restart(char *command)
+{
+	/* perform board-specific pre-reboot operations */
+	mach_prepare_reboot();
+
+	/* reboot via jumping to 0xbfc00000 */
+	((void (*)(void))ioremap_nocache(LOONGSON_BOOT_BASE, 4)) ();
+}
+
+static void loongson_halt(void)
+{
+	mach_prepare_shutdown();
+	while (1)
+		;
+}
+
+void __init loongson_reboot_setup(void)
+{
+	_machine_restart = loongson_restart;
+	_machine_halt = loongson_halt;
+	pm_power_off = loongson_halt;
+}
arch/mips/loongson/common/rtc.c new file +54 -0

54 lines not on this page · raw message

arch/mips/loongson/common/setup.c new file +74 -0

74 lines not on this page · raw message

arch/mips/loongson/common/time.c new file +27 -0
new file mode 100644
index 0000000..231f0c2
@@ -0,0 +1,27 @@
+/*
+ * board dependent boot routines
+ *
+ * Copyright (C) 2007 Lemote Inc. & Insititute of Computing Technology
+ * Author: Fuxin Zhang, [email protected]
+ *
+ *  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 <asm/mc146818-time.h>
+#include <asm/time.h>
+
+#include <loongson.h>
+
+unsigned long read_persistent_clock(void)
+{
+	return mc146818_get_cmos_time();
+}
+
+void __init plat_time_init(void)
+{
+	/* setup mips r4k timer */
+	mips_hpt_frequency = cpu_clock_freq / 2;
+}
arch/mips/loongson/fuloong-2e/Makefile +2 -15
index 76904da..1ee57a1 100644
@@ -1,20 +1,7 @@
 #
-# Makefile for Lemote Fulong mini-PC board.
+# Makefile for fuloong-2e
 #
 
-obj-y += setup.o init.o cmdline.o time.o reset.o irq.o \
-	pci.o bonito-irq.o mem.o misc.o
-
-#
-# Early printk support
-#
-obj-$(CONFIG_EARLY_PRINTK) += early_printk.o
-
-#
-# Enable RTC Class support
-#
-# please enable CONFIG_RTC_DRV_CMOS
-#
-obj-$(CONFIG_RTC_DRV_CMOS) += rtc.o
+obj-y += irq.o reset.o
 
 EXTRA_CFLAGS += -Werror
arch/mips/loongson/fuloong-2e/bonito-irq.c deleted +0 -69

69 lines not on this page · raw message

arch/mips/loongson/fuloong-2e/cmdline.c deleted +0 -77

77 lines not on this page · raw message

arch/mips/loongson/fuloong-2e/early_printk.c deleted +0 -28
deleted file mode 100644
index 9f4b881..0000000
@@ -1,28 +0,0 @@
-/*  early printk support
- *
- *  Copyright (c) 2009 Philippe Vachon <[email protected]>
- *
- *  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/types.h>
-#include <linux/serial_reg.h>
-
-#include <loongson.h>
-#include <machine.h>
-
-void prom_putchar(char c)
-{
-	int timeout;
-	phys_addr_t uart_base =
-	    (phys_addr_t) ioremap_nocache(LOONGSON_UART_BASE, 8);
-	char reg = readb((u8 *) (uart_base + UART_LSR)) & UART_LSR_THRE;
-
-	for (timeout = 1024; reg == 0 && timeout > 0; timeout--)
-		reg = readb((u8 *) (uart_base + UART_LSR)) & UART_LSR_THRE;
-
-	writeb(c, (u8 *) (uart_base + UART_TX));
-}
arch/mips/loongson/fuloong-2e/init.c deleted +0 -40
deleted file mode 100644
index 76e6fda..0000000
@@ -1,40 +0,0 @@
-/*
- * Based on Ocelot Linux port, which is
- * Copyright 2001 MontaVista Software Inc.
- * Author: [email protected] or [email protected]
- *
- * Copyright 2003 ICT CAS
- * Author: Michael Guo <[email protected]>
- *
- * Copyright (C) 2007 Lemote Inc. & Insititute of Computing Technology
- * Author: Fuxin Zhang, [email protected]
- *
- * 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/bootmem.h>
-
-#include <asm/bootinfo.h>
-#include <asm/cpu.h>
-
-#include <loongson.h>
-
-void __init prom_init(void)
-{
-	/* init mach type, does we need to init it?? */
-	mips_machtype = PRID_IMP_LOONGSON2;
-
-	/* init several base address */
-	set_io_port_base((unsigned long)
-			 ioremap(LOONGSON_PCIIO_BASE, LOONGSON_PCIIO_SIZE));
-
-	prom_init_cmdline();
-	prom_init_memory();
-}
-
-void __init prom_free_prom_memory(void)
-{
-}
arch/mips/loongson/fuloong-2e/irq.c +4 -84

113 lines not on this page · raw message

arch/mips/loongson/fuloong-2e/mem.c deleted +0 -40
deleted file mode 100644
index 7f6ee37..0000000
@@ -1,40 +0,0 @@
-/*
- * 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/fs.h>
-#include <linux/mm.h>
-
-#include <asm/bootinfo.h>
-
-#include <loongson.h>
-#include <mem.h>
-
-void __init prom_init_memory(void)
-{
-	add_memory_region(0x0, (memsize << 20), BOOT_MEM_RAM);
-#ifdef CONFIG_64BIT
-	if (highmemsize > 0) {
-		add_memory_region(LOONGSON_HIGHMEM_START,
-				  highmemsize << 20, BOOT_MEM_RAM);
-	}
-#endif				/* CONFIG_64BIT */
-}
-
-/* override of arch/mips/mm/cache.c: __uncached_access */
-int __uncached_access(struct file *file, unsigned long addr)
-{
-	if (file->f_flags & O_SYNC)
-		return 1;
-
-	/*
-	 * On the Lemote Loongson 2e system, the peripheral registers
-	 * reside between 0x1000:0000 and 0x2000:0000.
-	 */
-	return addr >= __pa(high_memory) || \
-		((addr >= LOONGSON_MMIO_MEM_START) && \
-			(addr < LOONGSON_MMIO_MEM_END));
-}
arch/mips/loongson/fuloong-2e/misc.c deleted +0 -15
deleted file mode 100644
index 1b8044c..0000000
@@ -1,15 +0,0 @@
-/* Copyright (C) 2009 Lemote Inc. & Insititute of Computing Technology
- * Author: Wu Zhangjin, [email protected]
- *
- * 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 <machine.h>
-
-const char *get_system_type(void)
-{
-	return MACH_NAME;
-}
arch/mips/loongson/fuloong-2e/pci.c deleted +0 -102

102 lines not on this page · raw message

arch/mips/loongson/fuloong-2e/reset.c +11 -25
index 87244a1..4ad0923 100644
@@ -1,40 +1,26 @@
-/*
+/* Board-specific reboot/shutdown routines
+ * Copyright (c) 2009 Philippe Vachon <[email protected]>
+ *
+ * Copyright (C) 2009 Lemote Inc. & Insititute of Computing Technology
+ * Author: Wu Zhangjin, [email protected]
+ *
  * 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.
- *
- * Copyright (C) 2007 Lemote, Inc. & Institute of Computing Technology
- * Author: Fuxin Zhang, [email protected]
- *
- * Copyright (c) 2009 Philippe Vachon <[email protected]>
- *
- * Copyright (c) 2009 Lemote, Inc. & Institute of Computing Technology
- * Author: Wu Zhangjin, [email protected]
  */
-#include <linux/pm.h>
 
-#include <asm/reboot.h>
+#include <linux/delay.h>
+#include <linux/types.h>
+
 #include <loongson.h>
 
-static void loongson_restart(char *command)
+void mach_prepare_reboot(void)
 {
 	LOONGSON_GENCFG &= ~LOONGSON_GENCFG_CPUSELFRESET;
 	LOONGSON_GENCFG |= LOONGSON_GENCFG_CPUSELFRESET;
-
-	/* reboot via jumping to 0xbfc00000 */
-	((void (*)(void))ioremap_nocache(LOONGSON_BOOT_BASE, 4)) ();
-}
-
-static void loongson_halt(void)
-{
-	while (1)
-		;
 }
 
-void loongson_reboot_setup(void)
+void mach_prepare_shutdown(void)
 {
-	_machine_restart = loongson_restart;
-	_machine_halt = loongson_halt;
-	pm_power_off = loongson_halt;
 }
arch/mips/loongson/fuloong-2e/rtc.c deleted +0 -55

55 lines not on this page · raw message

arch/mips/loongson/fuloong-2e/setup.c deleted +0 -74

74 lines not on this page · raw message

arch/mips/loongson/fuloong-2e/time.c deleted +0 -27
deleted file mode 100644
index 231f0c2..0000000
@@ -1,27 +0,0 @@
-/*
- * board dependent boot routines
- *
- * Copyright (C) 2007 Lemote Inc. & Insititute of Computing Technology
- * Author: Fuxin Zhang, [email protected]
- *
- *  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 <asm/mc146818-time.h>
-#include <asm/time.h>
-
-#include <loongson.h>
-
-unsigned long read_persistent_clock(void)
-{
-	return mc146818_get_cmos_time();
-}
-
-void __init plat_time_init(void)
-{
-	/* setup mips r4k timer */
-	mips_hpt_frequency = cpu_clock_freq / 2;
-}
Signature · 1 line
1.6.0.4
#8 lore raw

Re: [loongson-PATCH-v3 10/25] split the loongson-specific part out

On 21:05 Thu 04 Jun , [email protected] wrote:

[...]

arch/mips/Kconfig

Quoted 1 line
arch/mips/Kconfig +0 -0

[...]

Two cosmetic change suggestions:

Quoted 1 line

+config LOONGSON_SYSTEMS

To keep it in line with other CPU's, I suggest change LOONGSON_SYSTEMS to MACH_LOONGSON. This is really a matter of taste. So take it at your own discretion. And don't forget change all occurrences of CONFIG_LOONGSON_SYSTEMS to CONFIG_MACH_LOONGSON, too.

arch/mips/Kconfig config LASAT · line 157

Quoted 1 line
arch/mips/Kconfig +1 -0
+	bool "Loongson Based Machines"

There is no need to use capital letter in based and machines here.

Thanks!

Signature · 4 lines
Zhang, Le
Gentoo/Loongson Developer
http://zhangle.is-a-geek.org
0260 C902 B8F8 6506 6586 2B90 BC51 C808 1E4E 2973
#9 lore raw

Re: [loongson-PATCH-v3 10/25] split the loongson-specific part out

Quoted 12 lines · Zhang Le

On 21:05 Thu 04 Jun , [email protected] wrote:

[...]

arch/mips/Kconfig

Quoted 1 line
arch/mips/Kconfig +0 -0

[...]

Two cosmetic change suggestions:

Quoted 1 line

+config LOONGSON_SYSTEMS

Quoted 8 lines

To keep it in line with other CPU's, I suggest change LOONGSON_SYSTEMS to MACH_LOONGSON. This is really a matter of taste. So take it at your own discretion. And don't forget change all occurrences of CONFIG_LOONGSON_SYSTEMS to CONFIG_MACH_LOONGSON, too.

arch/mips/Kconfig config LASAT · line 157

Quoted 1 line
arch/mips/Kconfig +1 -0
+	bool "Loongson Based Machines"

There is no need to use capital letter in based and machines here.

seems better, will applied later :-)

best wishes,
Wu Zhangjin

#10 lore raw

PATCH 11/25 split env out of cmdline.c

In reply to a message not in the archive

From: Wu Zhangjin <[email protected]>

add a new init function: prom_init_env() to split environment arguments initialization out of cmdline.c, the environment arguments are passed from bootloader, currently is PMON.

---
 arch/mips/include/asm/mach-loongson/loongson.h |    5 +-
 arch/mips/loongson/common/Makefile             |    2 +-
 arch/mips/loongson/common/cmdline.c            |   36 ++------------
 arch/mips/loongson/common/env.c                |   59 ++++++++++++++++++++++++
 arch/mips/loongson/common/init.c               |    1 +
 5 files changed, 69 insertions(+), 34 deletions(-)
 create mode 100644 arch/mips/loongson/common/env.c
arch/mips/include/asm/mach-loongson/loongson.h +3 -2
index 656511e..ca591ed 100644
@@ -20,16 +20,17 @@
 /* loongson internal northbridge initialization */
 extern void bonito_irq_init(void);
 
-/* command line arguments */
+/* environment arguments from bootloader */
 extern unsigned long bus_clock, cpu_clock_freq;
 extern unsigned long memsize, highmemsize;
 
 /* loongson-based machines specific reboot setup */
 extern void loongson_reboot_setup(void);
 
-/* loongson-specific command line and memory initialization */
+/* loongson-specific command line, env and memory initialization */
 extern void __init prom_init_memory(void);
 extern void __init prom_init_cmdline(void);
+extern void __init prom_init_env(void);
 
 /* irq operation functions */
 extern void bonito_irqdispatch(void);
arch/mips/loongson/common/Makefile +1 -1
index 79b2736..030a0a0 100644
@@ -2,7 +2,7 @@
 # Makefile for loongson based machines.
 #
 
-obj-y += setup.o init.o cmdline.o time.o reset.o irq.o \
+obj-y += setup.o init.o cmdline.o env.o time.o reset.o irq.o \
 	pci.o bonito-irq.o mem.o misc.o
 
 #
arch/mips/loongson/common/cmdline.c +5 -31
index 6f603ac..12bb606 100644
@@ -18,31 +18,23 @@
  * option) any later version.
  */
 
-#include <linux/bootmem.h>
-
 #include <asm/bootinfo.h>
 
-unsigned long bus_clock, cpu_clock_freq;
-unsigned long memsize, highmemsize;
+#include <loongson.h>
+#include <cmdline.h>
 
 int prom_argc;
 /* pmon passes arguments in 32bit pointers */
-int *_prom_argv, *_prom_envp;
-
-#define parse_even_earlier(res, option, p)				\
-do {									\
-	if (strncmp(option, (char *)p, strlen(option)) == 0)		\
-			strict_strtol((char *)p + strlen(option"="),	\
-					10, &res);			\
-} while (0)
+int *_prom_argv;
 
 void __init prom_init_cmdline(void)
 {
 	int i;
 	long l;
+
+	/* firmware arguments are initialized in head.S */
 	prom_argc = fw_arg0;
 	_prom_argv = (int *)fw_arg1;
-	_prom_envp = (int *)fw_arg2;
 
 	/* arg[0] is "g", the rest is boot parameters */
 	arcs_cmdline[0] = '\0';
@@ -55,26 +47,8 @@ void __init prom_init_cmdline(void)
 		strcat(arcs_cmdline, " ");
 	}
 
-	/* handle console, root, busclock, cpuclock, memsize, highmemsize
-	arguments */
-
 	if ((strstr(arcs_cmdline, "console=")) == NULL)
 		strcat(arcs_cmdline, " console=ttyS0,115200");
 	if ((strstr(arcs_cmdline, "root=")) == NULL)
 		strcat(arcs_cmdline, " root=/dev/hda1");
-
-	l = (long)*_prom_envp;
-	while (l != 0) {
-		parse_even_earlier(bus_clock, "busclock", l);
-		parse_even_earlier(cpu_clock_freq, "cpuclock", l);
-		parse_even_earlier(memsize, "memsize", l);
-		parse_even_earlier(highmemsize, "highmemsize", l);
-		_prom_envp++;
-		l = (long)*_prom_envp;
-	}
-	if (memsize == 0)
-		memsize = 256;
-
-	pr_info("busclock=%ld, cpuclock=%ld, memsize=%ld, highmemsize=%ld\n",
-		bus_clock, cpu_clock_freq, memsize, highmemsize);
 }
arch/mips/loongson/common/env.c new file +59 -0

59 lines not on this page · raw message

arch/mips/loongson/common/init.c +1 -0
index 76e6fda..1c5a0e6 100644
@@ -32,6 +32,7 @@ void __init prom_init(void)
 			 ioremap(LOONGSON_PCIIO_BASE, LOONGSON_PCIIO_SIZE));
 
 	prom_init_cmdline();
+	prom_init_env();
 	prom_init_memory();
 }
 
Signature · 1 line
1.6.0.4
#11 lore raw

PATCH 12/25 add basic loongson-2f support

In reply to a message not in the archive

From: Wu Zhangjin <[email protected]>

Loongson2F has built-in DDR2 and PCIX controller. The PCIX controller have a similar programming interface with FPGA northbridge used in Loongson2E.

so, the main difference between loongson-2e and loongson-2f is:

loongson-2f has an extra address windows configuration module, which can be used to map CPU address space to DDR or PCI address space, or map the PCI-DMA address space to DDR or LIO address space.

herein, the module and the operations are abstracted to loongson.h.

NOTE: this module is only available in 64bit kernel.

---
 arch/mips/Kconfig                                  |   18 +++++
 .../mips/include/asm/mach-loongson/dma-coherence.h |    4 +
 arch/mips/include/asm/mach-loongson/loongson.h     |   79 +++++++++++++++++++-
 arch/mips/include/asm/mach-loongson/mem.h          |   23 ++++++
 arch/mips/include/asm/mach-loongson/pci.h          |   30 +++++++-
 arch/mips/loongson/common/init.c                   |   17 ++++
 arch/mips/loongson/common/mem.c                    |   21 ++++-
 arch/mips/loongson/common/pci.c                    |   14 +++-
 8 files changed, 197 insertions(+), 9 deletions(-)
arch/mips/Kconfig +18 -0
index 33a3bc6..74efb43 100644
@@ -998,6 +998,21 @@ config CPU_LOONGSON2E
 	  The Loongson 2E processor implements the MIPS III instruction set
 	  with many extensions.
 
+	  It has an internal FPGA northbridge, which is compatiable to
+	  bonito64.
+
+config CPU_LOONGSON2F
+	bool "Loongson 2F"
+	depends on SYS_HAS_CPU_LOONGSON2F
+	select CPU_LOONGSON2
+	help
+	  The Loongson 2F processor implements the MIPS III instruction set
+	  with many extensions.
+
+	  Loongson2F have built-in DDR2 and PCIX controller. The PCIX controller
+	  have a similar programming interface with FPGA northbridge used in
+	  Loongson2E.
+
 config CPU_MIPS32_R1
 	bool "MIPS32 Release 1"
 	depends on SYS_HAS_CPU_MIPS32_R1
@@ -1245,6 +1260,9 @@ config CPU_LOONGSON2
 config SYS_HAS_CPU_LOONGSON2E
 	bool
 
+config SYS_HAS_CPU_LOONGSON2F
+	bool
+
 config SYS_HAS_CPU_MIPS32_R1
 	bool
 
arch/mips/include/asm/mach-loongson/dma-coherence.h +4 -0
index f27d0f8..6ba8279 100644
@@ -27,7 +27,11 @@ static inline dma_addr_t plat_map_dma_mem_page(struct device *dev,
 
 static inline unsigned long plat_dma_addr_to_phys(dma_addr_t dma_addr)
 {
+#if defined(CONFIG_CPU_LOONGSON2F) & defined(CONFIG_64BIT)
+	return (dma_addr > 0x8fffffff) ? dma_addr : (dma_addr & 0x0fffffff);
+#else
 	return dma_addr & 0x7fffffff;
+#endif
 }
 
 static inline void plat_unmap_dma_mem(struct device *dev, dma_addr_t dma_addr)
arch/mips/include/asm/mach-loongson/loongson.h +78 -1

83 lines not on this page · raw message

arch/mips/include/asm/mach-loongson/mem.h +23 -0
index ad01dc2..fb53be0 100644
@@ -1,8 +1,31 @@
 #ifndef __MEM_H
 #define __MEM_H
 
+/*
+ * high memory space
+ *
+ * in loongson2e, starts from 512M
+ * in loongson2f, starts from 2G + 256M
+ */
+#ifdef CONFIG_CPU_LOONGSON2E
 #define LOONGSON_HIGHMEM_START	0x20000000
+#else
+#define LOONGSON_HIGHMEM_START	0x90000000
+#endif
+
+/*
+ * the peripheral registers(MMIO):
+ *
+ * On the Lemote Loongson 2e system, reside between 0x1000:0000 and 0x2000:0000.
+ * On the Lemote Loongson 2f system, reside between 0x1000:0000 and 0x8000:0000.
+ */
+
 #define LOONGSON_MMIO_MEM_START 0x10000000
+
+#ifdef CONFIG_CPU_LOONGSON2E
 #define LOONGSON_MMIO_MEM_END	0x20000000
+#else
+#define LOONGSON_MMIO_MEM_END	0x80000000
+#endif
 
 #endif	/* !__MEM_H */
arch/mips/include/asm/mach-loongson/pci.h +29 -1
index 8f02486..cdec41c 100644
@@ -1,5 +1,6 @@
 /*
  * Copyright (c) 2008 Zhang Le <[email protected]>
+ * Copyright (c) 2009 Wu Zhangjin <[email protected]>
  *
  * This program is free software; you can redistribute it
  * and/or modify it under the terms of the GNU General
@@ -24,8 +25,35 @@
 
 extern struct pci_ops loongson_pci_ops;
 
+/* this is an offset from mips_io_port_base */
+#define LOONGSON_PCI_IO_START	0x00004000UL
+
+#if defined(CONFIG_CPU_LOONGSON2F) && defined(CONFIG_64BIT)
+
+/*
+ * we use address window2 to map cpu address space to pci space
+ * window2: cpu [1G, 2G] -> pci [1G, 2G]
+ * why not use window 0 & 1? because they are used by cpu when booting.
+ * window0: cpu [0, 256M] -> ddr [0, 256M]
+ * window1: cpu [256M, 512M] -> pci [256M, 512M]
+ */
+
+/* the smallest LOONGSON_CPU_MEM_SRC can be 512M */
+#define LOONGSON_CPU_MEM_SRC	0x40000000ul		/* 1G */
+#define LOONGSON_PCI_MEM_DST	LOONGSON_CPU_MEM_SRC
+
+#define LOONGSON_PCI_MEM_START	LOONGSON_PCI_MEM_DST
+#define LOONGSON_PCI_MEM_END	(0x80000000ul-1)	/* 2G */
+
+#define MMAP_CPUTOPCI_SIZE	(LOONGSON_PCI_MEM_END - \
+					LOONGSON_PCI_MEM_START + 1)
+
+#else	/* loongson2f/32bit & loongson2e */
+
 #define LOONGSON_PCI_MEM_START	0x14000000UL
 #define LOONGSON_PCI_MEM_END	0x1fffffffUL
-#define LOONGSON_PCI_IO_START	0x00004000UL
+
+#endif	/* !(defined(CONFIG_CPU_LOONGSON2F) && defined(CONFIG_64BIT))*/
+
 
 #endif /* !_LOONGSON_PCI_H_ */
arch/mips/loongson/common/init.c +17 -0
index 1c5a0e6..cbb33de 100644
@@ -22,6 +22,17 @@
 
 #include <loongson.h>
 
+#if defined(CONFIG_CPU_LOONGSON2F) && defined(CONFIG_64BIT)
+unsigned long _loongson_addrwincfg_base;
+
+/* Loongson CPU address windows config space base address */
+static inline void set_loongson_addrwincfg_base(unsigned long base)
+{
+	*(unsigned long *)&_loongson_addrwincfg_base = base;
+	barrier();
+}
+#endif
+
 void __init prom_init(void)
 {
 	/* init mach type, does we need to init it?? */
@@ -31,6 +42,12 @@ void __init prom_init(void)
 	set_io_port_base((unsigned long)
 			 ioremap(LOONGSON_PCIIO_BASE, LOONGSON_PCIIO_SIZE));
 
+#if defined(CONFIG_CPU_LOONGSON2F) && defined(CONFIG_64BIT)
+	set_loongson_addrwincfg_base((unsigned long)
+				     ioremap(LOONGSON_ADDRWINCFG_BASE,
+					     LOONGSON_ADDRWINCFG_SIZE));
+#endif
+
 	prom_init_cmdline();
 	prom_init_env();
 	prom_init_memory();
arch/mips/loongson/common/mem.c +17 -4
index 17a7278..9e0b6e0 100644
@@ -17,6 +17,23 @@ void __init prom_init_memory(void)
 {
 	add_memory_region(0x0, (memsize << 20), BOOT_MEM_RAM);
 #ifdef CONFIG_64BIT
+#ifdef CONFIG_CPU_LOONGSON2F
+	{
+		int bit;
+
+		bit = fls(memsize + highmemsize);
+		if (bit != ffs(memsize + highmemsize))
+			bit += 20;
+		else
+			bit = bit + 20 - 1;
+
+		/* set cpu window3 to map CPU to DDR: 2G -> 2G */
+		LOONGSON_ADDRWIN_CPUTODDR(ADDRWIN_WIN3, 0x80000000ul,
+					  0x80000000ul, (1 << bit));
+		mmiowb();
+	}
+#endif				/* CONFIG_CPU_LOONGSON2F */
+
 	if (highmemsize > 0) {
 		add_memory_region(LOONGSON_HIGHMEM_START,
 				  highmemsize << 20, BOOT_MEM_RAM);
@@ -30,10 +47,6 @@ int __uncached_access(struct file *file, unsigned long addr)
 	if (file->f_flags & O_SYNC)
 		return 1;
 
-	/*
-	 * On the Lemote Loongson 2e system, the peripheral registers
-	 * reside between 0x1000:0000 and 0x2000:0000.
-	 */
 	return addr >= __pa(high_memory) ||
 		((addr >= LOONGSON_MMIO_MEM_START) && \
 			(addr < LOONGSON_MMIO_MEM_END));
arch/mips/loongson/common/pci.c +11 -3
index e97c845..e8291c3 100644
@@ -30,15 +30,15 @@
 #include <pci.h>
 
 static struct resource loongson_pci_mem_resource = {
-	.name   = "LOONGSON PCI MEM",
+	.name   = "pci memory space",
 	.start  = LOONGSON_PCI_MEM_START,
 	.end    = LOONGSON_PCI_MEM_END,
 	.flags  = IORESOURCE_MEM,
 };
 
 static struct resource loongson_pci_io_resource = {
-	.name   = "LOONGSON PCI IO MEM",
-	.start  = LOONGSON_PCI_IO_START,
+	.name   = "pci io space",
+	.start  = LOONGSON_PCI_IO_START,	/* reserve regacy I/O space */
 	.end    = IO_SPACE_LIMIT,
 	.flags  = IORESOURCE_IO,
 };
@@ -85,6 +85,14 @@ static void __init ict_pcimap(void)
 	/* can not change gnt to break pci transfer when device's gnt not
 	deassert for some broken device */
 	LOONGSON_PXARB_CFG = 0x00fe0105ul;
+
+#if defined(CONFIG_CPU_LOONGSON2F) && defined(CONFIG_64BIT)
+	/*
+	 * set cpu addr window2 to map CPU address space to PCI address space
+	 */
+	LOONGSON_ADDRWIN_CPUTOPCI(ADDRWIN_WIN2, LOONGSON_CPU_MEM_SRC,
+			LOONGSON_PCI_MEM_DST, MMAP_CPUTOPCI_SIZE);
+#endif
 }
 
 static int __init pcibios_init(void)
Signature · 1 line
1.6.0.4
#12 lore raw

PATCH 13/25 add basic fuloong(2f) support

In reply to a message not in the archive

From: Wu Zhangjin <[email protected]>

fuloong(2e) has an VIA686B south bridge, but fuloong(2f) has an AMD CS5536 south bridge. so, we need to add basic cs5536 south bridge support here.

there are several modules provided by cs5536, currently, only these modules are used in fuloong(2f) mini PC: ide, acc(audio), ohci, isa, and ehci. and these modules are general modules, which means should be compiled in kernel by default, besides, there are several selective
modules: flash(nor and nand), otg, udc. the otg and udc modules are used in the NAS machine made by Lemote(the source code support will be added later, only a few differ from fuloong2f mini PC).

since the PCI operations are similiar between fuloong(2e) and fuloong(2f),yeeloong(2f) and even similiar to gdium, herein, I just rename ops-fuloong2e.c to ops-loongsgon2.c to share most of the source code.

PS: the originl cs5536 support for fuloong2f is from the to-mips branch of git://dev.lemote.com/linux_loongson.git, tons of source code have been cleaned up. the most important change is using the linux-internal pci_regs.h(include/linux/pci_regs.h) instead of the original pcireg.h and dividing the huge cs5536_vsm.c to several small files, one file one cs5536 module. at the same time, tons of souce code are tuned to be understandable and some trashy souce code are removed away which will archieve a higher performance. and also, the header files, cs5536.h and cs5536_pci.h are cleaned up a lot.

---
 arch/mips/Makefile                                 |    1 +
 .../mips/include/asm/mach-loongson/cs5536/cs5536.h |  382 +++++++++++++++++
 .../include/asm/mach-loongson/cs5536/cs5536_pci.h  |  174 ++++++++
 .../include/asm/mach-loongson/cs5536/cs5536_vsm.h  |   59 +++
 arch/mips/include/asm/mach-loongson/loongson.h     |    2 +-
 arch/mips/include/asm/mach-loongson/machine.h      |   30 ++
 arch/mips/loongson/Kconfig                         |   44 ++
 arch/mips/loongson/Makefile                        |    6 +
 arch/mips/loongson/common/Makefile                 |    6 +
 arch/mips/loongson/common/bonito-irq.c             |    5 +
 arch/mips/loongson/common/cs5536/Makefile          |   20 +
 arch/mips/loongson/common/cs5536/cs5536_acc.c      |  156 +++++++
 arch/mips/loongson/common/cs5536/cs5536_ehci.c     |  166 +++++++
 arch/mips/loongson/common/cs5536/cs5536_flash.c    |  452 ++++++++++++++++++++
 arch/mips/loongson/common/cs5536/cs5536_ide.c      |  194 +++++++++
 arch/mips/loongson/common/cs5536/cs5536_isa.c      |  376 ++++++++++++++++
 arch/mips/loongson/common/cs5536/cs5536_ohci.c     |  168 ++++++++
 arch/mips/loongson/common/cs5536/cs5536_otg.c      |  138 ++++++
 arch/mips/loongson/common/cs5536/cs5536_pci.c      |  126 ++++++
 arch/mips/loongson/common/cs5536/cs5536_udc.c      |  143 ++++++
 arch/mips/loongson/fuloong-2f/Makefile             |    5 +
 arch/mips/loongson/fuloong-2f/irq.c                |   53 +++
 arch/mips/loongson/fuloong-2f/reset.c              |   65 +++
 arch/mips/pci/Makefile                             |    3 +-
 arch/mips/pci/fixup-fuloong2f.c                    |  171 ++++++++
 arch/mips/pci/ops-fuloong2e.c                      |  160 -------
 arch/mips/pci/ops-loongson2.c                      |  213 +++++++++
 27 files changed, 3156 insertions(+), 162 deletions(-)
 create mode 100644 arch/mips/include/asm/mach-loongson/cs5536/cs5536.h
 create mode 100644 arch/mips/include/asm/mach-loongson/cs5536/cs5536_pci.h
 create mode 100644 arch/mips/include/asm/mach-loongson/cs5536/cs5536_vsm.h
 create mode 100644 arch/mips/loongson/common/cs5536/Makefile
 create mode 100644 arch/mips/loongson/common/cs5536/cs5536_acc.c
 create mode 100644 arch/mips/loongson/common/cs5536/cs5536_ehci.c
 create mode 100644 arch/mips/loongson/common/cs5536/cs5536_flash.c
 create mode 100644 arch/mips/loongson/common/cs5536/cs5536_ide.c
 create mode 100644 arch/mips/loongson/common/cs5536/cs5536_isa.c
 create mode 100644 arch/mips/loongson/common/cs5536/cs5536_ohci.c
 create mode 100644 arch/mips/loongson/common/cs5536/cs5536_otg.c
 create mode 100644 arch/mips/loongson/common/cs5536/cs5536_pci.c
 create mode 100644 arch/mips/loongson/common/cs5536/cs5536_udc.c
 create mode 100644 arch/mips/loongson/fuloong-2f/Makefile
 create mode 100644 arch/mips/loongson/fuloong-2f/irq.c
 create mode 100644 arch/mips/loongson/fuloong-2f/reset.c
 create mode 100644 arch/mips/pci/fixup-fuloong2f.c
 delete mode 100644 arch/mips/pci/ops-fuloong2e.c
 create mode 100644 arch/mips/pci/ops-loongson2.c
arch/mips/Makefile +1 -0
index 6801baa..74f23ad 100644
@@ -311,6 +311,7 @@ core-$(CONFIG_LOONGSON_SYSTEMS) +=arch/mips/loongson/
 cflags-$(CONFIG_LOONGSON_SYSTEMS) += -I$(srctree)/arch/mips/include/asm/mach-loongson \
 					-mno-branch-likely
 load-$(CONFIG_LEMOTE_FULOONG2E) +=0xffffffff80100000
+load-$(CONFIG_LEMOTE_FULOONG2F) +=0xffffffff80200000
 
 #
 # MIPS Malta board
arch/mips/include/asm/mach-loongson/cs5536/cs5536.h new file +382 -0

382 lines not on this page · raw message

arch/mips/include/asm/mach-loongson/cs5536/cs5536_pci.h new file +174 -0

174 lines not on this page · raw message

arch/mips/include/asm/mach-loongson/cs5536/cs5536_vsm.h new file +59 -0

59 lines not on this page · raw message

arch/mips/include/asm/mach-loongson/loongson.h +1 -1
index b5e3d95..cd6668b 100644
@@ -288,7 +288,7 @@ extern unsigned long _loongson_addrwincfg_base;
 	s##_WIN##w##_BASE = (src); \
 	s##_WIN##w##_MMAP = (src) | ADDRWIN_MAP_DST_##d; \
 	s##_WIN##w##_MASK = ~(size-1); \
-} while (0);
+} while (0)
 
 #define LOONGSON_ADDRWIN_CPUTOPCI(win, src, dst, size) \
 	LOONGSON_ADDRWIN_CFG(CPU, PCI, win, src, dst, size)
arch/mips/include/asm/mach-loongson/machine.h +30 -0
index 651a35d..da6b6d6 100644
@@ -13,6 +13,8 @@
 #ifndef __MACHINE_H
 #define __MACHINE_H
 
+#ifdef CONFIG_LEMOTE_FULOONG2E
+
 #define MACH_NAME			"lemote-fuloong(2e)"
 
 #define LOONGSON_UART_BASE		(LOONGSON_PCIIO_BASE + 0x3f8)
@@ -23,5 +25,33 @@
 #define LOONGSON_TIMER_IRQ        	(MIPS_CPU_IRQ_BASE + 7)
 #define LOONGSON_DMATIMEOUT_IRQ		(LOONGSON_IRQ_BASE + 10)
 
+#else /* CONFIG_LEMOTE_FULOONG2F */
+
+#define MACH_NAME			"lemote-fuloong(2f)"
+
+#define LOONGSON_UART_BASE		(LOONGSON_PCIIO_BASE + 0x2f8)
+
+#define LOONGSON_TIMER_IRQ	(MIPS_CPU_IRQ_BASE + 7)	/* cpu timer */
+#define LOONGSON_PERFCNT_IRQ	(MIPS_CPU_IRQ_BASE + 6) /* cpu perf counter */
+#define LOONGSON_NORTH_BRIDGE_IRQ	(MIPS_CPU_IRQ_BASE + 6)	/* bonito */
+#define LOONGSON_UART_IRQ	(MIPS_CPU_IRQ_BASE + 3)	/* cpu serial port */
+#define LOONGSON_SOUTH_BRIDGE_IRQ	(MIPS_CPU_IRQ_BASE + 2)	/* i8259 */
+
+#define LOONGSON_INT_BIT_GPIO1		(1 << 1)
+#define LOONGSON_INT_BIT_GPIO2		(1 << 2)
+#define LOONGSON_INT_BIT_GPIO3		(1 << 3)
+#define LOONGSON_INT_BIT_PCI_INTA	(1 << 4)
+#define LOONGSON_INT_BIT_PCI_INTB	(1 << 5)
+#define LOONGSON_INT_BIT_PCI_INTC	(1 << 6)
+#define LOONGSON_INT_BIT_PCI_INTD	(1 << 7)
+#define LOONGSON_INT_BIT_PCI_PERR	(1 << 8)
+#define LOONGSON_INT_BIT_PCI_SERR	(1 << 9)
+#define LOONGSON_INT_BIT_DDR		(1 << 10)
+#define LOONGSON_INT_BIT_INT0		(1 << 11)
+#define LOONGSON_INT_BIT_INT1		(1 << 12)
+#define LOONGSON_INT_BIT_INT2		(1 << 13)
+#define LOONGSON_INT_BIT_INT3		(1 << 14)
+
+#endif
 
 #endif				/* ! __MACHINE_H */
arch/mips/loongson/Kconfig +44 -0

48 lines not on this page · raw message

arch/mips/loongson/Makefile +6 -0
index cc9f1c8..e9b8a81 100644
@@ -9,3 +9,9 @@ obj-$(CONFIG_LOONGSON_SYSTEMS) += common/
 #
 
 obj-$(CONFIG_LEMOTE_FULOONG2E)	+= fuloong-2e/
+
+#
+# Lemote Fuloong mini-PC (Loongson 2F-based)
+#
+
+obj-$(CONFIG_LEMOTE_FULOONG2F)	+= fuloong-2f/
arch/mips/loongson/common/Makefile +6 -0
index 030a0a0..d55499e 100644
@@ -17,4 +17,10 @@ obj-$(CONFIG_EARLY_PRINTK) += early_printk.o
 #
 obj-$(CONFIG_RTC_DRV_CMOS) += rtc.o
 
+#
+# Enable CS5536 Virtual Support Module(VSM) for virtulize the PCI configure
+# space
+#
+obj-$(CONFIG_CS5536) += cs5536/
+
 EXTRA_CFLAGS += -Werror
arch/mips/loongson/common/bonito-irq.c +5 -0
index 1f43447..940c1f0 100644
@@ -53,10 +53,13 @@ static struct irq_chip bonito_irq_type = {
 	.unmask	= bonito_irq_enable,
 };
 
+/* there is no need to handle dma timeout in loongson-2f based machines */
+#ifdef CONFIG_CPU_LOONGSON2E
 static struct irqaction dma_timeout_irqaction = {
 	.handler	= no_action,
 	.name		= "dma_timeout",
 };
+#endif
 
 void bonito_irq_init(void)
 {
@@ -65,5 +68,7 @@ void bonito_irq_init(void)
 	for (i = LOONGSON_IRQ_BASE; i < LOONGSON_IRQ_BASE + 32; i++)
 		set_irq_chip_and_handler(i, &bonito_irq_type, handle_level_irq);
 
+#ifdef CONFIG_CPU_LOONGSON2E
 	setup_irq(LOONGSON_DMATIMEOUT_IRQ, &dma_timeout_irqaction);
+#endif
 }
arch/mips/loongson/common/cs5536/Makefile new file +20 -0
new file mode 100644
index 0000000..09bc177
@@ -0,0 +1,20 @@
+#
+# Makefile for CS5536 support.
+#
+
+#
+# core modules
+#
+obj-$(CONFIG_CS5536) += cs5536_pci.o cs5536_ide.o cs5536_acc.o cs5536_ohci.o \
+			cs5536_isa.o cs5536_ehci.o
+#
+# selective modules
+#
+# add a CS5536_[MODULE] to your board in arch/mips/loongson/Kconfig
+#
+obj-$(CONFIG_CS5536_FLASH) += cs5536_flash.o
+obj-$(CONFIG_CS5536_NOR_FLASH) += cs5536_flash.o
+obj-$(CONFIG_CS5536_OTG) += cs5536_otg.o
+obj-$(CONFIG_CS5536_UDC) += cs5536_udc.o
+
+EXTRA_CFLAGS += -Werror
arch/mips/loongson/common/cs5536/cs5536_acc.c new file +156 -0

156 lines not on this page · raw message

arch/mips/loongson/common/cs5536/cs5536_ehci.c new file +166 -0

166 lines not on this page · raw message

arch/mips/loongson/common/cs5536/cs5536_flash.c new file +452 -0

452 lines not on this page · raw message

arch/mips/loongson/common/cs5536/cs5536_ide.c new file +194 -0

194 lines not on this page · raw message

arch/mips/loongson/common/cs5536/cs5536_isa.c new file +376 -0

376 lines not on this page · raw message

arch/mips/loongson/common/cs5536/cs5536_ohci.c new file +168 -0

168 lines not on this page · raw message

arch/mips/loongson/common/cs5536/cs5536_otg.c new file +138 -0

138 lines not on this page · raw message

arch/mips/loongson/common/cs5536/cs5536_pci.c new file +126 -0

126 lines not on this page · raw message

arch/mips/loongson/common/cs5536/cs5536_udc.c new file +143 -0

143 lines not on this page · raw message

arch/mips/loongson/fuloong-2f/Makefile new file +5 -0
new file mode 100644
index 0000000..010b86c
@@ -0,0 +1,5 @@
+#
+# Makefile for fuloong-2f
+#
+
+obj-y += irq.o reset.o
arch/mips/loongson/fuloong-2f/irq.c new file +53 -0

53 lines not on this page · raw message

arch/mips/loongson/fuloong-2f/reset.c new file +65 -0

65 lines not on this page · raw message

arch/mips/pci/Makefile +2 -1
index a0cc238..b96ed14 100644
@@ -26,7 +26,8 @@ obj-$(CONFIG_MIPS_COBALT)	+= fixup-cobalt.o
 obj-$(CONFIG_SOC_AU1500)	+= fixup-au1000.o ops-au1000.o
 obj-$(CONFIG_SOC_AU1550)	+= fixup-au1000.o ops-au1000.o
 obj-$(CONFIG_SOC_PNX8550)	+= fixup-pnx8550.o ops-pnx8550.o
-obj-$(CONFIG_LEMOTE_FULOONG2E)	+= fixup-fuloong2e.o ops-fuloong2e.o
+obj-$(CONFIG_LEMOTE_FULOONG2E)	+= fixup-fuloong2e.o ops-loongson2.o
+obj-$(CONFIG_LEMOTE_FULOONG2F)	+= fixup-fuloong2f.o ops-loongson2.o
 obj-$(CONFIG_MIPS_MALTA)	+= fixup-malta.o
 obj-$(CONFIG_PMC_MSP7120_GW)	+= fixup-pmcmsp.o ops-pmcmsp.o
 obj-$(CONFIG_PMC_MSP7120_EVAL)	+= fixup-pmcmsp.o ops-pmcmsp.o
arch/mips/pci/fixup-fuloong2f.c new file +171 -0

171 lines not on this page · raw message

arch/mips/pci/ops-fuloong2e.c deleted +0 -160

160 lines not on this page · raw message

arch/mips/pci/ops-loongson2.c new file +213 -0

213 lines not on this page · raw message

The rest of this diff is not shown. View the raw message.

Signature · 1 line
1.6.0.4

Part of the diff is not shown here. View the raw message.

#13 lore raw

PATCH 14/25 enable serial port support of loongson-based machines

In reply to a message not in the archive

From: Wu Zhangjin <[email protected]>

this serial port support is portable to loongson-based machines, the old serial port support in fuloong(2e) via HAVE_STD_PC_SERIAL_PORT is replaced by this implementation.

before, only fuloong(2e) used HAVE_STD_PC_SERIAL_PORT kernel option, so, with this new support, we can remove arch/mips/kernel/8250-platform.c directly. but in this patch, that file is reserved there for potential use in the other machines.

---
 arch/mips/include/asm/mach-loongson/machine.h |    4 ++
 arch/mips/loongson/Kconfig                    |    1 -
 arch/mips/loongson/common/Makefile            |    5 ++
 arch/mips/loongson/common/serial.c            |   66 +++++++++++++++++++++++++
 4 files changed, 75 insertions(+), 1 deletions(-)
 create mode 100644 arch/mips/loongson/common/serial.c
arch/mips/include/asm/mach-loongson/machine.h +4 -0
index da6b6d6..ac88192 100644
@@ -18,6 +18,8 @@
 #define MACH_NAME			"lemote-fuloong(2e)"
 
 #define LOONGSON_UART_BASE		(LOONGSON_PCIIO_BASE + 0x3f8)
+#define	LOONGSON_UART_BAUD		1843200
+#define	LOONGSON_UART_IOTYPE		UPIO_PORT
 
 #define LOONGSON_NORTH_BRIDGE_IRQ	(MIPS_CPU_IRQ_BASE + 2)
 #define LOONGSON_UART_IRQ		(MIPS_CPU_IRQ_BASE + 4)
@@ -30,6 +32,8 @@
 #define MACH_NAME			"lemote-fuloong(2f)"
 
 #define LOONGSON_UART_BASE		(LOONGSON_PCIIO_BASE + 0x2f8)
+#define LOONGSON_UART_BAUD		1843200
+#define LOONGSON_UART_IOTYPE		UPIO_PORT
 
 #define LOONGSON_TIMER_IRQ	(MIPS_CPU_IRQ_BASE + 7)	/* cpu timer */
 #define LOONGSON_PERFCNT_IRQ	(MIPS_CPU_IRQ_BASE + 6) /* cpu perf counter */
arch/mips/loongson/Kconfig +0 -1
index 2bfda6e..0547907 100644
@@ -11,7 +11,6 @@ config LEMOTE_FULOONG2E
 	select DMA_NONCOHERENT
 	select BOOT_ELF32
 	select BOARD_SCACHE
-	select HAVE_STD_PC_SERIAL_PORT
 	select HW_HAS_PCI
 	select I8259
 	select ISA
arch/mips/loongson/common/Makefile +5 -0
index d55499e..2d3fa3e 100644
@@ -23,4 +23,9 @@ obj-$(CONFIG_RTC_DRV_CMOS) += rtc.o
 #
 obj-$(CONFIG_CS5536) += cs5536/
 
+#
+# Enable serial port
+#
+obj-$(CONFIG_SERIAL_8250) += serial.o
+
 EXTRA_CFLAGS += -Werror
arch/mips/loongson/common/serial.c new file +66 -0

66 lines not on this page · raw message

Signature · 1 line
1.6.0.4
#14 lore raw

PATCH 15/25 add basic yeeloong(2f) laptop support

In reply to a message not in the archive

From: Wu Zhangjin <[email protected]>

yeeloong(2f) laptop is also a Loongson2F-based machine maded by lemote.com.

the board of yeeloong(2f) is similiar to fuloong(2f) mini PC, it has an AMD cs5536 south bridge and has an extra Embedded Controller(EC) for power management, keyboard controlling and some other relative jobs.

so, the difference of the source code of yeeloong(2f) and fuloong(2f) is very small except:

1. the reboot/halt operation is controlled by an Embedded Controller in yeeloong(2f), but in fuloong(2f), by cs5536 directly.

2. there is no serial port device can be used directly in yeeloong(2f), but you can joint one for there is an cpu serial port provided by loongson2f. the address is 0x1ff003f8, you can enable it in kernel via CONFIG_SERIAL_8250.

3. yeeloong(2f) use a SMI video card, the driver source code will be added later.

---
 arch/mips/Makefile                            |    1 +
 arch/mips/include/asm/mach-loongson/cmdline.h |    9 ++
 arch/mips/include/asm/mach-loongson/machine.h |   29 ++++-
 arch/mips/loongson/Kconfig                    |   46 +++++++-
 arch/mips/loongson/Makefile                   |    6 +
 arch/mips/loongson/common/cmdline.c           |    5 +
 arch/mips/loongson/yeeloong-2f/Makefile       |    5 +
 arch/mips/loongson/yeeloong-2f/init.c         |   71 ++++++++++
 arch/mips/loongson/yeeloong-2f/irq.c          |   53 ++++++++
 arch/mips/loongson/yeeloong-2f/reset.c        |   40 ++++++
 arch/mips/pci/Makefile                        |    3 +-
 arch/mips/pci/fixup-fuloong2f.c               |  171 -------------------------
 arch/mips/pci/fixup-lemote2f.c                |  171 +++++++++++++++++++++++++
 13 files changed, 435 insertions(+), 175 deletions(-)
 create mode 100644 arch/mips/include/asm/mach-loongson/cmdline.h
 create mode 100644 arch/mips/loongson/yeeloong-2f/Makefile
 create mode 100644 arch/mips/loongson/yeeloong-2f/init.c
 create mode 100644 arch/mips/loongson/yeeloong-2f/irq.c
 create mode 100644 arch/mips/loongson/yeeloong-2f/reset.c
 delete mode 100644 arch/mips/pci/fixup-fuloong2f.c
 create mode 100644 arch/mips/pci/fixup-lemote2f.c
arch/mips/Makefile +1 -0
index 74f23ad..a25c2e5 100644
@@ -312,6 +312,7 @@ cflags-$(CONFIG_LOONGSON_SYSTEMS) += -I$(srctree)/arch/mips/include/asm/mach-loo
 					-mno-branch-likely
 load-$(CONFIG_LEMOTE_FULOONG2E) +=0xffffffff80100000
 load-$(CONFIG_LEMOTE_FULOONG2F) +=0xffffffff80200000
+load-$(CONFIG_LEMOTE_YEELOONG2F) +=0xffffffff80200000
 
 #
 # MIPS Malta board
arch/mips/include/asm/mach-loongson/cmdline.h new file +9 -0
new file mode 100644
index 0000000..de954e0
@@ -0,0 +1,9 @@
+/* machine-specific command line initialization */
+#ifdef CONFIG_SYS_HAS_MACH_PROM_INIT_CMDLINE
+extern void __init mach_prom_init_cmdline(void);
+#else
+void __init mach_prom_init_cmdline(void)
+{
+}
+#endif
+
arch/mips/include/asm/mach-loongson/machine.h +28 -1
index ac88192..c920d39 100644
@@ -27,7 +27,7 @@
 #define LOONGSON_TIMER_IRQ        	(MIPS_CPU_IRQ_BASE + 7)
 #define LOONGSON_DMATIMEOUT_IRQ		(LOONGSON_IRQ_BASE + 10)
 
-#else /* CONFIG_LEMOTE_FULOONG2F */
+#elif defined(CONFIG_LEMOTE_FULOONG2F)
 
 #define MACH_NAME			"lemote-fuloong(2f)"
 
@@ -35,6 +35,33 @@
 #define LOONGSON_UART_BAUD		1843200
 #define LOONGSON_UART_IOTYPE		UPIO_PORT
 
+#else /* CONFIG_CPU_YEELOONG2F */
+
+#define MACH_NAME			"lemote-yeeloong(2f)"
+
+/* yeeloong use the CPU serial port of Loongson2F */
+#define LOONGSON_UART_BASE		(LOONGSON_LIO1_BASE + 0x3f8)
+#define	LOONGSON_UART_BAUD		3686400
+#define LOONGSON_UART_IOTYPE		UPIO_MEM
+
+/*
+ * The following registers are determined by the EC index configuration.
+ * 1, fill the PORT_HIGH as EC register high part.
+ * 2, fill the PORT_LOW as EC register low part.
+ * 3, fill the PORT_DATA as EC register write data or get the data from it.
+ */
+#define	EC_IO_PORT_HIGH	0x0381
+#define	EC_IO_PORT_LOW	0x0382
+#define	EC_IO_PORT_DATA	0x0383
+#define	REG_RESET_HIGH	0xF4	/* reset the machine auto-clear : rd/wr */
+#define REG_RESET_LOW	0xEC
+#define	BIT_RESET_ON	(1 << 0)
+
+#endif	/* !CONFIG_LEMOTE_FULOONG2E */
+
+/* fuloong2f and yeeloong2f have the same IRQ control interface */
+#if defined(CONFIG_LEMOTE_FULOONG2F) || defined(CONFIG_LEMOTE_YEELOONG2F)
+
 #define LOONGSON_TIMER_IRQ	(MIPS_CPU_IRQ_BASE + 7)	/* cpu timer */
 #define LOONGSON_PERFCNT_IRQ	(MIPS_CPU_IRQ_BASE + 6) /* cpu perf counter */
 #define LOONGSON_NORTH_BRIDGE_IRQ	(MIPS_CPU_IRQ_BASE + 6)	/* bonito */
arch/mips/loongson/Kconfig +44 -2

63 lines not on this page · raw message

arch/mips/loongson/Makefile +6 -0
index e9b8a81..7178edb 100644
@@ -15,3 +15,9 @@ obj-$(CONFIG_LEMOTE_FULOONG2E)	+= fuloong-2e/
 #
 
 obj-$(CONFIG_LEMOTE_FULOONG2F)	+= fuloong-2f/
+
+#
+# Lemote Yeeloong mini-PC (Loongson 2F-based)
+#
+
+obj-$(CONFIG_LEMOTE_YEELOONG2F)	+= yeeloong-2f/
arch/mips/loongson/common/cmdline.c +5 -0
index 12bb606..c7b6eb1 100644
@@ -19,6 +19,8 @@
  */
 
 #include <asm/bootinfo.h>
+#include <loongson.h>
+#include <cmdline.h>
 
 #include <loongson.h>
 #include <cmdline.h>
@@ -47,6 +49,9 @@ void __init prom_init_cmdline(void)
 		strcat(arcs_cmdline, " ");
 	}
 
+	/* machine specific prom_init_cmdline */
+	mach_prom_init_cmdline();
+
 	if ((strstr(arcs_cmdline, "console=")) == NULL)
 		strcat(arcs_cmdline, " console=ttyS0,115200");
 	if ((strstr(arcs_cmdline, "root=")) == NULL)
arch/mips/loongson/yeeloong-2f/Makefile new file +5 -0
new file mode 100644
index 0000000..624affd
@@ -0,0 +1,5 @@
+#
+# Makefile for fuloong-2f
+#
+
+obj-y += init.o irq.o reset.o
arch/mips/loongson/yeeloong-2f/init.c new file +71 -0

71 lines not on this page · raw message

arch/mips/loongson/yeeloong-2f/irq.c new file +53 -0

53 lines not on this page · raw message

arch/mips/loongson/yeeloong-2f/reset.c new file +40 -0
new file mode 100644
index 0000000..a3719a4
@@ -0,0 +1,40 @@
+/* Board-specific reboot/shutdown routines
+ * Copyright (c) 2009 Philippe Vachon <[email protected]>
+ *
+ * Copyright (C) 2009 Lemote Inc. & Insititute of Computing Technology
+ * Author: Wu Zhangjin, [email protected]
+ *
+ * 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/types.h>
+
+#include <loongson.h>
+#include <machine.h>
+
+void mach_prepare_reboot(void)
+{
+	/*
+	 * reset cpu to full speed, this is needed when enabling cpu frequency
+	 * scalling
+	 */
+	LOONGSON_CHIPCFG0 |= 0x7;
+
+	/* sending an reset signal to EC(embedded controller) */
+	writeb(REG_RESET_HIGH, (u8 *) (mips_io_port_base + EC_IO_PORT_HIGH));
+	writeb(REG_RESET_LOW, (u8 *) (mips_io_port_base + EC_IO_PORT_LOW));
+	mmiowb();
+	writeb(BIT_RESET_ON, (u8 *) (mips_io_port_base + EC_IO_PORT_DATA));
+	mmiowb();
+}
+
+void mach_prepare_shutdown(void)
+{
+	/* cpu-gpio0 output low */
+	LOONGSON_GPIODATA &= ~0x00000001;
+	/* cpu-gpio0 as output */
+	LOONGSON_GPIOIE &= ~0x00000001;
+}
arch/mips/pci/Makefile +2 -1
index b96ed14..1a57532 100644
@@ -27,7 +27,8 @@ obj-$(CONFIG_SOC_AU1500)	+= fixup-au1000.o ops-au1000.o
 obj-$(CONFIG_SOC_AU1550)	+= fixup-au1000.o ops-au1000.o
 obj-$(CONFIG_SOC_PNX8550)	+= fixup-pnx8550.o ops-pnx8550.o
 obj-$(CONFIG_LEMOTE_FULOONG2E)	+= fixup-fuloong2e.o ops-loongson2.o
-obj-$(CONFIG_LEMOTE_FULOONG2F)	+= fixup-fuloong2f.o ops-loongson2.o
+obj-$(CONFIG_LEMOTE_FULOONG2F)	+= fixup-lemote2f.o ops-loongson2.o
+obj-$(CONFIG_LEMOTE_YEELOONG2F)	+= fixup-lemote2f.o ops-loongson2.o
 obj-$(CONFIG_MIPS_MALTA)	+= fixup-malta.o
 obj-$(CONFIG_PMC_MSP7120_GW)	+= fixup-pmcmsp.o ops-pmcmsp.o
 obj-$(CONFIG_PMC_MSP7120_EVAL)	+= fixup-pmcmsp.o ops-pmcmsp.o
arch/mips/pci/fixup-fuloong2f.c deleted +0 -171

171 lines not on this page · raw message

arch/mips/pci/fixup-lemote2f.c new file +171 -0

171 lines not on this page · raw message

Signature · 1 line
1.6.0.4
#15 lore raw

Re: [loongson-PATCH-v3 15/25] add basic yeeloong(2f) laptop support

arch/mips/loongson/common/cmdline.c line 23

Quoted 10 lines · On 21:07 Thu 04 Jun , [email protected] wrote:
arch/mips/loongson/common/cmdline.c +2 -0
index 12bb606..c7b6eb1 100644
@@ -19,6 +19,8 @@
  */
 
 #include <asm/bootinfo.h>
+#include <loongson.h>
+#include <cmdline.h>

duplicated #include's.

Quoted 3 lines
arch/mips/loongson/common/cmdline.c +0 -0
 #include <loongson.h>
 #include <cmdline.h>
Signature · 4 lines
Zhang, Le
Gentoo/Loongson Developer
http://zhangle.is-a-geek.org
0260 C902 B8F8 6506 6586 2B90 BC51 C808 1E4E 2973
#16 lore raw

Re: [loongson-PATCH-v3 15/25] add basic yeeloong(2f) laptop support

Quoted 8 lines · Zhang Le
Quoted 7 lines · On 21:07 Thu 04 Jun , [email protected] wrote:
arch/mips/loongson/common/cmdline.c +0 -0
index 12bb606..c7b6eb1 100644
@@ -19,6 +19,8 @@
  */
 
Quoted 5 lines

arch/mips/loongson/common/cmdline.c line 23

Quoted 3 lines
arch/mips/loongson/common/cmdline.c +2 -0
 #include <asm/bootinfo.h>
+#include <loongson.h>
+#include <cmdline.h>

duplicated #include's.

Acked.

thx!
Wu Zhangjin

Quoted 5 lines
Quoted 3 lines
arch/mips/loongson/common/cmdline.c +0 -0
 #include <loongson.h>
 #include <cmdline.h>
#17 lore raw

PATCH 16/25 enable halt command for yeeloong-7inch laptop

In reply to a message not in the archive

From: Wu Zhangjin <[email protected]>

the only differences between yeeloong-7inch and yeeloong-8.9inc are the screen size and shutdown logic. here only focus on the shutdown logic, the screen size handling will be fixed later.

currently, I add two new kernel config options LEMOTE_YEELOONG_7INCH and LEMOTE_YEELOONG_89INCH to let user select a suitable kernel for his yeeloong laptop.

---
 arch/mips/include/asm/mach-loongson/loongson.h |    7 +++++
 arch/mips/include/asm/mach-loongson/machine.h  |   18 ++++++++++--
 arch/mips/loongson/Kconfig                     |   12 ++++++++
 arch/mips/loongson/yeeloong-2f/reset.c         |   34 +++++++++++++++++++++--
 4 files changed, 65 insertions(+), 6 deletions(-)
arch/mips/include/asm/mach-loongson/loongson.h +7 -0
index cd6668b..ea99209 100644
@@ -44,6 +44,13 @@ extern void mach_irq_dispatch(unsigned int pending);
 extern void mach_prepare_reboot(void);
 extern void mach_prepare_shutdown(void);
 
+/* We need this in some places... */
+#define delay()	({			\
+	int x;					\
+	for (x = 0; x < 100000; x++)  \
+		__asm__ __volatile__(""); \
+})
+
 #define LOONGSON_REG(x) \
 	(*(u32 *)((char *)CKSEG1ADDR(LOONGSON_REG_BASE) + (x)))
 #define LOONGSON_IRQ_BASE	32
arch/mips/include/asm/mach-loongson/machine.h +15 -3
index c920d39..15d8b93 100644
@@ -50,13 +50,25 @@
  * 2, fill the PORT_LOW as EC register low part.
  * 3, fill the PORT_DATA as EC register write data or get the data from it.
  */
-#define	EC_IO_PORT_HIGH	0x0381
-#define	EC_IO_PORT_LOW	0x0382
-#define	EC_IO_PORT_DATA	0x0383
+#define	EC_RESET_IO_PORT_HIGH	0x0381
+#define	EC_RESET_IO_PORT_LOW	0x0382
+#define	EC_RESET_IO_PORT_DATA	0x0383
 #define	REG_RESET_HIGH	0xF4	/* reset the machine auto-clear : rd/wr */
 #define REG_RESET_LOW	0xEC
 #define	BIT_RESET_ON	(1 << 0)
 
+/* 7inch yeeloong have the different shutdown hardware logic from 8.9inch */
+#ifdef CONFIG_LEMOTE_YEELOONG2F_7INCH
+
+#define	EC_SHUTDOWN_IO_PORT_HIGH	0xff2d
+#define	EC_SHUTDOWN_IO_PORT_LOW		0xff2e
+#define	EC_SHUTDOWN_IO_PORT_DATA	0xff2f
+#define	REG_SHUTDOWN_HIGH	0xFC
+#define REG_SHUTDOWN_LOW	0x29
+#define	BIT_SHUTDOWN_ON	(1 << 1)
+
+#endif
+
 #endif	/* !CONFIG_LEMOTE_FULOONG2E */
 
 /* fuloong2f and yeeloong2f have the same IRQ control interface */
arch/mips/loongson/Kconfig +12 -0
index 9cc817f..63d00c1 100644
@@ -93,6 +93,18 @@ config LEMOTE_YEELOONG2F
 
 endchoice
 
+choice
+	prompt "YeeLoong Type"
+	depends on LEMOTE_YEELOONG2F
+
+config LEMOTE_YEELOONG2F_89INCH
+	bool "8.9 inch"
+
+config LEMOTE_YEELOONG2F_7INCH
+	bool "7 inch"
+
+endchoice
+
 config CS5536
 	bool
 
arch/mips/loongson/yeeloong-2f/reset.c +31 -3
index a3719a4..294592f 100644
@@ -24,17 +24,45 @@ void mach_prepare_reboot(void)
 	LOONGSON_CHIPCFG0 |= 0x7;
 
 	/* sending an reset signal to EC(embedded controller) */
-	writeb(REG_RESET_HIGH, (u8 *) (mips_io_port_base + EC_IO_PORT_HIGH));
-	writeb(REG_RESET_LOW, (u8 *) (mips_io_port_base + EC_IO_PORT_LOW));
+	writeb(REG_RESET_HIGH,
+	       (u8 *) (mips_io_port_base + EC_RESET_IO_PORT_HIGH));
+	writeb(REG_RESET_LOW,
+	       (u8 *) (mips_io_port_base + EC_RESET_IO_PORT_LOW));
 	mmiowb();
-	writeb(BIT_RESET_ON, (u8 *) (mips_io_port_base + EC_IO_PORT_DATA));
+	writeb(BIT_RESET_ON,
+	       (u8 *) (mips_io_port_base + EC_RESET_IO_PORT_DATA));
 	mmiowb();
 }
 
 void mach_prepare_shutdown(void)
 {
+#ifdef CONFIG_LEMOTE_YEELOONG2F_7INCH
+	{
+		u8 val;
+		u64 i;
+
+		writeb(REG_SHUTDOWN_HIGH,
+		       (u8 *) (mips_io_port_base + EC_SHUTDOWN_IO_PORT_HIGH));
+		writeb(REG_SHUTDOWN_LOW,
+		       (u8 *) (mips_io_port_base + EC_SHUTDOWN_IO_PORT_LOW));
+		mmiowb();
+		val =
+		    readb((u8 *) (mips_io_port_base +
+				  EC_SHUTDOWN_IO_PORT_DATA));
+		writeb(val & (~BIT_SHUTDOWN_ON),
+		       (u8 *) (mips_io_port_base + EC_SHUTDOWN_IO_PORT_DATA));
+		mmiowb();
+		/* need enough wait here... how many microseconds needs? */
+		for (i = 0; i < 0x10000; i++)
+			delay();
+		writeb(val | BIT_SHUTDOWN_ON,
+		       (u8 *) (mips_io_port_base + EC_SHUTDOWN_IO_PORT_DATA));
+		mmiowb();
+	}
+#else
 	/* cpu-gpio0 output low */
 	LOONGSON_GPIODATA &= ~0x00000001;
 	/* cpu-gpio0 as output */
 	LOONGSON_GPIOIE &= ~0x00000001;
+#endif
 }
Signature · 1 line
1.6.0.4
#18 lore raw

PATCH 17/25 add a machtype kernel command line argument

In reply to a message not in the archive

From: Wu Zhangjin <[email protected]>

the difference between yeeloong-7inch and yeeloong-8.9inch is very small, only including the screen size and shutdown logic. so, it's very important to share the same kernel image file between them instead of adding some new kernel config options. benefit from this, the distribution developers only have a need to compile the kernel one time.

to share the same kernel image file between yeelooong-7inch and yeeloong-8.9inch, there is a need to add a kernel command line, here I name is machtype, it works like this:

machtype=lemote-yeeloong-2f-7inch
company - product - cpu revision - size

so, we can choose a suitable vga mode for the screen of different size by default via this kernel command line in prom_init, here exactly is mach_prom_init_cmdline in arch/mips/loongson/yeeloong-2f/init.c.

the vga command line will be used later in the SMI video driver to choose a suitable screen resolution ratio.

and also, we can get the true machine name via this kenrel command line argument.

---
 Documentation/kernel-parameters.txt            |    4 ++
 arch/mips/include/asm/mach-loongson/machine.h  |   32 ++-----------
 arch/mips/include/asm/mach-loongson/machtype.h |   32 +++++++++++++
 arch/mips/loongson/Kconfig                     |   12 -----
 arch/mips/loongson/common/Makefile             |    2 +-
 arch/mips/loongson/common/init.c               |    4 --
 arch/mips/loongson/common/machtype.c           |   58 ++++++++++++++++++++++++
 arch/mips/loongson/common/misc.c               |   15 ------
 arch/mips/loongson/yeeloong-2f/init.c          |   13 +++++-
 arch/mips/loongson/yeeloong-2f/reset.c         |   40 +++++++++++++----
 10 files changed, 142 insertions(+), 70 deletions(-)
 create mode 100644 arch/mips/include/asm/mach-loongson/machtype.h
 create mode 100644 arch/mips/loongson/common/machtype.c
 delete mode 100644 arch/mips/loongson/common/misc.c
Documentation/kernel-parameters.txt +4 -0
index fd5cac0..a4b7104 100644
@@ -1220,6 +1220,10 @@ and is between 256 and 4096 characters. It is defined in the file
 			(machvec) in a generic kernel.
 			Example: machvec=hpzx1_swiotlb
 
+	machtype=	[Loongson] Share the same kernel image file between different
+			 yeeloong laptop.
+			Example: machtype=lemote-yeeloong-2f-7inch
+
 	max_addr=nn[KMG]	[KNL,BOOT,ia64] All physical memory greater
 			than or equal to this physical address is ignored.
 
arch/mips/include/asm/mach-loongson/machine.h +4 -28
index 15d8b93..9f8a607 100644
@@ -15,7 +15,7 @@
 
 #ifdef CONFIG_LEMOTE_FULOONG2E
 
-#define MACH_NAME			"lemote-fuloong(2e)"
+#define MACH_NAME	MACHNAME(LEMOTE, FULOONG, LOONGSON_2E, UNKNOWN)
 
 #define LOONGSON_UART_BASE		(LOONGSON_PCIIO_BASE + 0x3f8)
 #define	LOONGSON_UART_BAUD		1843200
@@ -29,7 +29,7 @@
 
 #elif defined(CONFIG_LEMOTE_FULOONG2F)
 
-#define MACH_NAME			"lemote-fuloong(2f)"
+#define MACH_NAME	MACHNAME(LEMOTE, FULOONG, LOONGSON_2F, UNKNOWN)
 
 #define LOONGSON_UART_BASE		(LOONGSON_PCIIO_BASE + 0x2f8)
 #define LOONGSON_UART_BAUD		1843200
@@ -37,38 +37,14 @@
 
 #else /* CONFIG_CPU_YEELOONG2F */
 
-#define MACH_NAME			"lemote-yeeloong(2f)"
+/* by default, set it as 8.9INCH? or UNKNOWN? */
+#define MACH_NAME	MACHNAME(LEMOTE, YEELOONG, LOONGSON_2F, _89INCH)
 
 /* yeeloong use the CPU serial port of Loongson2F */
 #define LOONGSON_UART_BASE		(LOONGSON_LIO1_BASE + 0x3f8)
 #define	LOONGSON_UART_BAUD		3686400
 #define LOONGSON_UART_IOTYPE		UPIO_MEM
 
-/*
- * The following registers are determined by the EC index configuration.
- * 1, fill the PORT_HIGH as EC register high part.
- * 2, fill the PORT_LOW as EC register low part.
- * 3, fill the PORT_DATA as EC register write data or get the data from it.
- */
-#define	EC_RESET_IO_PORT_HIGH	0x0381
-#define	EC_RESET_IO_PORT_LOW	0x0382
-#define	EC_RESET_IO_PORT_DATA	0x0383
-#define	REG_RESET_HIGH	0xF4	/* reset the machine auto-clear : rd/wr */
-#define REG_RESET_LOW	0xEC
-#define	BIT_RESET_ON	(1 << 0)
-
-/* 7inch yeeloong have the different shutdown hardware logic from 8.9inch */
-#ifdef CONFIG_LEMOTE_YEELOONG2F_7INCH
-
-#define	EC_SHUTDOWN_IO_PORT_HIGH	0xff2d
-#define	EC_SHUTDOWN_IO_PORT_LOW		0xff2e
-#define	EC_SHUTDOWN_IO_PORT_DATA	0xff2f
-#define	REG_SHUTDOWN_HIGH	0xFC
-#define REG_SHUTDOWN_LOW	0x29
-#define	BIT_SHUTDOWN_ON	(1 << 1)
-
-#endif
-
 #endif	/* !CONFIG_LEMOTE_FULOONG2E */
 
 /* fuloong2f and yeeloong2f have the same IRQ control interface */
arch/mips/include/asm/mach-loongson/machtype.h new file +32 -0
new file mode 100644
index 0000000..9f96926
@@ -0,0 +1,32 @@
+/*
+ * machine type header file
+ */
+
+#ifndef _MACHTYPE_H
+#define _MACHTYPE_H
+
+#define UNKNOWN		"unknown"
+
+/* company */
+#define LEMOTE		"lemote"
+#define DEXOON		"dexoon"
+
+/* product */
+#define FULOONG		"fuloong"
+#define YEELOONG	"yeeloong"
+#define	GDIUM		"gdium"
+
+/* cpu revision */
+#define LOONGSON_2E			"2e"
+#define LOONGSON_2F 		"2f"
+
+/* size */
+#define _7INCH			"7"
+#define	_89INCH			"8.9"
+
+#define MACHNAME_LEN	50
+
+#define MACHNAME(company, product, cpu, size) \
+	(company "-" product "-" cpu "-" size "inch\0")
+
+#endif /* ! _MACHTYPE_H */
arch/mips/loongson/Kconfig +0 -12
index 63d00c1..9cc817f 100644
@@ -93,18 +93,6 @@ config LEMOTE_YEELOONG2F
 
 endchoice
 
-choice
-	prompt "YeeLoong Type"
-	depends on LEMOTE_YEELOONG2F
-
-config LEMOTE_YEELOONG2F_89INCH
-	bool "8.9 inch"
-
-config LEMOTE_YEELOONG2F_7INCH
-	bool "7 inch"
-
-endchoice
-
 config CS5536
 	bool
 
arch/mips/loongson/common/Makefile +1 -1
index 2d3fa3e..df782d6 100644
@@ -3,7 +3,7 @@
 #
 
 obj-y += setup.o init.o cmdline.o env.o time.o reset.o irq.o \
-	pci.o bonito-irq.o mem.o misc.o
+	pci.o bonito-irq.o mem.o machtype.o
 
 #
 # Early printk support
arch/mips/loongson/common/init.c +0 -4
index cbb33de..6fcfba0 100644
@@ -18,7 +18,6 @@
 #include <linux/bootmem.h>
 
 #include <asm/bootinfo.h>
-#include <asm/cpu.h>
 
 #include <loongson.h>
 
@@ -35,9 +34,6 @@ static inline void set_loongson_addrwincfg_base(unsigned long base)
 
 void __init prom_init(void)
 {
-	/* init mach type, does we need to init it?? */
-	mips_machtype = PRID_IMP_LOONGSON2;
-
 	/* init several base address */
 	set_io_port_base((unsigned long)
 			 ioremap(LOONGSON_PCIIO_BASE, LOONGSON_PCIIO_SIZE));
arch/mips/loongson/common/machtype.c new file +58 -0

58 lines not on this page · raw message

arch/mips/loongson/common/misc.c deleted +0 -15
deleted file mode 100644
index 1b8044c..0000000
@@ -1,15 +0,0 @@
-/* Copyright (C) 2009 Lemote Inc. & Insititute of Computing Technology
- * Author: Wu Zhangjin, [email protected]
- *
- * 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 <machine.h>
-
-const char *get_system_type(void)
-{
-	return MACH_NAME;
-}
arch/mips/loongson/yeeloong-2f/init.c +12 -1
index 3bdc354..80f8c5e 100644
@@ -18,6 +18,7 @@
 #include <asm/bootinfo.h>
 
 #include <cs5536/cs5536.h>
+#include <machtype.h>
 
 void __init mach_prom_init_cmdline(void)
 {
@@ -27,7 +28,7 @@ void __init mach_prom_init_cmdline(void)
 	/*Emulate post for usb */
 	_wrmsr(USB_MSR_REG(USB_CONFIG), 0x4, 0xBF000);
 
-	if ((strstr(arcs_cmdline, "no_auto_cmd")) == NULL) {
+	if (strstr(arcs_cmdline, "no_auto_cmd") == NULL) {
 		unsigned char default_root[50] = "/dev/hda1";
 		char *pmon_ver, *ec_ver, *p, version[60], ec_version[64];
 
@@ -68,4 +69,14 @@ void __init mach_prom_init_cmdline(void)
 		strcat(arcs_cmdline, " console=tty2");
 		strcat(arcs_cmdline, " quiet");
 	}
+
+	/*
+	 * automatically pass the vga argument via machtype argument if
+	 * vga is not passed: yeeloong-7inch's vga mode is 800x480x24
+	 */
+
+	if ((strstr(arcs_cmdline, "vga") == NULL)
+			&& (strstr(arcs_cmdline, "machtype") != NULL)
+				&& (strstr(arcs_cmdline, _7INCH) != NULL))
+		strcat(arcs_cmdline, " vga=800x480x24");
 }
arch/mips/loongson/yeeloong-2f/reset.c +31 -9
index 294592f..124cf99 100644
@@ -11,9 +11,32 @@
  */
 
 #include <linux/types.h>
+#include <asm/bootinfo.h>
 
 #include <loongson.h>
 #include <machine.h>
+#include <machtype.h>
+
+/*
+ * The following registers are determined by the EC index configuration.
+ * 1, fill the PORT_HIGH as EC register high part.
+ * 2, fill the PORT_LOW as EC register low part.
+ * 3, fill the PORT_DATA as EC register write data or get the data from it.
+ */
+#define	EC_RESET_IO_PORT_HIGH	0x0381
+#define	EC_RESET_IO_PORT_LOW	0x0382
+#define	EC_RESET_IO_PORT_DATA	0x0383
+#define	REG_RESET_HIGH	0xF4	/* reset the machine auto-clear : rd/wr */
+#define REG_RESET_LOW	0xEC
+#define	BIT_RESET_ON	(1 << 0)
+
+/* 7inch yeeloong have the different shutdown hardware logic from 8.9inch */
+#define	EC_SHUTDOWN_IO_PORT_HIGH	0xff2d
+#define	EC_SHUTDOWN_IO_PORT_LOW		0xff2e
+#define	EC_SHUTDOWN_IO_PORT_DATA	0xff2f
+#define	REG_SHUTDOWN_HIGH	0xFC
+#define REG_SHUTDOWN_LOW	0x29
+#define	BIT_SHUTDOWN_ON	(1 << 1)
 
 void mach_prepare_reboot(void)
 {
@@ -36,8 +59,12 @@ void mach_prepare_reboot(void)
 
 void mach_prepare_shutdown(void)
 {
-#ifdef CONFIG_LEMOTE_YEELOONG2F_7INCH
-	{
+	if (strstr(get_system_type(), _89INCH)) {
+		/* cpu-gpio0 output low */
+		LOONGSON_GPIODATA &= ~0x00000001;
+		/* cpu-gpio0 as output */
+		LOONGSON_GPIOIE &= ~0x00000001;
+	} else if (strstr(get_system_type(), _7INCH)) {
 		u8 val;
 		u64 i;
 
@@ -58,11 +85,6 @@ void mach_prepare_shutdown(void)
 		writeb(val | BIT_SHUTDOWN_ON,
 		       (u8 *) (mips_io_port_base + EC_SHUTDOWN_IO_PORT_DATA));
 		mmiowb();
-	}
-#else
-	/* cpu-gpio0 output low */
-	LOONGSON_GPIODATA &= ~0x00000001;
-	/* cpu-gpio0 as output */
-	LOONGSON_GPIOIE &= ~0x00000001;
-#endif
+	} else
+		printk(KERN_INFO "you can shutdown the power safely now!\n");
 }
Signature · 1 line
1.6.0.4
#19 lore raw

Re: [loongson-PATCH-v3 17/25] add a machtype kernel command line argument

[email protected] writes:

Hi,

Quoted 8 lines

From: Wu Zhangjin <[email protected]>

the difference between yeeloong-7inch and yeeloong-8.9inch is very small, only including the screen size and shutdown logic. so, it's very important to share the same kernel image file between them instead of adding some new kernel config options. benefit from this, the distribution developers only have a need to compile the kernel one time.

Quoted 6 lines

to share the same kernel image file between yeelooong-7inch and yeeloong-8.9inch, there is a need to add a kernel command line, here I name is machtype, it works like this:

machtype=lemote-yeeloong-2f-7inch
company - product - cpu revision - size

I'm curious. Why can't you use the boot monitor to pass the right machine type instead ? iirc, you're using pmon and pmon has a variable called "systype". If the systype variable is not designed for that, I'll be happy to know its use :)

Arnaud

#20 lore raw

Re: [loongson-PATCH-v3 17/25] add a machtype kernel command line argument

Quoted 16 lines · Arnaud Patard

[email protected] writes:

Hi,

Quoted 12 lines

From: Wu Zhangjin <[email protected]>

the difference between yeeloong-7inch and yeeloong-8.9inch is very small, only including the screen size and shutdown logic. so, it's very important to share the same kernel image file between them instead of adding some new kernel config options. benefit from this, the distribution developers only have a need to compile the kernel one time.

to share the same kernel image file between yeelooong-7inch and yeeloong-8.9inch, there is a need to add a kernel command line, here I name is machtype, it works like this:

Quoted 8 lines
Quoted 2 lines

machtype=lemote-yeeloong-2f-7inch
company - product - cpu revision - size

I'm curious. Why can't you use the boot monitor to pass the right machine type instead ? iirc, you're using pmon and pmon has a variable called "systype". If the systype variable is not designed for that, I'll be happy to know its use :)

yes, I just checked the PMON variables, there is "systype" there, but seems can not be set(when reboot, will become the original one), maybe hard-coded in PMON? so i added another PMON variable: machtype, and added some source code: if there is a PMON machtype variable there, transfer it to a kernel command line.

but i think using a kernel command line is better, because we can either set it as the karg variable in PMON or pass it in the boot.cfg, which is more flexible and in-dependent from the bootloader.

and perhaps, someday, we can share the same kernel image file between fuloong2f box and yeeloong2f laptop via this kernel command line:
machtype, because there is really only a few difference between them(only the reboot/shutdown logic, serial port). I really want to share them and remove one of the irq.c file :-)

thanks!
Wu Zhangjin

Quoted 2 lines

Arnaud

#21 lore raw

Re: [loongson-PATCH-v3 17/25] add a machtype kernel command line argument

In reply to [email protected]
Quoted 19 lines · On 21:08 Thu 04 Jun , [email protected] wrote:

From: Wu Zhangjin <[email protected]>

the difference between yeeloong-7inch and yeeloong-8.9inch is very small, only including the screen size and shutdown logic. so, it's very important to share the same kernel image file between them instead of adding some new kernel config options. benefit from this, the distribution developers only have a need to compile the kernel one time.

to share the same kernel image file between yeelooong-7inch and yeeloong-8.9inch, there is a need to add a kernel command line, here I name is machtype, it works like this:

machtype=lemote-yeeloong-2f-7inch
company - product - cpu revision - size

so, we can choose a suitable vga mode for the screen of different size by default via this kernel command line in prom_init, here exactly is mach_prom_init_cmdline in arch/mips/loongson/yeeloong-2f/init.c.

Quoted 5 lines

the vga command line will be used later in the SMI video driver to choose a suitable screen resolution ratio.

and also, we can get the true machine name via this kenrel command line argument.

I have tested this patchset on both fuloong 2f and 2e boxes. It works well except for that duplicated #include's problem.

However, there is an annoying problem. The system type on these two boxes has an "-unknowninch" ending, which does not make any sense at all.

So I made a patch on top of your patchset which makes kernel param machtype=lemote-yeeloong-2f-7inch work as before, while on fuloongs return system types like "lemote-fuloong-2e-box" and is less intrusive againt linux-mips tree.

I will post this patch after I test the patchset on yeeloong 8.9 notebook.

Signature · 4 lines
Zhang, Le
Gentoo/Loongson Developer
http://zhangle.is-a-geek.org
0260 C902 B8F8 6506 6586 2B90 BC51 C808 1E4E 2973
#22 lore raw

Re: [loongson-dev] Re: [loongson-PATCH-v3 17/25] add a machtype kernel command line argument

So this is the patch. I should say this patch is a bit intrusive againt your verion. But I think I could justify the changes.

1. MACHNAME macro seems to be a little over engineered. And with MACHNAME, system type becomes "lemote-fuloong-2f-unknowninch" which does not make much sense. So I removed it. As a result, include/asm/mach-loongson/machtype.h is not needed anymore. I also modified loongson/yeeloong-2f/{init,reset}.c, because _89INCH and _7INCH no longer exist.

2. 3 machine names are defined twice, once in loongson/common/machtype.c, once in include/asm/mach-loongson/machine.h. In my patch, all the system types are defined in loongson/common/machtype.c, as an array called system_types. Other loongson based machine, like Gdium, could add their system type to this array.

3. I defined symbolic names for the system_types array's index. In include/asm/mach-loongson/machine.h, I defined macro MACHTYPE using these symbolic names, so that we can get system type from system_types array using MACHTYPE as index.

4. Add NULL to the end of system_types array, so MACHTYPE_TOTAL is not needed.

5. mips_machtype already has initial value MACH_UNKNOWN, so MACHTYPE_DEFAULT is not needed.

6. modified the for loop in machtype_setup accordingly.

---
 arch/mips/include/asm/bootinfo.h               |   11 +++++
 arch/mips/include/asm/mach-loongson/machine.h  |    8 ++--
 arch/mips/include/asm/mach-loongson/machtype.h |   32 ---------------
 arch/mips/loongson/common/machtype.c           |   50 ++++++++++-------------
 arch/mips/loongson/yeeloong-2f/init.c          |    3 +-
 arch/mips/loongson/yeeloong-2f/reset.c         |    7 ++-
 6 files changed, 42 insertions(+), 69 deletions(-)
 delete mode 100644 arch/mips/include/asm/mach-loongson/machtype.h
arch/mips/include/asm/bootinfo.h +11 -0
index 610fe3a..0d9c7ff 100644
@@ -7,6 +7,7 @@
  * Copyright (C) 1995, 1996 Andreas Busse
  * Copyright (C) 1995, 1996 Stoned Elipot
  * Copyright (C) 1995, 1996 Paul M. Antoine.
+ * Copyright (C) 2009       Zhang Le
  */
 #ifndef _ASM_BOOTINFO_H
 #define _ASM_BOOTINFO_H
@@ -57,6 +58,16 @@
 #define	MACH_MIKROTIK_RB532	0	/* Mikrotik RouterBoard 532 	*/
 #define MACH_MIKROTIK_RB532A	1	/* Mikrotik RouterBoard 532A 	*/
 
+/*
+ * Valid machtype for group Loongson
+ */
+#define MACH_LOONGSON_UNKNOWN	0
+#define MACH_LEMOTE_FL2E	1
+#define MACH_LEMOTE_FL2F	2
+#define MACH_LEMOTE_YL2F89	3
+#define MACH_LEMOTE_YL2F7	4
+#define MACH_LOONGSON_END	5
+
 #define CL_SIZE			COMMAND_LINE_SIZE
 
 extern char *system_type;
arch/mips/include/asm/mach-loongson/machine.h +4 -4
index 8109a9e..e168625 100644
@@ -2,6 +2,7 @@
  * board-specific header file
  *
  * Copyright (c) 2009 Wu Zhangjin <[email protected]>
+ * Copyright (c) 2009 Zhang Le <[email protected]>
  *
  * This program is free software; you can redistribute it
  * and/or modify it under the terms of the GNU General
@@ -15,7 +16,7 @@
 
 #ifdef CONFIG_LEMOTE_FULOONG2E
 
-#define MACH_NAME	MACHNAME(LEMOTE, FULOONG, LOONGSON_2E, UNKNOWN)
+#define MACHTYPE	MACH_LEMOTE_FL2E
 
 #define LOONGSON_UART_BASE		(LOONGSON_PCIIO_BASE + 0x3f8)
 #define	LOONGSON_UART_BAUD		1843200
@@ -29,7 +30,7 @@
 
 #elif defined(CONFIG_LEMOTE_FULOONG2F)
 
-#define MACH_NAME	MACHNAME(LEMOTE, FULOONG, LOONGSON_2F, UNKNOWN)
+#define MACHTYPE	MACH_LEMOTE_FL2F
 
 #define LOONGSON_UART_BASE		(LOONGSON_PCIIO_BASE + 0x2f8)
 #define LOONGSON_UART_BAUD		1843200
@@ -37,8 +38,7 @@
 
 #else /* CONFIG_CPU_YEELOONG2F */
 
-/* by default, set it as 8.9INCH? or UNKNOWN? */
-#define MACH_NAME	MACHNAME(LEMOTE, YEELOONG, LOONGSON_2F, _89INCH)
+#define MACHTYPE	MACH_LEMOTE_YL2F89
 
 /* yeeloong use the CPU serial port of Loongson2F */
 #define LOONGSON_UART_BASE		(LOONGSON_LIO1_BASE + 0x3f8)
arch/mips/include/asm/mach-loongson/machtype.h deleted +0 -32
deleted file mode 100644
index 9f96926..0000000
@@ -1,32 +0,0 @@
-/*
- * machine type header file
- */
-
-#ifndef _MACHTYPE_H
-#define _MACHTYPE_H
-
-#define UNKNOWN		"unknown"
-
-/* company */
-#define LEMOTE		"lemote"
-#define DEXOON		"dexoon"
-
-/* product */
-#define FULOONG		"fuloong"
-#define YEELOONG	"yeeloong"
-#define	GDIUM		"gdium"
-
-/* cpu revision */
-#define LOONGSON_2E			"2e"
-#define LOONGSON_2F 		"2f"
-
-/* size */
-#define _7INCH			"7"
-#define	_89INCH			"8.9"
-
-#define MACHNAME_LEN	50
-
-#define MACHNAME(company, product, cpu, size) \
-	(company "-" product "-" cpu "-" size "inch\0")
-
-#endif /* ! _MACHTYPE_H */
arch/mips/loongson/common/machtype.c +22 -28

77 lines not on this page · raw message

arch/mips/loongson/yeeloong-2f/init.c +1 -2
index 80f8c5e..5d16e66 100644
@@ -18,7 +18,6 @@
 #include <asm/bootinfo.h>
 
 #include <cs5536/cs5536.h>
-#include <machtype.h>
 
 void __init mach_prom_init_cmdline(void)
 {
@@ -77,6 +76,6 @@ void __init mach_prom_init_cmdline(void)
 
 	if ((strstr(arcs_cmdline, "vga") == NULL)
 			&& (strstr(arcs_cmdline, "machtype") != NULL)
-				&& (strstr(arcs_cmdline, _7INCH) != NULL))
+				&& (strstr(arcs_cmdline, "7inch") != NULL))
 		strcat(arcs_cmdline, " vga=800x480x24");
 }
arch/mips/loongson/yeeloong-2f/reset.c +4 -3
index 124cf99..46394c2 100644
@@ -15,7 +15,6 @@
 
 #include <loongson.h>
 #include <machine.h>
-#include <machtype.h>
 
 /*
  * The following registers are determined by the EC index configuration.
@@ -59,12 +58,14 @@ void mach_prepare_reboot(void)
 
 void mach_prepare_shutdown(void)
 {
-	if (strstr(get_system_type(), _89INCH)) {
+	char *system_type = get_system_type();
+
+	if (strstr(system_type, "8.9inch")) {
 		/* cpu-gpio0 output low */
 		LOONGSON_GPIODATA &= ~0x00000001;
 		/* cpu-gpio0 as output */
 		LOONGSON_GPIOIE &= ~0x00000001;
-	} else if (strstr(get_system_type(), _7INCH)) {
+	} else if (strstr(system_type, "7inch")) {
 		u8 val;
 		u64 i;
 
Signature · 8 lines
1.6.3.1


-- 
Zhang, Le
Gentoo/Loongson Developer
http://zhangle.is-a-geek.org
0260 C902 B8F8 6506 6586 2B90 BC51 C808 1E4E 2973
#23 lore raw

Re: [loongson-dev] Re: [loongson-PATCH-v3 17/25] add a machtype kernel command line argument

On 04:31 Thu 11 Jun , Zhang Le wrote:

[...]

Quoted 5 lines
arch/mips/loongson/common/machtype.c +0 -0
index d469dc7..34417cf 100644

[...]

Quoted 2 lines
arch/mips/loongson/common/machtype.c +1 -1
-static __init int machname_setup(char *str)
+static __init int machtype_setup(char *str)

[...]

arch/mips/loongson/common/machtype.c line 45

Quoted 8 lines
arch/mips/loongson/common/machtype.c +2 -6
-	for (index = 0;
-	     index < MACHTYPE_TOTAL;
-	     index++) {
-		if (strstr(str, machname[index]) != NULL) {
-			mips_machtype = index;
-			return 0;
+	for (; system_types[machtype]; machtype++)
+		if (strstr(str, system_types[machtype])) {

There is a problem here.

Because I have used "inches" instead of "inch" in system_types, if you insist on using "inch" when passing value to the machtype kernel parameter, this strstr() call's two parameters should be swapped:

             if (strstr(system_types[machtype], str)) {
Quoted 10 lines
arch/mips/loongson/common/machtype.c +4 -3
+			mips_machtype = machtype;
+			break;
 		}
-	}
-	return -1;
+	return 0;
 }
 
-__setup("machtype=", machname_setup);
+__setup("machtype=", machtype_setup);
Signature · 4 lines
Zhang, Le
Gentoo/Loongson Developer
http://zhangle.is-a-geek.org
0260 C902 B8F8 6506 6586 2B90 BC51 C808 1E4E 2973
#24 lore raw

Re: [loongson-dev] Re: [loongson-PATCH-v3 17/25] add a machtype kernel command line argument

Quoted 28 lines · Zhang Le

On 04:31 Thu 11 Jun , Zhang Le wrote:

[...]

Quoted 5 lines
arch/mips/loongson/common/machtype.c +0 -0
index d469dc7..34417cf 100644

[...]

Quoted 2 lines
arch/mips/loongson/common/machtype.c +1 -1
-static __init int machname_setup(char *str)
+static __init int machtype_setup(char *str)

[...]

arch/mips/loongson/common/machtype.c line 45

Quoted 8 lines
arch/mips/loongson/common/machtype.c +2 -6
-	for (index = 0;
-	     index < MACHTYPE_TOTAL;
-	     index++) {
-		if (strstr(str, machname[index]) != NULL) {
-			mips_machtype = index;
-			return 0;
+	for (; system_types[machtype]; machtype++)
+		if (strstr(str, system_types[machtype])) {

There is a problem here.

Quoted 6 lines

Because I have used "inches" instead of "inch" in system_types, if you insist on using "inch" when passing value to the machtype kernel parameter, this strstr() call's two parameters should be swapped:

             if (strstr(system_types[machtype], str)) {

Acked.

thanks!
Wu Zhangjin

Quoted 13 lines
Quoted 11 lines
arch/mips/loongson/common/machtype.c +4 -3
+			mips_machtype = machtype;
+			break;
 		}
-	}
-	return -1;
+	return 0;
 }
 
-__setup("machtype=", machname_setup);
+__setup("machtype=", machtype_setup);
author Applied
#25 lore raw

Re: [loongson-dev] Re: [loongson-PATCH-v3 17/25] add a machtype kernel command line argument

In reply to Zhang Le

Hi,

Applied, thanks!

but before you sending this patch, I have tuned the machtype implementation(mainly remove the duplicated MACHNAME defined in machine.h) and merged some patches, so, this patch can not be applied directly, but i have applied it manually. and also, i will merge it to my previous machtype patches.

thanks!
Wu Zhangjin

Quoted 280 lines · Zhang Le

So this is the patch. I should say this patch is a bit intrusive againt your verion. But I think I could justify the changes.

1. MACHNAME macro seems to be a little over engineered. And with MACHNAME, system type becomes "lemote-fuloong-2f-unknowninch" which does not make much sense. So I removed it. As a result, include/asm/mach-loongson/machtype.h is not needed anymore. I also modified loongson/yeeloong-2f/{init,reset}.c, because _89INCH and _7INCH no longer exist.

2. 3 machine names are defined twice, once in loongson/common/machtype.c, once in include/asm/mach-loongson/machine.h. In my patch, all the system types are defined in loongson/common/machtype.c, as an array called system_types. Other loongson based machine, like Gdium, could add their system type to this array.

3. I defined symbolic names for the system_types array's index. In include/asm/mach-loongson/machine.h, I defined macro MACHTYPE using these symbolic names, so that we can get system type from system_types array using MACHTYPE as index.

4. Add NULL to the end of system_types array, so MACHTYPE_TOTAL is not needed.

5. mips_machtype already has initial value MACH_UNKNOWN, so MACHTYPE_DEFAULT is not needed.

6. modified the for loop in machtype_setup accordingly.

---
 arch/mips/include/asm/bootinfo.h               |   11 +++++
 arch/mips/include/asm/mach-loongson/machine.h  |    8 ++--
 arch/mips/include/asm/mach-loongson/machtype.h |   32 ---------------
 arch/mips/loongson/common/machtype.c           |   50 ++++++++++-------------
 arch/mips/loongson/yeeloong-2f/init.c          |    3 +-
 arch/mips/loongson/yeeloong-2f/reset.c         |    7 ++-
 6 files changed, 42 insertions(+), 69 deletions(-)
 delete mode 100644 arch/mips/include/asm/mach-loongson/machtype.h
arch/mips/include/asm/bootinfo.h +11 -0
index 610fe3a..0d9c7ff 100644
@@ -7,6 +7,7 @@
  * Copyright (C) 1995, 1996 Andreas Busse
  * Copyright (C) 1995, 1996 Stoned Elipot
  * Copyright (C) 1995, 1996 Paul M. Antoine.
+ * Copyright (C) 2009       Zhang Le
  */
 #ifndef _ASM_BOOTINFO_H
 #define _ASM_BOOTINFO_H
@@ -57,6 +58,16 @@
 #define	MACH_MIKROTIK_RB532	0	/* Mikrotik RouterBoard 532 	*/
 #define MACH_MIKROTIK_RB532A	1	/* Mikrotik RouterBoard 532A 	*/
 
+/*
+ * Valid machtype for group Loongson
+ */
+#define MACH_LOONGSON_UNKNOWN	0
+#define MACH_LEMOTE_FL2E	1
+#define MACH_LEMOTE_FL2F	2
+#define MACH_LEMOTE_YL2F89	3
+#define MACH_LEMOTE_YL2F7	4
+#define MACH_LOONGSON_END	5
+
 #define CL_SIZE			COMMAND_LINE_SIZE
 
 extern char *system_type;
arch/mips/include/asm/mach-loongson/machine.h +4 -4
index 8109a9e..e168625 100644
@@ -2,6 +2,7 @@
  * board-specific header file
  *
  * Copyright (c) 2009 Wu Zhangjin <[email protected]>
+ * Copyright (c) 2009 Zhang Le <[email protected]>
  *
  * This program is free software; you can redistribute it
  * and/or modify it under the terms of the GNU General
@@ -15,7 +16,7 @@
 
 #ifdef CONFIG_LEMOTE_FULOONG2E
 
-#define MACH_NAME	MACHNAME(LEMOTE, FULOONG, LOONGSON_2E, UNKNOWN)
+#define MACHTYPE	MACH_LEMOTE_FL2E
 
 #define LOONGSON_UART_BASE		(LOONGSON_PCIIO_BASE + 0x3f8)
 #define	LOONGSON_UART_BAUD		1843200
@@ -29,7 +30,7 @@
 
 #elif defined(CONFIG_LEMOTE_FULOONG2F)
 
-#define MACH_NAME	MACHNAME(LEMOTE, FULOONG, LOONGSON_2F, UNKNOWN)
+#define MACHTYPE	MACH_LEMOTE_FL2F
 
 #define LOONGSON_UART_BASE		(LOONGSON_PCIIO_BASE + 0x2f8)
 #define LOONGSON_UART_BAUD		1843200
@@ -37,8 +38,7 @@
 
 #else /* CONFIG_CPU_YEELOONG2F */
 
-/* by default, set it as 8.9INCH? or UNKNOWN? */
-#define MACH_NAME	MACHNAME(LEMOTE, YEELOONG, LOONGSON_2F, _89INCH)
+#define MACHTYPE	MACH_LEMOTE_YL2F89
 
 /* yeeloong use the CPU serial port of Loongson2F */
 #define LOONGSON_UART_BASE		(LOONGSON_LIO1_BASE + 0x3f8)
arch/mips/include/asm/mach-loongson/machtype.h deleted +0 -32
deleted file mode 100644
index 9f96926..0000000
@@ -1,32 +0,0 @@
-/*
- * machine type header file
- */
-
-#ifndef _MACHTYPE_H
-#define _MACHTYPE_H
-
-#define UNKNOWN		"unknown"
-
-/* company */
-#define LEMOTE		"lemote"
-#define DEXOON		"dexoon"
-
-/* product */
-#define FULOONG		"fuloong"
-#define YEELOONG	"yeeloong"
-#define	GDIUM		"gdium"
-
-/* cpu revision */
-#define LOONGSON_2E			"2e"
-#define LOONGSON_2F 		"2f"
-
-/* size */
-#define _7INCH			"7"
-#define	_89INCH			"8.9"
-
-#define MACHNAME_LEN	50
-
-#define MACHNAME(company, product, cpu, size) \
-	(company "-" product "-" cpu "-" size "inch\0")
-
-#endif /* ! _MACHTYPE_H */
arch/mips/loongson/common/machtype.c +22 -28
index d469dc7..34417cf 100644
@@ -2,6 +2,8 @@
  * Copyright (C) 2009 Lemote Inc. & Insititute of Computing Technology
  * Author: Wu Zhangjin, [email protected]
  *
+ * Copyright (c) 2009 Zhang Le <[email protected]>
+ *
  * 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
@@ -10,49 +12,41 @@
 
 #include <linux/errno.h>
 #include <asm/cpu.h>
-
 #include <asm/bootinfo.h>
 
 #include <loongson.h>
-#include <machtype.h>
 #include <machine.h>
 
-static char machname[][MACHNAME_LEN] = {
-	MACHNAME(LEMOTE, FULOONG, LOONGSON_2E, UNKNOWN),
-	MACHNAME(LEMOTE, FULOONG, LOONGSON_2F, UNKNOWN),
-	MACHNAME(LEMOTE, YEELOONG, LOONGSON_2F, _89INCH),
-	MACHNAME(LEMOTE, YEELOONG, LOONGSON_2F, _7INCH),
+static const char *system_types[] = {
+	[MACH_LOONGSON_UNKNOWN]		"unknown loongson machine",
+	[MACH_LEMOTE_FL2E]		"lemote-fuloong-2e-box",
+	[MACH_LEMOTE_FL2F]		"lemote-fuloong-2f-box",
+	[MACH_LEMOTE_YL2F89]		"lemote-yeeloong-2f-8.9inches",
+	[MACH_LEMOTE_YL2F7]		"lemote-yeeloong-2f-7inches",
+	[MACH_LOONGSON_END]		NULL,
 };
 
-#define MACHTYPE_TOTAL	(sizeof(machname)/MACHNAME_LEN)
-#define MACHTYPE_DEFAULT	-1
-
 const char *get_system_type(void)
 {
-	if (mips_machtype == MACHTYPE_DEFAULT)
-		return MACH_NAME;
-	else
-		return machname[mips_machtype];
+	if (mips_machtype == MACH_UNKNOWN)
+		mips_machtype = MACHTYPE;
+
+	return system_types[mips_machtype];
 }
 
-static __init int machname_setup(char *str)
+static __init int machtype_setup(char *str)
 {
-	int index;
+	int machtype = MACH_LEMOTE_FL2E;
 
 	if (!str)
-			return -EINVAL;
-
-	mips_machtype = MACHTYPE_DEFAULT;
+		return -EINVAL;
 
-	for (index = 0;
-	     index < MACHTYPE_TOTAL;
-	     index++) {
-		if (strstr(str, machname[index]) != NULL) {
-			mips_machtype = index;
-			return 0;
+	for (; system_types[machtype]; machtype++)
+		if (strstr(str, system_types[machtype])) {
+			mips_machtype = machtype;
+			break;
 		}
-	}
-	return -1;
+	return 0;
 }
 
-__setup("machtype=", machname_setup);
+__setup("machtype=", machtype_setup);
arch/mips/loongson/yeeloong-2f/init.c +1 -2
index 80f8c5e..5d16e66 100644
@@ -18,7 +18,6 @@
 #include <asm/bootinfo.h>
 
 #include <cs5536/cs5536.h>
-#include <machtype.h>
 
 void __init mach_prom_init_cmdline(void)
 {
@@ -77,6 +76,6 @@ void __init mach_prom_init_cmdline(void)
 
 	if ((strstr(arcs_cmdline, "vga") == NULL)
 			&& (strstr(arcs_cmdline, "machtype") != NULL)
-				&& (strstr(arcs_cmdline, _7INCH) != NULL))
+				&& (strstr(arcs_cmdline, "7inch") != NULL))
 		strcat(arcs_cmdline, " vga=800x480x24");
 }
arch/mips/loongson/yeeloong-2f/reset.c +4 -3
index 124cf99..46394c2 100644
@@ -15,7 +15,6 @@
 
 #include <loongson.h>
 #include <machine.h>
-#include <machtype.h>
 
 /*
  * The following registers are determined by the EC index configuration.
@@ -59,12 +58,14 @@ void mach_prepare_reboot(void)
 
 void mach_prepare_shutdown(void)
 {
-	if (strstr(get_system_type(), _89INCH)) {
+	char *system_type = get_system_type();
+
+	if (strstr(system_type, "8.9inch")) {
 		/* cpu-gpio0 output low */
 		LOONGSON_GPIODATA &= ~0x00000001;
 		/* cpu-gpio0 as output */
 		LOONGSON_GPIOIE &= ~0x00000001;
-	} else if (strstr(get_system_type(), _7INCH)) {
+	} else if (strstr(system_type, "7inch")) {
 		u8 val;
 		u64 i;
 
Signature · 1 line
1.6.3.1
#26 lore raw

PATCH 18/25 Add Siliconmotion 712 framebuffer driver

In reply to a message not in the archive

From: Wu Zhangjin <[email protected]>

yeeloong(2f) laptop has a SMI video card, need this driver.

this source code is originally from
http://dev.lemote.com/code/linux_loongson

tons of warnings have been fixed, the main warning is:

warning: left shift count >= width of type

have been fixed via the following modification:

      drivers/video/smi/smtc2d.h:

      #define _F_MASK(f) ((((1 << _F_SIZE(f)) - 1) << _F_START(f))
      #define _F_MASK(f) (((1ULL << _F_SIZE(f)) - 1) << _F_START(f))

besides, the coding style is changed to follow the kernel style, and two non-used header files are removed: sm501hw.h, sm7xxhw.h.

and there is no need to define a screen_info again so remove it, because it is defined in arch/mips/kernel/setup.c and not relative to big endian or little endian, and here I think its better use something like 1024x600x24 than 0x318, so replace all of the magic numbers to an understandable one.

with the support of this patch, we can use the same kernel for 7inch and 8.9inch yeeloong laptop, but need pass a commandline argument for 7inch baord:

vga=800x480x24

---
 drivers/video/Kconfig      |   23 +
 drivers/video/Makefile     |    1 +
 drivers/video/smi/Makefile |    8 +
 drivers/video/smi/smtc2d.c |  979 +++++++++++++++++++++++++++++++++++++
 drivers/video/smi/smtc2d.h |  530 +++++++++++++++++++++
 drivers/video/smi/smtcfb.c | 1138 ++++++++++++++++++++++++++++++++++++++++++++
 drivers/video/smi/smtcfb.h |  793 ++++++++++++++++++++++++++++++
 7 files changed, 3472 insertions(+), 0 deletions(-)
 create mode 100644 drivers/video/smi/Makefile
 create mode 100644 drivers/video/smi/smtc2d.c
 create mode 100644 drivers/video/smi/smtc2d.h
 create mode 100644 drivers/video/smi/smtcfb.c
 create mode 100644 drivers/video/smi/smtcfb.h
drivers/video/Kconfig +23 -0
index 0048f11..b6ba27f 100644
@@ -1930,6 +1930,29 @@ config FB_S3C2410_DEBUG
 	  Turn on debugging messages. Note that you can set/unset at run time
 	  through sysfs
 
+config FB_SILICONMOTION
+	bool "Silicon Motion Display Support"
+	depends on FB
+	help
+	  Frame Buffer driver for the Silicon Motion serial graphic card.
+
+config FB_SM7XX
+	bool "Silicon Motion SM7XX Frame Buffer Support"
+	depends on FB_SILICONMOTION
+	depends on FB
+	select FB_CFB_FILLRECT
+	select FB_CFB_COPYAREA
+	select FB_CFB_IMAGEBLIT
+	help
+	  Frame Buffer driver for the Silicon Motion SM7XX serial graphic card.
+
+config FB_SM7XX_ACCEL
+	bool "Siliconmotion Acceleration functions (EXPERIMENTAL)"
+	depends on FB_SM7XX && EXPERIMENTAL
+	help
+	This will compile the Trident frame buffer device with
+	acceleration functions.
+
 config FB_SM501
 	tristate "Silicon Motion SM501 framebuffer support"
 	depends on FB && MFD_SM501
drivers/video/Makefile +1 -0
index d8d0be5..caf6d8c 100644
@@ -70,6 +70,7 @@ obj-$(CONFIG_FB_P9100)            += p9100.o sbuslib.o
 obj-$(CONFIG_FB_TCX)              += tcx.o sbuslib.o
 obj-$(CONFIG_FB_LEO)              += leo.o sbuslib.o
 obj-$(CONFIG_FB_SGIVW)            += sgivwfb.o
+obj-$(CONFIG_FB_SILICONMOTION)    += smi/
 obj-$(CONFIG_FB_ACORN)            += acornfb.o
 obj-$(CONFIG_FB_ATARI)            += atafb.o c2p_iplan2.o atafb_mfb.o \
                                      atafb_iplan2p2.o atafb_iplan2p4.o atafb_iplan2p8.o
drivers/video/smi/Makefile new file +8 -0
new file mode 100644
index 0000000..0058148
@@ -0,0 +1,8 @@
+obj-y += smi.o
+
+smi-y := $(DRIVER_OBJS)
+
+smi-y += smtcfb.o
+
+EXTRA_CFLAGS += -Werror
+
drivers/video/smi/smtc2d.c new file +979 -0

979 lines not on this page · raw message

drivers/video/smi/smtc2d.h new file +530 -0

530 lines not on this page · raw message

drivers/video/smi/smtcfb.c new file +1138 -0

1,138 lines not on this page · raw message

drivers/video/smi/smtcfb.h new file +793 -0

309 lines not on this page · raw message

The rest of this diff is not shown. View the raw message.

Signature · 1 line
1.6.0.4

Part of the diff is not shown here. View the raw message.

#27 lore raw

Re: [loongson-PATCH-v3 18/25] Add Siliconmotion 712 framebuffer driver

Quoted 31 lines · [email protected] wrote:

From: Wu Zhangjin <[email protected]>

yeeloong(2f) laptop has a SMI video card, need this driver.

this source code is originally from
http://dev.lemote.com/code/linux_loongson

tons of warnings have been fixed, the main warning is:

warning: left shift count >= width of type

have been fixed via the following modification:

      drivers/video/smi/smtc2d.h:

      #define _F_MASK(f) ((((1 << _F_SIZE(f)) - 1) << _F_START(f))
      #define _F_MASK(f) (((1ULL << _F_SIZE(f)) - 1) << _F_START(f))

besides, the coding style is changed to follow the kernel style, and two non-used header files are removed: sm501hw.h, sm7xxhw.h.

and there is no need to define a screen_info again so remove it, because it is defined in arch/mips/kernel/setup.c and not relative to big endian or little endian, and here I think its better use something like 1024x600x24 than 0x318, so replace all of the magic numbers to an understandable one.

with the support of this patch, we can use the same kernel for 7inch and 8.9inch yeeloong laptop, but need pass a commandline argument for 7inch baord:

Quoted 6 lines

vga=800x480x24

---

Hi Wu

I noticed that the framebuffer console is distored/non-readable/totally-unusable when choosing a mode with 24 or 32 bit-per-pixel and CONFIG_FB_SM7XX_ACCEL

With 16 bpp or not choosing accelerated drawing, everything is fine.

Can you please test with your setup e.g. with CONFIG_FB_SM7XX_ACCEL set and a high-bpp mode like vga=1024x768x24

I still have some problems with mode setting, as i understand it:

1.
sm712vga_setup() is registered to parse the desired
vga= mode, when a valid string from vesa_mode[] is found, screen_info is initialized accordingly

2.
smtcfb_init() checks for initialized screen_info and eighter uses that mode or hardcoded default, transfers the mode to sfb->fb.var and calls

3.
smtcfb_setmode(sfb), which calls
smtc_set_timing(sfb, &hw), which is a wrapper to
sm712_set_timing(sfb, ppar_info)

4.
sm712_set_timing() will check if the desired mode can be found in table VGAMode[], and if so will program the graphics engine with the values from VGAMode[]

in table VGAMode[], only a certain set of modes is defined:
640x480x 16,24,32
800x600x 16,24,32
1024x600x16
1024x768x 24,32
320x240x 16,32

yet when the desired mode is not found in VGAMode[], still the the following code is executed from in sm712_set_timing()

for ("iterate over VGAMode[]") {
if ("found mode in VGAMode[]") {
"set mode"
}

+ smtc_mmiowb(0x67, 0x3c2);
+
+ /* set VPR registers */
+ writel(0x0, ppar_info->m_pVPR + 0x0C);
+ writel(0x0, ppar_info->m_pVPR + 0x40);
+
+ /* set data width */
+ m_nScreenStride =
+ (ppar_info->width * sfb->fb.var.bits_per_pixel) / 64;
+ switch (sfb->fb.var.bits_per_pixel) {
+ case 8:
+ writel(0x0, ppar_info->m_pVPR + 0x0);
+ break;
+ case 16:
+ writel(0x00020000, ppar_info->m_pVPR + 0x0);
+ break;
+ case 24:
+ writel(0x00040000, ppar_info->m_pVPR + 0x0);
+ break;
+ case 32:
+ writel(0x00030000, ppar_info->m_pVPR + 0x0);
+ break;
+ }
+ writel((u32) (((m_nScreenStride + 2) << 16) | m_nScreenStride),
+ ppar_info->m_pVPR + 0x10);

} /* for ("iterate over VGAMode[]") */

..., what I do not understand is how you setup a mode like

vga=800x480x24

which is not defined in VGAMode[]. Doesnt the modesetting then simply break, silently?

BTW, the datasheet for this chip is available, search for
"LynxEM+ DataBook"
I think the missing mode values can be figured out from it, if someone takes the time...

Am I missing something here? I have commented the relevant code, following beneath

Best regards
Simon

the modes that can be set with vga=

Quoted 16 lines
drivers/video/smi/smtcfb.c new file +16 -0
+struct vesa_mode_table {
+	char mode_index[15];
+	u16 lfb_width;
+	u16 lfb_height;
+	u16 lfb_depth;
+};
+
+static struct vesa_mode_table vesa_mode[] = {
+	{"640x480x8", 640, 480, 8},
+	{"800x480x8", 800, 480, 8},
+	{"800x600x8", 800, 600, 8},
+	{"1024x768x8", 1024, 768, 8},
+	{"1280x1024x8", 1280, 1024, 8},
+
+	{"640x480x16", 640, 480, 16},
+	{"800x480x16", 800, 480, 16},

drivers/video/smi/smtcfb.c line 118

Quoted 10 lines
drivers/video/smi/smtcfb.c new file +10 -0
+	{"800x600x16", 800, 600, 16},
+	{"1024x768x16", 1024, 768, 16},
+	{"1280x1024x16", 1280, 1024, 16},
+
+	{"640x480x24", 640, 480, 24},
+	{"800x480x24", 800, 480, 24},
+	{"800x600x24", 800, 600, 24},
+	{"1024x768x24", 1024, 768, 24},
+	{"1280x1024x24", 1280, 1024, 24},
+};

mode setting

Quoted 98 lines
drivers/video/smi/smtcfb.c new file +98 -0
+static void sm712_set_timing(struct smtcfb_info *sfb,
+			     struct par_info *ppar_info)
+{
+	int i = 0, j = 0;
+	u32 m_nScreenStride;
+
+	smdbg("\nppar_info->width = %d ppar_info->height = %d"
+			"sfb->fb.var.bits_per_pixel = %d ppar_info->hz = %d\n",
+			ppar_info->width, ppar_info->height,
+			sfb->fb.var.bits_per_pixel, ppar_info->hz);
+
+	for (j = 0; j < numVGAModes; j++) {
+		if (VGAMode[j].mmSizeX == ppar_info->width &&
+		    VGAMode[j].mmSizeY == ppar_info->height &&
+		    VGAMode[j].bpp == sfb->fb.var.bits_per_pixel &&
+		    VGAMode[j].hz == ppar_info->hz) {
+
+			smdbg("\nVGAMode[j].mmSizeX  = %d VGAMode[j].mmSizeY ="
+					"%d VGAMode[j].bpp = %d"
+					"VGAMode[j].hz=%d\n",
+					VGAMode[j].mmSizeX, VGAMode[j].mmSizeY,
+					VGAMode[j].bpp, VGAMode[j].hz);
+
+			smdbg("VGAMode index=%d\n", j);
+
+			smtc_mmiowb(0x0, 0x3c6);
+
+			smtc_seqw(0, 0x1);
+
+			smtc_mmiowb(VGAMode[j].Init_MISC, 0x3c2);
+
+			/* init SEQ register SR00 - SR04 */
+			for (i = 0; i < SIZE_SR00_SR04; i++)
+				smtc_seqw(i, VGAMode[j].Init_SR00_SR04[i]);
+
+			/* init SEQ register SR10 - SR24 */
+			for (i = 0; i < SIZE_SR10_SR24; i++)
+				smtc_seqw(i + 0x10,
+					  VGAMode[j].Init_SR10_SR24[i]);
+
+			/* init SEQ register SR30 - SR75 */
+			for (i = 0; i < SIZE_SR30_SR75; i++)
+				if (((i + 0x30) != 0x62) \
+					&& ((i + 0x30) != 0x6a) \
+					&& ((i + 0x30) != 0x6b))
+					smtc_seqw(i + 0x30,
+						VGAMode[j].Init_SR30_SR75[i]);
+
+			/* init SEQ register SR80 - SR93 */
+			for (i = 0; i < SIZE_SR80_SR93; i++)
+				smtc_seqw(i + 0x80,
+					  VGAMode[j].Init_SR80_SR93[i]);
+
+			/* init SEQ register SRA0 - SRAF */
+			for (i = 0; i < SIZE_SRA0_SRAF; i++)
+				smtc_seqw(i + 0xa0,
+					  VGAMode[j].Init_SRA0_SRAF[i]);
+
+			/* init Graphic register GR00 - GR08 */
+			for (i = 0; i < SIZE_GR00_GR08; i++)
+				smtc_grphw(i, VGAMode[j].Init_GR00_GR08[i]);
+
+			/* init Attribute register AR00 - AR14 */
+			for (i = 0; i < SIZE_AR00_AR14; i++)
+				smtc_attrw(i, VGAMode[j].Init_AR00_AR14[i]);
+
+			/* init CRTC register CR00 - CR18 */
+			for (i = 0; i < SIZE_CR00_CR18; i++)
+				smtc_crtcw(i, VGAMode[j].Init_CR00_CR18[i]);
+
+			/* init CRTC register CR30 - CR4D */
+			for (i = 0; i < SIZE_CR30_CR4D; i++)
+				smtc_crtcw(i + 0x30,
+					   VGAMode[j].Init_CR30_CR4D[i]);
+
+			/* init CRTC register CR90 - CRA7 */
+			for (i = 0; i < SIZE_CR90_CRA7; i++)
+				smtc_crtcw(i + 0x90,
+					   VGAMode[j].Init_CR90_CRA7[i]);
+		}
+	}
+	smtc_mmiowb(0x67, 0x3c2);
+
+	/* set VPR registers */
+	writel(0x0, ppar_info->m_pVPR + 0x0C);
+	writel(0x0, ppar_info->m_pVPR + 0x40);
+
+	/* set data width */
+	m_nScreenStride =
+		(ppar_info->width * sfb->fb.var.bits_per_pixel) / 64;
+	switch (sfb->fb.var.bits_per_pixel) {
+	case 8:
+		writel(0x0, ppar_info->m_pVPR + 0x0);
+		break;
+	case 16:
+		writel(0x00020000, ppar_info->m_pVPR + 0x0);
+		break;
+	case 24:

drivers/video/smi/smtcfb.c line 267

Quoted 10 lines
drivers/video/smi/smtcfb.c new file +10 -0
+		writel(0x00040000, ppar_info->m_pVPR + 0x0);
+		break;
+	case 32:
+		writel(0x00030000, ppar_info->m_pVPR + 0x0);
+		break;
+	}
+	writel((u32) (((m_nScreenStride + 2) << 16) | m_nScreenStride),
+	       ppar_info->m_pVPR + 0x10);
+
+}

wrapper for modesetting

drivers/video/smi/smtcfb.c line 299

Quoted 12 lines
drivers/video/smi/smtcfb.c new file +12 -0
+
+static void smtc_set_timing(struct smtcfb_info *sfb, struct par_info
+		*ppar_info)
+{
+	switch (ppar_info->chipID) {
+	case 0x710:
+	case 0x712:
+	case 0x720:
+		sm712_set_timing(sfb, ppar_info);
+		break;
+	}
+}

mode setting is called from here

Quoted 43 lines
drivers/video/smi/smtcfb.c new file +43 -0
+
+static int __init smtcfb_init(void)
+{
+	struct smtcfb_info *sfb;
+	u_long smem_size = 0x00800000;	/* default 8MB */
+	char name[16];
+	int err, i = 0;
+	unsigned long pFramebufferPhysical;
+	struct pci_dev *pdev = NULL;
+
+	printk(KERN_INFO
+		"Silicon Motion display driver " SMTC_LINUX_FB_VERSION "\n");
+
+	/* init the global variable */
+	smtc_2Dacceleration = 0;	/* default no 2D acceleration */
+
+	do {
+		pdev = pci_get_device(0x126f, smtc_ChipIDs[i], pdev);
+		if (pdev == NULL) {
+			i++;
+		} else {
+			hw.chipID = smtc_ChipIDs[i];
+			break;
+		}
+	} while (i < numSMTCchipIDs);
+
+	err = pci_enable_device(pdev);	/* enable SMTC chip */
+
+	if (err)
+		return err;
+
+	err = -ENOMEM;
+
+	sprintf(name, "sm%Xfb", hw.chipID);
+
+	sfb = smtc_alloc_fb_info(pdev, name);
+
+	if (!sfb)
+		goto failed;
+
+	sm7xx_init_hw();
+
+	/*get mode parameter from screen_info */

drivers/video/smi/smtcfb.c line 920

Quoted 10 lines
drivers/video/smi/smtcfb.c new file +10 -0
+	if (screen_info.lfb_width != 0) {
+		sfb->fb.var.xres = screen_info.lfb_width;
+		sfb->fb.var.yres = screen_info.lfb_height;
+		sfb->fb.var.bits_per_pixel = screen_info.lfb_depth;
+	} else {
+		/* default resolution 1024x600 16bit mode */
+		sfb->fb.var.xres = SCREEN_X_RES;
+		sfb->fb.var.yres = SCREEN_Y_RES;
+		sfb->fb.var.bits_per_pixel = SCREEN_BPP;
+	}

use eighter the values derived from vga= or the hardcoded defaults

Quoted 94 lines
drivers/video/smi/smtcfb.c new file +94 -0
+
+	smdbg("\nsfb->fb.var.bits_per_pixel = %d sm712be_flag = %d\n",
+	      sfb->fb.var.bits_per_pixel, sm712be_flag);
+#ifdef __BIG_ENDIAN
+	if (sm712be_flag == 1 && sfb->fb.var.bits_per_pixel == 24)
+		sfb->fb.var.bits_per_pixel = (screen_info.lfb_depth = 32);
+#endif
+	/* Map address and memory detection */
+	pFramebufferPhysical = pci_resource_start(pdev, 0);
+	pci_read_config_byte(pdev, PCI_REVISION_ID, &hw.chipRevID);
+
+	switch (hw.chipID) {
+	case 0x710:
+	case 0x712:
+		sfb->fb.fix.mmio_start = pFramebufferPhysical + 0x00400000;
+		sfb->fb.fix.mmio_len = 0x00400000;
+		smem_size = SM712_VIDEOMEMORYSIZE;
+#ifdef __BIG_ENDIAN
+		hw.m_pLFB = (smtc_VRAMBaseAddress =
+		    ioremap(pFramebufferPhysical, 0x00c00000));
+#else
+		hw.m_pLFB = (smtc_VRAMBaseAddress =
+		    ioremap(pFramebufferPhysical, 0x00800000));
+#endif
+		hw.m_pMMIO = (smtc_RegBaseAddress =
+		    smtc_VRAMBaseAddress + 0x00700000);
+		smtc_2DBaseAddress = (hw.m_pDPR =
+		    smtc_VRAMBaseAddress + 0x00408000);
+		smtc_2Ddataport = smtc_VRAMBaseAddress + DE_DATA_PORT_712;
+		hw.m_pVPR = hw.m_pLFB + 0x0040c000;
+		if (sfb->fb.var.bits_per_pixel == 32) {
+#ifdef __BIG_ENDIAN
+			smtc_VRAMBaseAddress += 0x800000;
+			hw.m_pLFB += 0x800000;
+			printk(KERN_INFO
+				"\nsmtc_VRAMBaseAddress=0x%X hw.m_pLFB=0x%X\n",
+					smtc_VRAMBaseAddress, hw.m_pLFB);
+#endif
+		}
+		if (!smtc_RegBaseAddress) {
+
+			printk(KERN_INFO
+				"%s: unable to map memory mapped IO\n",
+				sfb->fb.fix.id);
+
+			return -ENOMEM;
+		}
+
+		/* set MCLK = 14.31818 * (0x16 / 0x2) */
+		smtc_seqw(0x6a, 0x16);
+		smtc_seqw(0x6b, 0x02);
+		smtc_seqw(0x62, 0x3e);
+		/* enable PCI burst */
+		smtc_seqw(0x17, 0x20);
+		/* enabel word swap */
+		if (sfb->fb.var.bits_per_pixel == 32) {
+#ifdef __BIG_ENDIAN
+			smtc_seqw(0x17, 0x30);
+#endif
+		}
+#ifdef CONFIG_FB_SM7XX_ACCEL
+		smtc_2Dacceleration = 1;
+#endif
+
+		break;
+
+	case 0x720:
+		sfb->fb.fix.mmio_start = pFramebufferPhysical;
+		sfb->fb.fix.mmio_len = 0x00200000;
+		smem_size = SM722_VIDEOMEMORYSIZE;
+		smtc_2DBaseAddress = (hw.m_pDPR =
+		    ioremap(pFramebufferPhysical, 0x00a00000));
+		hw.m_pLFB = (smtc_VRAMBaseAddress =
+		    smtc_2DBaseAddress + 0x00200000);
+		hw.m_pMMIO = (smtc_RegBaseAddress =
+		    smtc_2DBaseAddress + 0x000c0000);
+		smtc_2Ddataport = smtc_2DBaseAddress + DE_DATA_PORT_722;
+		hw.m_pVPR = smtc_2DBaseAddress + 0x800;
+
+		smtc_seqw(0x62, 0xff);
+		smtc_seqw(0x6a, 0x0d);
+		smtc_seqw(0x6b, 0x02);
+		smtc_2Dacceleration = 0;
+		break;
+	default:
+		printk(KERN_INFO
+		"No valid Silicon Motion display chip was detected!\n");
+
+		smtc_free_fb_info(sfb);
+		return err;
+	}
+
+	/* can support 32 bpp */
+	if (15 == sfb->fb.var.bits_per_pixel)

drivers/video/smi/smtcfb.c line 1024

Quoted 10 lines
drivers/video/smi/smtcfb.c new file +10 -0
+		sfb->fb.var.bits_per_pixel = 16;
+
+	sfb->fb.var.xres_virtual = sfb->fb.var.xres;
+
+	sfb->fb.var.yres_virtual = sfb->fb.var.yres;
+	err = smtc_map_smem(sfb, pdev, smem_size);
+	if (err)
+		goto failed;
+
+	smtcfb_setmode(sfb);

Mode setting happens here as I understand it

Quoted 31 lines
drivers/video/smi/smtcfb.c new file +31 -0
+	/* Primary display starting from 0 postion */
+	hw.BaseAddressInVRAM = 0;
+	sfb->fb.par = &hw;
+
+	err = register_framebuffer(&sfb->fb);
+	if (err < 0)
+		goto failed;
+
+	printk(KERN_INFO "Silicon Motion SM%X Rev%X primary display mode"
+			"%dx%d-%d Init Complete.\n", hw.chipID, hw.chipRevID,
+			sfb->fb.var.xres, sfb->fb.var.yres,
+			sfb->fb.var.bits_per_pixel);
+
+#if defined(CONFIG_FB_SM7XX_DUALHEAD)
+	smtc_head2_init(sfb);
+	err = register_framebuffer(&smtcfb_info2.fb);
+
+	/* if second head display fails, also fails the primary display */
+	if (err < 0) {
+		printk(KERN_INFO
+			"Silicon Motion, Inc.  second head init fail\n");
+		goto failed;
+	}
+
+	printk(KERN_INFO "Silicon Motion SM%X Rev%X secondary display mode"
+			"%dx%d-%d Init Complete.\n", hw.chipID, hw.chipRevID,
+			hw2.width, hw2.height,
+			smtcfb_info2.fb.var.bits_per_pixel);
+#endif
+
+	return 0;

drivers/video/smi/smtcfb.c line 1065

Quoted 10 lines
drivers/video/smi/smtcfb.c new file +10 -0
+
+ failed:
+	printk(KERN_INFO "Silicon Motion, Inc.  primary display init fail\n");
+
+	smtc_unmap_smem(sfb);
+	smtc_unmap_mmio(sfb);
+	smtc_free_fb_info(sfb);
+
+	return err;
+}

mode setting table

Quoted 679 lines
drivers/video/smi/smtcfb.h new file +679 -0
+struct ModeInit {
+	int mmSizeX;
+	int mmSizeY;
+	int bpp;
+	int hz;
+	unsigned char Init_MISC;
+	unsigned char Init_SR00_SR04[SIZE_SR00_SR04];
+	unsigned char Init_SR10_SR24[SIZE_SR10_SR24];
+	unsigned char Init_SR30_SR75[SIZE_SR30_SR75];
+	unsigned char Init_SR80_SR93[SIZE_SR80_SR93];
+	unsigned char Init_SRA0_SRAF[SIZE_SRA0_SRAF];
+	unsigned char Init_GR00_GR08[SIZE_GR00_GR08];
+	unsigned char Init_AR00_AR14[SIZE_AR00_AR14];
+	unsigned char Init_CR00_CR18[SIZE_CR00_CR18];
+	unsigned char Init_CR30_CR4D[SIZE_CR30_CR4D];
+	unsigned char Init_CR90_CRA7[SIZE_CR90_CRA7];
+};
+
+/**********************************************************************
+			 SM712 Mode table.
+ **********************************************************************/
+struct ModeInit VGAMode[] = {
+	{
+	 /*  mode#0: 640 x 480  16Bpp  60Hz */
+	 640, 480, 16, 60,
+	 /*  Init_MISC */
+	 0xE3,
+	 {			/*  Init_SR0_SR4 */
+	  0x03, 0x01, 0x0F, 0x00, 0x0E,
+	  },
+	 {			/*  Init_SR10_SR24 */
+	  0xFF, 0xBE, 0xEF, 0xFF, 0x00, 0x0E, 0x17, 0x2C,
+	  0x99, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+	  0xC4, 0x30, 0x02, 0x01, 0x01,
+	  },
+	 {			/*  Init_SR30_SR75 */
+	  0x32, 0x03, 0xA0, 0x09, 0xC0, 0x32, 0x32, 0x32,
+	  0x32, 0x32, 0x32, 0x32, 0x00, 0x00, 0x03, 0xFF,
+	  0x00, 0xFC, 0x00, 0x00, 0x20, 0x18, 0x00, 0xFC,
+	  0x20, 0x0C, 0x44, 0x20, 0x00, 0x32, 0x32, 0x32,
+	  0x04, 0x24, 0x63, 0x4F, 0x52, 0x0B, 0xDF, 0xEA,
+	  0x04, 0x50, 0x19, 0x32, 0x32, 0x00, 0x00, 0x32,
+	  0x01, 0x80, 0x7E, 0x1A, 0x1A, 0x00, 0x00, 0x00,
+	  0x50, 0x03, 0x74, 0x14, 0x07, 0x82, 0x07, 0x04,
+	  0x00, 0x45, 0x30, 0x30, 0x40, 0x30,
+	  },
+	 {			/*  Init_SR80_SR93 */
+	  0xFF, 0x07, 0x00, 0x6F, 0x7F, 0x7F, 0xFF, 0x32,
+	  0xF7, 0x00, 0x00, 0x00, 0xEF, 0xFF, 0x32, 0x32,
+	  0x00, 0x00, 0x00, 0x00,
+	  },
+	 {			/*  Init_SRA0_SRAF */
+	  0x00, 0xFF, 0xBF, 0xFF, 0xFF, 0xED, 0xED, 0xED,
+	  0x7B, 0xFF, 0xFF, 0xFF, 0xBF, 0xEF, 0xFF, 0xDF,
+	  },
+	 {			/*  Init_GR00_GR08 */
+	  0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x05, 0x0F,
+	  0xFF,
+	  },
+	 {			/*  Init_AR00_AR14 */
+	  0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
+	  0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F,
+	  0x41, 0x00, 0x0F, 0x00, 0x00,
+	  },
+	 {			/*  Init_CR00_CR18 */
+	  0x5F, 0x4F, 0x4F, 0x00, 0x53, 0x1F, 0x0B, 0x3E,
+	  0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+	  0xEA, 0x0C, 0xDF, 0x50, 0x40, 0xDF, 0x00, 0xE3,
+	  0xFF,
+	  },
+	 {			/*  Init_CR30_CR4D */
+	  0x00, 0x00, 0x00, 0x00, 0x00, 0x55, 0x03, 0x20,
+	  0x00, 0x00, 0x00, 0x40, 0x00, 0xE7, 0xFF, 0xFD,
+	  0x5F, 0x4F, 0x00, 0x54, 0x00, 0x0B, 0xDF, 0x00,
+	  0xEA, 0x0C, 0x2E, 0x00, 0x4F, 0xDF,
+	  },
+	 {			/*  Init_CR90_CRA7 */
+	  0x56, 0xDD, 0x5E, 0xEA, 0x87, 0x44, 0x8F, 0x55,
+	  0x0A, 0x8F, 0x55, 0x0A, 0x00, 0x00, 0x18, 0x00,
+	  0x11, 0x10, 0x0B, 0x0A, 0x0A, 0x0A, 0x0A, 0x00,
+	  },
+	 },
+	{
+	 /*  mode#1: 640 x 480  24Bpp  60Hz */
+	 640, 480, 24, 60,
+	 /*  Init_MISC */
+	 0xE3,
+	 {			/*  Init_SR0_SR4 */
+	  0x03, 0x01, 0x0F, 0x00, 0x0E,
+	  },
+	 {			/*  Init_SR10_SR24 */
+	  0xFF, 0xBE, 0xEF, 0xFF, 0x00, 0x0E, 0x17, 0x2C,
+	  0x99, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+	  0xC4, 0x30, 0x02, 0x01, 0x01,
+	  },
+	 {			/*  Init_SR30_SR75 */
+	  0x32, 0x03, 0xA0, 0x09, 0xC0, 0x32, 0x32, 0x32,
+	  0x32, 0x32, 0x32, 0x32, 0x00, 0x00, 0x03, 0xFF,
+	  0x00, 0xFC, 0x00, 0x00, 0x20, 0x18, 0x00, 0xFC,
+	  0x20, 0x0C, 0x44, 0x20, 0x00, 0x32, 0x32, 0x32,
+	  0x04, 0x24, 0x63, 0x4F, 0x52, 0x0B, 0xDF, 0xEA,
+	  0x04, 0x50, 0x19, 0x32, 0x32, 0x00, 0x00, 0x32,
+	  0x01, 0x80, 0x7E, 0x1A, 0x1A, 0x00, 0x00, 0x00,
+	  0x50, 0x03, 0x74, 0x14, 0x07, 0x82, 0x07, 0x04,
+	  0x00, 0x45, 0x30, 0x30, 0x40, 0x30,
+	  },
+	 {			/*  Init_SR80_SR93 */
+	  0xFF, 0x07, 0x00, 0x6F, 0x7F, 0x7F, 0xFF, 0x32,
+	  0xF7, 0x00, 0x00, 0x00, 0xEF, 0xFF, 0x32, 0x32,
+	  0x00, 0x00, 0x00, 0x00,
+	  },
+	 {			/*  Init_SRA0_SRAF */
+	  0x00, 0xFF, 0xBF, 0xFF, 0xFF, 0xED, 0xED, 0xED,
+	  0x7B, 0xFF, 0xFF, 0xFF, 0xBF, 0xEF, 0xFF, 0xDF,
+	  },
+	 {			/*  Init_GR00_GR08 */
+	  0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x05, 0x0F,
+	  0xFF,
+	  },
+	 {			/*  Init_AR00_AR14 */
+	  0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
+	  0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F,
+	  0x41, 0x00, 0x0F, 0x00, 0x00,
+	  },
+	 {			/*  Init_CR00_CR18 */
+	  0x5F, 0x4F, 0x4F, 0x00, 0x53, 0x1F, 0x0B, 0x3E,
+	  0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+	  0xEA, 0x0C, 0xDF, 0x50, 0x40, 0xDF, 0x00, 0xE3,
+	  0xFF,
+	  },
+	 {			/*  Init_CR30_CR4D */
+	  0x00, 0x00, 0x00, 0x00, 0x00, 0x55, 0x03, 0x20,
+	  0x00, 0x00, 0x00, 0x40, 0x00, 0xE7, 0xFF, 0xFD,
+	  0x5F, 0x4F, 0x00, 0x54, 0x00, 0x0B, 0xDF, 0x00,
+	  0xEA, 0x0C, 0x2E, 0x00, 0x4F, 0xDF,
+	  },
+	 {			/*  Init_CR90_CRA7 */
+	  0x56, 0xDD, 0x5E, 0xEA, 0x87, 0x44, 0x8F, 0x55,
+	  0x0A, 0x8F, 0x55, 0x0A, 0x00, 0x00, 0x18, 0x00,
+	  0x11, 0x10, 0x0B, 0x0A, 0x0A, 0x0A, 0x0A, 0x00,
+	  },
+	 },
+	{
+	 /*  mode#0: 640 x 480  32Bpp  60Hz */
+	 640, 480, 32, 60,
+	 /*  Init_MISC */
+	 0xE3,
+	 {			/*  Init_SR0_SR4 */
+	  0x03, 0x01, 0x0F, 0x00, 0x0E,
+	  },
+	 {			/*  Init_SR10_SR24 */
+	  0xFF, 0xBE, 0xEF, 0xFF, 0x00, 0x0E, 0x17, 0x2C,
+	  0x99, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+	  0xC4, 0x30, 0x02, 0x01, 0x01,
+	  },
+	 {			/*  Init_SR30_SR75 */
+	  0x32, 0x03, 0xA0, 0x09, 0xC0, 0x32, 0x32, 0x32,
+	  0x32, 0x32, 0x32, 0x32, 0x00, 0x00, 0x03, 0xFF,
+	  0x00, 0xFC, 0x00, 0x00, 0x20, 0x18, 0x00, 0xFC,
+	  0x20, 0x0C, 0x44, 0x20, 0x00, 0x32, 0x32, 0x32,
+	  0x04, 0x24, 0x63, 0x4F, 0x52, 0x0B, 0xDF, 0xEA,
+	  0x04, 0x50, 0x19, 0x32, 0x32, 0x00, 0x00, 0x32,
+	  0x01, 0x80, 0x7E, 0x1A, 0x1A, 0x00, 0x00, 0x00,
+	  0x50, 0x03, 0x74, 0x14, 0x07, 0x82, 0x07, 0x04,
+	  0x00, 0x45, 0x30, 0x30, 0x40, 0x30,
+	  },
+	 {			/*  Init_SR80_SR93 */
+	  0xFF, 0x07, 0x00, 0x6F, 0x7F, 0x7F, 0xFF, 0x32,
+	  0xF7, 0x00, 0x00, 0x00, 0xEF, 0xFF, 0x32, 0x32,
+	  0x00, 0x00, 0x00, 0x00,
+	  },
+	 {			/*  Init_SRA0_SRAF */
+	  0x00, 0xFF, 0xBF, 0xFF, 0xFF, 0xED, 0xED, 0xED,
+	  0x7B, 0xFF, 0xFF, 0xFF, 0xBF, 0xEF, 0xFF, 0xDF,
+	  },
+	 {			/*  Init_GR00_GR08 */
+	  0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x05, 0x0F,
+	  0xFF,
+	  },
+	 {			/*  Init_AR00_AR14 */
+	  0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
+	  0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F,
+	  0x41, 0x00, 0x0F, 0x00, 0x00,
+	  },
+	 {			/*  Init_CR00_CR18 */
+	  0x5F, 0x4F, 0x4F, 0x00, 0x53, 0x1F, 0x0B, 0x3E,
+	  0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+	  0xEA, 0x0C, 0xDF, 0x50, 0x40, 0xDF, 0x00, 0xE3,
+	  0xFF,
+	  },
+	 {			/*  Init_CR30_CR4D */
+	  0x00, 0x00, 0x00, 0x00, 0x00, 0x55, 0x03, 0x20,
+	  0x00, 0x00, 0x00, 0x40, 0x00, 0xE7, 0xFF, 0xFD,
+	  0x5F, 0x4F, 0x00, 0x54, 0x00, 0x0B, 0xDF, 0x00,
+	  0xEA, 0x0C, 0x2E, 0x00, 0x4F, 0xDF,
+	  },
+	 {			/*  Init_CR90_CRA7 */
+	  0x56, 0xDD, 0x5E, 0xEA, 0x87, 0x44, 0x8F, 0x55,
+	  0x0A, 0x8F, 0x55, 0x0A, 0x00, 0x00, 0x18, 0x00,
+	  0x11, 0x10, 0x0B, 0x0A, 0x0A, 0x0A, 0x0A, 0x00,
+	  },
+	 },
+
+	{			/*  mode#2: 800 x 600  16Bpp  60Hz */
+	 800, 600, 16, 60,
+	 /*  Init_MISC */
+	 0x2B,
+	 {			/*  Init_SR0_SR4 */
+	  0x03, 0x01, 0x0F, 0x03, 0x0E,
+	  },
+	 {			/*  Init_SR10_SR24 */
+	  0xFF, 0xBE, 0xEE, 0xFF, 0x00, 0x0E, 0x17, 0x2C,
+	  0x99, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00,
+	  0xC4, 0x30, 0x02, 0x01, 0x01,
+	  },
+	 {			/*  Init_SR30_SR75 */
+	  0x34, 0x03, 0x20, 0x09, 0xC0, 0x24, 0x24, 0x24,
+	  0x24, 0x24, 0x24, 0x24, 0x00, 0x00, 0x03, 0xFF,
+	  0x00, 0xFC, 0x00, 0x00, 0x20, 0x38, 0x00, 0xFC,
+	  0x20, 0x0C, 0x44, 0x20, 0x00, 0x24, 0x24, 0x24,
+	  0x04, 0x48, 0x83, 0x63, 0x68, 0x72, 0x57, 0x58,
+	  0x04, 0x55, 0x59, 0x24, 0x24, 0x00, 0x00, 0x24,
+	  0x01, 0x80, 0x7A, 0x1A, 0x1A, 0x00, 0x00, 0x00,
+	  0x50, 0x03, 0x74, 0x14, 0x1C, 0x85, 0x35, 0x13,
+	  0x02, 0x45, 0x30, 0x35, 0x40, 0x20,
+	  },
+	 {			/*  Init_SR80_SR93 */
+	  0x00, 0x00, 0x00, 0x6F, 0x7F, 0x7F, 0xFF, 0x24,
+	  0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x24, 0x24,
+	  0x00, 0x00, 0x00, 0x00,
+	  },
+	 {			/*  Init_SRA0_SRAF */
+	  0x00, 0xFF, 0xBF, 0xFF, 0xFF, 0xED, 0xED, 0xED,
+	  0x7B, 0xFF, 0xFF, 0xFF, 0xBF, 0xEF, 0xBF, 0xDF,
+	  },
+	 {			/*  Init_GR00_GR08 */
+	  0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x05, 0x0F,
+	  0xFF,
+	  },
+	 {			/*  Init_AR00_AR14 */
+	  0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
+	  0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F,
+	  0x41, 0x00, 0x0F, 0x00, 0x00,
+	  },
+	 {			/*  Init_CR00_CR18 */
+	  0x7F, 0x63, 0x63, 0x00, 0x68, 0x18, 0x72, 0xF0,
+	  0x00, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+	  0x58, 0x0C, 0x57, 0x64, 0x40, 0x57, 0x00, 0xE3,
+	  0xFF,
+	  },
+	 {			/*  Init_CR30_CR4D */
+	  0x00, 0x00, 0x00, 0x00, 0x00, 0x33, 0x03, 0x20,
+	  0x00, 0x00, 0x00, 0x40, 0x00, 0xE7, 0xBF, 0xFD,
+	  0x7F, 0x63, 0x00, 0x69, 0x18, 0x72, 0x57, 0x00,
+	  0x58, 0x0C, 0xE0, 0x20, 0x63, 0x57,
+	  },
+	 {			/*  Init_CR90_CRA7 */
+	  0x56, 0x4B, 0x5E, 0x55, 0x86, 0x9D, 0x8E, 0xAA,
+	  0xDB, 0x2A, 0xDF, 0x33, 0x00, 0x00, 0x18, 0x00,
+	  0x20, 0x1F, 0x1A, 0x19, 0x0F, 0x0F, 0x0F, 0x00,
+	  },
+	 },
+	{			/*  mode#3: 800 x 600  24Bpp  60Hz */
+	 800, 600, 24, 60,
+	 0x2B,
+	 {			/*  Init_SR0_SR4 */
+	  0x03, 0x01, 0x0F, 0x03, 0x0E,
+	  },
+	 {			/*  Init_SR10_SR24 */
+	  0xFF, 0xBE, 0xEE, 0xFF, 0x00, 0x0E, 0x17, 0x2C,
+	  0x99, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+	  0xC4, 0x30, 0x02, 0x01, 0x01,
+	  },
+	 {			/*  Init_SR30_SR75 */
+	  0x36, 0x03, 0x20, 0x09, 0xC0, 0x36, 0x36, 0x36,
+	  0x36, 0x36, 0x36, 0x36, 0x00, 0x00, 0x03, 0xFF,
+	  0x00, 0xFC, 0x00, 0x00, 0x20, 0x18, 0x00, 0xFC,
+	  0x20, 0x0C, 0x44, 0x20, 0x00, 0x36, 0x36, 0x36,
+	  0x04, 0x48, 0x83, 0x63, 0x68, 0x72, 0x57, 0x58,
+	  0x04, 0x55, 0x59, 0x36, 0x36, 0x00, 0x00, 0x36,
+	  0x01, 0x80, 0x7E, 0x1A, 0x1A, 0x00, 0x00, 0x00,
+	  0x50, 0x03, 0x74, 0x14, 0x1C, 0x85, 0x35, 0x13,
+	  0x02, 0x45, 0x30, 0x30, 0x40, 0x20,
+	  },
+	 {			/*  Init_SR80_SR93 */
+	  0xFF, 0x07, 0x00, 0x6F, 0x7F, 0x7F, 0xFF, 0x36,
+	  0xF7, 0x00, 0x00, 0x00, 0xEF, 0xFF, 0x36, 0x36,
+	  0x00, 0x00, 0x00, 0x00,
+	  },
+	 {			/*  Init_SRA0_SRAF */
+	  0x00, 0xFF, 0xBF, 0xFF, 0xFF, 0xED, 0xED, 0xED,
+	  0x7B, 0xFF, 0xFF, 0xFF, 0xBF, 0xEF, 0xBF, 0xDF,
+	  },
+	 {			/*  Init_GR00_GR08 */
+	  0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x05, 0x0F,
+	  0xFF,
+	  },
+	 {			/*  Init_AR00_AR14 */
+	  0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
+	  0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F,
+	  0x41, 0x00, 0x0F, 0x00, 0x00,
+	  },
+	 {			/*  Init_CR00_CR18 */
+	  0x7F, 0x63, 0x63, 0x00, 0x68, 0x18, 0x72, 0xF0,
+	  0x00, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+	  0x58, 0x0C, 0x57, 0x64, 0x40, 0x57, 0x00, 0xE3,
+	  0xFF,
+	  },
+	 {			/*  Init_CR30_CR4D */
+	  0x00, 0x00, 0x00, 0x00, 0x00, 0x33, 0x03, 0x20,
+	  0x00, 0x00, 0x00, 0x40, 0x00, 0xE7, 0xBF, 0xFD,
+	  0x7F, 0x63, 0x00, 0x69, 0x18, 0x72, 0x57, 0x00,
+	  0x58, 0x0C, 0xE0, 0x20, 0x63, 0x57,
+	  },
+	 {			/*  Init_CR90_CRA7 */
+	  0x56, 0x4B, 0x5E, 0x55, 0x86, 0x9D, 0x8E, 0xAA,
+	  0xDB, 0x2A, 0xDF, 0x33, 0x00, 0x00, 0x18, 0x00,
+	  0x20, 0x1F, 0x1A, 0x19, 0x0F, 0x0F, 0x0F, 0x00,
+	  },
+	 },
+	{			/*  mode#7: 800 x 600  32Bpp  60Hz */
+	 800, 600, 32, 60,
+	 /*  Init_MISC */
+	 0x2B,
+	 {			/*  Init_SR0_SR4 */
+	  0x03, 0x01, 0x0F, 0x03, 0x0E,
+	  },
+	 {			/*  Init_SR10_SR24 */
+	  0xFF, 0xBE, 0xEE, 0xFF, 0x00, 0x0E, 0x17, 0x2C,
+	  0x99, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00,
+	  0xC4, 0x30, 0x02, 0x01, 0x01,
+	  },
+	 {			/*  Init_SR30_SR75 */
+	  0x34, 0x03, 0x20, 0x09, 0xC0, 0x24, 0x24, 0x24,
+	  0x24, 0x24, 0x24, 0x24, 0x00, 0x00, 0x03, 0xFF,
+	  0x00, 0xFC, 0x00, 0x00, 0x20, 0x38, 0x00, 0xFC,
+	  0x20, 0x0C, 0x44, 0x20, 0x00, 0x24, 0x24, 0x24,
+	  0x04, 0x48, 0x83, 0x63, 0x68, 0x72, 0x57, 0x58,
+	  0x04, 0x55, 0x59, 0x24, 0x24, 0x00, 0x00, 0x24,
+	  0x01, 0x80, 0x7A, 0x1A, 0x1A, 0x00, 0x00, 0x00,
+	  0x50, 0x03, 0x74, 0x14, 0x1C, 0x85, 0x35, 0x13,
+	  0x02, 0x45, 0x30, 0x35, 0x40, 0x20,
+	  },
+	 {			/*  Init_SR80_SR93 */
+	  0x00, 0x00, 0x00, 0x6F, 0x7F, 0x7F, 0xFF, 0x24,
+	  0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x24, 0x24,
+	  0x00, 0x00, 0x00, 0x00,
+	  },
+	 {			/*  Init_SRA0_SRAF */
+	  0x00, 0xFF, 0xBF, 0xFF, 0xFF, 0xED, 0xED, 0xED,
+	  0x7B, 0xFF, 0xFF, 0xFF, 0xBF, 0xEF, 0xBF, 0xDF,
+	  },
+	 {			/*  Init_GR00_GR08 */
+	  0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x05, 0x0F,
+	  0xFF,
+	  },
+	 {			/*  Init_AR00_AR14 */
+	  0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
+	  0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F,
+	  0x41, 0x00, 0x0F, 0x00, 0x00,
+	  },
+	 {			/*  Init_CR00_CR18 */
+	  0x7F, 0x63, 0x63, 0x00, 0x68, 0x18, 0x72, 0xF0,
+	  0x00, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+	  0x58, 0x0C, 0x57, 0x64, 0x40, 0x57, 0x00, 0xE3,
+	  0xFF,
+	  },
+	 {			/*  Init_CR30_CR4D */
+	  0x00, 0x00, 0x00, 0x00, 0x00, 0x33, 0x03, 0x20,
+	  0x00, 0x00, 0x00, 0x40, 0x00, 0xE7, 0xBF, 0xFD,
+	  0x7F, 0x63, 0x00, 0x69, 0x18, 0x72, 0x57, 0x00,
+	  0x58, 0x0C, 0xE0, 0x20, 0x63, 0x57,
+	  },
+	 {			/*  Init_CR90_CRA7 */
+	  0x56, 0x4B, 0x5E, 0x55, 0x86, 0x9D, 0x8E, 0xAA,
+	  0xDB, 0x2A, 0xDF, 0x33, 0x00, 0x00, 0x18, 0x00,
+	  0x20, 0x1F, 0x1A, 0x19, 0x0F, 0x0F, 0x0F, 0x00,
+	  },
+	 },
+	/* We use 1024x768 table to light 1024x600 panel for lemote */
+	{			/*  mode#4: 1024 x 600  16Bpp  60Hz  */
+	 1024, 600, 16, 60,
+	 /*  Init_MISC */
+	 0xEB,
+	 {			/*  Init_SR0_SR4 */
+	  0x03, 0x01, 0x0F, 0x00, 0x0E,
+	  },
+	 {			/*  Init_SR10_SR24 */
+	  0xC8, 0x40, 0x14, 0x60, 0x00, 0x0A, 0x17, 0x20,
+	  0x51, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00,
+	  0xC4, 0x30, 0x02, 0x00, 0x01,
+	  },
+	 {			/*  Init_SR30_SR75 */
+	  0x22, 0x03, 0x24, 0x09, 0xC0, 0x22, 0x22, 0x22,
+	  0x22, 0x22, 0x22, 0x22, 0x00, 0x00, 0x03, 0xFF,
+	  0x00, 0xFC, 0x00, 0x00, 0x20, 0x18, 0x00, 0xFC,
+	  0x20, 0x0C, 0x44, 0x20, 0x00, 0x22, 0x22, 0x22,
+	  0x06, 0x68, 0xA7, 0x7F, 0x83, 0x24, 0xFF, 0x03,
+	  0x00, 0x60, 0x59, 0x22, 0x22, 0x00, 0x00, 0x22,
+	  0x01, 0x80, 0x7A, 0x1A, 0x1A, 0x00, 0x00, 0x00,
+	  0x50, 0x03, 0x16, 0x02, 0x0D, 0x82, 0x09, 0x02,
+	  0x04, 0x45, 0x3F, 0x30, 0x40, 0x20,
+	  },
+	 {			/*  Init_SR80_SR93 */
+	  0xFF, 0x07, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x3A,
+	  0xF7, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x3A, 0x3A,
+	  0x00, 0x00, 0x00, 0x00,
+	  },
+	 {			/*  Init_SRA0_SRAF */
+	  0x00, 0xFB, 0x9F, 0x01, 0x00, 0xED, 0xED, 0xED,
+	  0x7B, 0xFB, 0xFF, 0xFF, 0x97, 0xEF, 0xBF, 0xDF,
+	  },
+	 {			/*  Init_GR00_GR08 */
+	  0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x05, 0x0F,
+	  0xFF,
+	  },
+	 {			/*  Init_AR00_AR14 */
+	  0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
+	  0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F,
+	  0x41, 0x00, 0x0F, 0x00, 0x00,
+	  },
+	 {			/*  Init_CR00_CR18 */
+	  0xA3, 0x7F, 0x7F, 0x00, 0x85, 0x16, 0x24, 0xF5,
+	  0x00, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+	  0x03, 0x09, 0xFF, 0x80, 0x40, 0xFF, 0x00, 0xE3,
+	  0xFF,
+	  },
+	 {			/*  Init_CR30_CR4D */
+	  0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x02, 0x20,
+	  0x00, 0x00, 0x00, 0x40, 0x00, 0xFF, 0xBF, 0xFF,
+	  0xA3, 0x7F, 0x00, 0x82, 0x0b, 0x6f, 0x57, 0x00,
+	  0x5c, 0x0f, 0xE0, 0xe0, 0x7F, 0x57,
+	  },
+	 {			/*  Init_CR90_CRA7 */
+	  0x55, 0xD9, 0x5D, 0xE1, 0x86, 0x1B, 0x8E, 0x26,
+	  0xDA, 0x8D, 0xDE, 0x94, 0x00, 0x00, 0x18, 0x00,
+	  0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x15, 0x03,
+	  },
+	 },
+	{			/*  mode#5: 1024 x 768  24Bpp  60Hz */
+	 1024, 768, 24, 60,
+	 /*  Init_MISC */
+	 0xEB,
+	 {			/*  Init_SR0_SR4 */
+	  0x03, 0x01, 0x0F, 0x03, 0x0E,
+	  },
+	 {			/*  Init_SR10_SR24 */
+	  0xF3, 0xB6, 0xC0, 0xDD, 0x00, 0x0E, 0x17, 0x2C,
+	  0x99, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00,
+	  0xC4, 0x30, 0x02, 0x01, 0x01,
+	  },
+	 {			/*  Init_SR30_SR75 */
+	  0x38, 0x03, 0x20, 0x09, 0xC0, 0x3A, 0x3A, 0x3A,
+	  0x3A, 0x3A, 0x3A, 0x3A, 0x00, 0x00, 0x03, 0xFF,
+	  0x00, 0xFC, 0x00, 0x00, 0x20, 0x18, 0x00, 0xFC,
+	  0x20, 0x0C, 0x44, 0x20, 0x00, 0x00, 0x00, 0x3A,
+	  0x06, 0x68, 0xA7, 0x7F, 0x83, 0x24, 0xFF, 0x03,
+	  0x00, 0x60, 0x59, 0x3A, 0x3A, 0x00, 0x00, 0x3A,
+	  0x01, 0x80, 0x7E, 0x1A, 0x1A, 0x00, 0x00, 0x00,
+	  0x50, 0x03, 0x74, 0x14, 0x3B, 0x0D, 0x09, 0x02,
+	  0x04, 0x45, 0x30, 0x30, 0x40, 0x20,
+	  },
+	 {			/*  Init_SR80_SR93 */
+	  0xFF, 0x07, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x3A,
+	  0xF7, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x3A, 0x3A,
+	  0x00, 0x00, 0x00, 0x00,
+	  },
+	 {			/*  Init_SRA0_SRAF */
+	  0x00, 0xFB, 0x9F, 0x01, 0x00, 0xED, 0xED, 0xED,
+	  0x7B, 0xFB, 0xFF, 0xFF, 0x97, 0xEF, 0xBF, 0xDF,
+	  },
+	 {			/*  Init_GR00_GR08 */
+	  0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x05, 0x0F,
+	  0xFF,
+	  },
+	 {			/*  Init_AR00_AR14 */
+	  0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
+	  0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F,
+	  0x41, 0x00, 0x0F, 0x00, 0x00,
+	  },
+	 {			/*  Init_CR00_CR18 */
+	  0xA3, 0x7F, 0x7F, 0x00, 0x85, 0x16, 0x24, 0xF5,
+	  0x00, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+	  0x03, 0x09, 0xFF, 0x80, 0x40, 0xFF, 0x00, 0xE3,
+	  0xFF,
+	  },
+	 {			/*  Init_CR30_CR4D */
+	  0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x02, 0x20,
+	  0x00, 0x00, 0x00, 0x40, 0x00, 0xFF, 0xBF, 0xFF,
+	  0xA3, 0x7F, 0x00, 0x86, 0x15, 0x24, 0xFF, 0x00,
+	  0x01, 0x07, 0xE5, 0x20, 0x7F, 0xFF,
+	  },
+	 {			/*  Init_CR90_CRA7 */
+	  0x55, 0xD9, 0x5D, 0xE1, 0x86, 0x1B, 0x8E, 0x26,
+	  0xDA, 0x8D, 0xDE, 0x94, 0x00, 0x00, 0x18, 0x00,
+	  0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x15, 0x03,
+	  },
+	 },
+	{			/*  mode#4: 1024 x 768  32Bpp  60Hz */
+	 1024, 768, 32, 60,
+	 /*  Init_MISC */
+	 0xEB,
+	 {			/*  Init_SR0_SR4 */
+	  0x03, 0x01, 0x0F, 0x03, 0x0E,
+	  },
+	 {			/*  Init_SR10_SR24 */
+	  0xF3, 0xB6, 0xC0, 0xDD, 0x00, 0x0E, 0x17, 0x2C,
+	  0x99, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00,
+	  0xC4, 0x32, 0x02, 0x01, 0x01,
+	  },
+	 {			/*  Init_SR30_SR75 */
+	  0x38, 0x03, 0x20, 0x09, 0xC0, 0x3A, 0x3A, 0x3A,
+	  0x3A, 0x3A, 0x3A, 0x3A, 0x00, 0x00, 0x03, 0xFF,
+	  0x00, 0xFC, 0x00, 0x00, 0x20, 0x18, 0x00, 0xFC,
+	  0x20, 0x0C, 0x44, 0x20, 0x00, 0x00, 0x00, 0x3A,
+	  0x06, 0x68, 0xA7, 0x7F, 0x83, 0x24, 0xFF, 0x03,
+	  0x00, 0x60, 0x59, 0x3A, 0x3A, 0x00, 0x00, 0x3A,
+	  0x01, 0x80, 0x7E, 0x1A, 0x1A, 0x00, 0x00, 0x00,
+	  0x50, 0x03, 0x74, 0x14, 0x3B, 0x0D, 0x09, 0x02,
+	  0x04, 0x45, 0x30, 0x30, 0x40, 0x20,
+	  },
+	 {			/*  Init_SR80_SR93 */
+	  0xFF, 0x07, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x3A,
+	  0xF7, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x3A, 0x3A,
+	  0x00, 0x00, 0x00, 0x00,
+	  },
+	 {			/*  Init_SRA0_SRAF */
+	  0x00, 0xFB, 0x9F, 0x01, 0x00, 0xED, 0xED, 0xED,
+	  0x7B, 0xFB, 0xFF, 0xFF, 0x97, 0xEF, 0xBF, 0xDF,
+	  },
+	 {			/*  Init_GR00_GR08 */
+	  0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x05, 0x0F,
+	  0xFF,
+	  },
+	 {			/*  Init_AR00_AR14 */
+	  0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
+	  0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F,
+	  0x41, 0x00, 0x0F, 0x00, 0x00,
+	  },
+	 {			/*  Init_CR00_CR18 */
+	  0xA3, 0x7F, 0x7F, 0x00, 0x85, 0x16, 0x24, 0xF5,
+	  0x00, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+	  0x03, 0x09, 0xFF, 0x80, 0x40, 0xFF, 0x00, 0xE3,
+	  0xFF,
+	  },
+	 {			/*  Init_CR30_CR4D */
+	  0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x02, 0x20,
+	  0x00, 0x00, 0x00, 0x40, 0x00, 0xFF, 0xBF, 0xFF,
+	  0xA3, 0x7F, 0x00, 0x86, 0x15, 0x24, 0xFF, 0x00,
+	  0x01, 0x07, 0xE5, 0x20, 0x7F, 0xFF,
+	  },
+	 {			/*  Init_CR90_CRA7 */
+	  0x55, 0xD9, 0x5D, 0xE1, 0x86, 0x1B, 0x8E, 0x26,
+	  0xDA, 0x8D, 0xDE, 0x94, 0x00, 0x00, 0x18, 0x00,
+	  0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x15, 0x03,
+	  },
+	 },
+	{			/*  mode#6: 320 x 240  16Bpp  60Hz */
+	 320, 240, 16, 60,
+	 /*  Init_MISC */
+	 0xEB,
+	 {			/*  Init_SR0_SR4 */
+	  0x03, 0x01, 0x0F, 0x03, 0x0E,
+	  },
+	 {			/*  Init_SR10_SR24 */
+	  0xF3, 0xB6, 0xC0, 0xDD, 0x00, 0x0E, 0x17, 0x2C,
+	  0x99, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00,
+	  0xC4, 0x32, 0x02, 0x01, 0x01,
+	  },
+	 {			/*  Init_SR30_SR75 */
+	  0x38, 0x03, 0x20, 0x09, 0xC0, 0x3A, 0x3A, 0x3A,
+	  0x3A, 0x3A, 0x3A, 0x3A, 0x00, 0x00, 0x03, 0xFF,
+	  0x00, 0xFC, 0x00, 0x00, 0x20, 0x18, 0x00, 0xFC,
+	  0x20, 0x0C, 0x44, 0x20, 0x00, 0x00, 0x00, 0x3A,
+	  0x06, 0x68, 0xA7, 0x7F, 0x83, 0x24, 0xFF, 0x03,
+	  0x00, 0x60, 0x59, 0x3A, 0x3A, 0x00, 0x00, 0x3A,
+	  0x01, 0x80, 0x7E, 0x1A, 0x1A, 0x00, 0x00, 0x00,
+	  0x50, 0x03, 0x74, 0x14, 0x08, 0x43, 0x08, 0x43,
+	  0x04, 0x45, 0x30, 0x30, 0x40, 0x20,
+	  },
+	 {			/*  Init_SR80_SR93 */
+	  0xFF, 0x07, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x3A,
+	  0xF7, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x3A, 0x3A,
+	  0x00, 0x00, 0x00, 0x00,
+	  },
+	 {			/*  Init_SRA0_SRAF */
+	  0x00, 0xFB, 0x9F, 0x01, 0x00, 0xED, 0xED, 0xED,
+	  0x7B, 0xFB, 0xFF, 0xFF, 0x97, 0xEF, 0xBF, 0xDF,
+	  },
+	 {			/*  Init_GR00_GR08 */
+	  0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x05, 0x0F,
+	  0xFF,
+	  },
+	 {			/*  Init_AR00_AR14 */
+	  0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
+	  0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F,
+	  0x41, 0x00, 0x0F, 0x00, 0x00,
+	  },
+	 {			/*  Init_CR00_CR18 */
+	  0xA3, 0x7F, 0x7F, 0x00, 0x85, 0x16, 0x24, 0xF5,
+	  0x00, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+	  0x03, 0x09, 0xFF, 0x80, 0x40, 0xFF, 0x00, 0xE3,
+	  0xFF,
+	  },
+	 {			/*  Init_CR30_CR4D */
+	  0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x02, 0x20,
+	  0x00, 0x00, 0x30, 0x40, 0x00, 0xFF, 0xBF, 0xFF,
+	  0x2E, 0x27, 0x00, 0x2b, 0x0c, 0x0F, 0xEF, 0x00,
+	  0xFe, 0x0f, 0x01, 0xC0, 0x27, 0xEF,
+	  },
+	 {			/*  Init_CR90_CRA7 */
+	  0x55, 0xD9, 0x5D, 0xE1, 0x86, 0x1B, 0x8E, 0x26,
+	  0xDA, 0x8D, 0xDE, 0x94, 0x00, 0x00, 0x18, 0x00,
+	  0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x15, 0x03,
+	  },
+	 },
+
+	{			/*  mode#8: 320 x 240  32Bpp  60Hz */
+	 320, 240, 32, 60,
+	 /*  Init_MISC */
+	 0xEB,
+	 {			/*  Init_SR0_SR4 */
+	  0x03, 0x01, 0x0F, 0x03, 0x0E,
+	  },
+	 {			/*  Init_SR10_SR24 */
+	  0xF3, 0xB6, 0xC0, 0xDD, 0x00, 0x0E, 0x17, 0x2C,
+	  0x99, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00,
+	  0xC4, 0x32, 0x02, 0x01, 0x01,
+	  },
+	 {			/*  Init_SR30_SR75 */
+	  0x38, 0x03, 0x20, 0x09, 0xC0, 0x3A, 0x3A, 0x3A,
+	  0x3A, 0x3A, 0x3A, 0x3A, 0x00, 0x00, 0x03, 0xFF,
+	  0x00, 0xFC, 0x00, 0x00, 0x20, 0x18, 0x00, 0xFC,
+	  0x20, 0x0C, 0x44, 0x20, 0x00, 0x00, 0x00, 0x3A,
+	  0x06, 0x68, 0xA7, 0x7F, 0x83, 0x24, 0xFF, 0x03,
+	  0x00, 0x60, 0x59, 0x3A, 0x3A, 0x00, 0x00, 0x3A,
+	  0x01, 0x80, 0x7E, 0x1A, 0x1A, 0x00, 0x00, 0x00,
+	  0x50, 0x03, 0x74, 0x14, 0x08, 0x43, 0x08, 0x43,
+	  0x04, 0x45, 0x30, 0x30, 0x40, 0x20,
+	  },
+	 {			/*  Init_SR80_SR93 */
+	  0xFF, 0x07, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x3A,
+	  0xF7, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x3A, 0x3A,
+	  0x00, 0x00, 0x00, 0x00,
+	  },
+	 {			/*  Init_SRA0_SRAF */
+	  0x00, 0xFB, 0x9F, 0x01, 0x00, 0xED, 0xED, 0xED,
+	  0x7B, 0xFB, 0xFF, 0xFF, 0x97, 0xEF, 0xBF, 0xDF,
+	  },
+	 {			/*  Init_GR00_GR08 */
+	  0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x05, 0x0F,
+	  0xFF,
+	  },
+	 {			/*  Init_AR00_AR14 */
+	  0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
+	  0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F,
+	  0x41, 0x00, 0x0F, 0x00, 0x00,
+	  },
+	 {			/*  Init_CR00_CR18 */
+	  0xA3, 0x7F, 0x7F, 0x00, 0x85, 0x16, 0x24, 0xF5,
+	  0x00, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+	  0x03, 0x09, 0xFF, 0x80, 0x40, 0xFF, 0x00, 0xE3,
+	  0xFF,
+	  },
+	 {			/*  Init_CR30_CR4D */
+	  0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x02, 0x20,
+	  0x00, 0x00, 0x30, 0x40, 0x00, 0xFF, 0xBF, 0xFF,
+	  0x2E, 0x27, 0x00, 0x2b, 0x0c, 0x0F, 0xEF, 0x00,
+	  0xFe, 0x0f, 0x01, 0xC0, 0x27, 0xEF,
+	  },
+	 {			/*  Init_CR90_CRA7 */
+	  0x55, 0xD9, 0x5D, 0xE1, 0x86, 0x1B, 0x8E, 0x26,
+	  0xDA, 0x8D, 0xDE, 0x94, 0x00, 0x00, 0x18, 0x00,
+	  0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x15, 0x03,
+	  },
+	 },
+};
+
+#define numVGAModes		(sizeof(VGAMode) / sizeof(struct ModeInit))
#28 lore raw

PATCH 19/25 define Loongson2F arch specific phys prot access

In reply to a message not in the archive

From: Wu Zhangjin <[email protected]>

The main purpose is to uncache accelerate for video memory access

---
 arch/mips/include/asm/pgtable.h |   13 ++++++++
 arch/mips/loongson/Kconfig      |   12 +++++++
 arch/mips/loongson/common/mem.c |   63 +++++++++++++++++++++++++++++++++++++++
 3 files changed, 88 insertions(+), 0 deletions(-)
arch/mips/include/asm/pgtable.h +13 -0
index 6a0edf7..fdb32a5 100644
@@ -370,6 +370,19 @@ static inline int io_remap_pfn_range(struct vm_area_struct *vma,
 #include <asm-generic/pgtable.h>
 
 /*
+ * uncache accelerate for video memory access
+ */
+#ifdef CONFIG_LOONGSON2F
+#define __HAVE_PHYS_MEM_ACCESS_PROT
+
+struct file;
+pgprot_t phys_mem_access_prot(struct file *file, unsigned long pfn,
+		unsigned long size, pgprot_t vma_prot);
+int phys_mem_access_prot_allowed(struct file *file, unsigned long pfn,
+		unsigned long size, pgprot_t *vma_prot);
+#endif
+
+/*
  * We provide our own get_unmapped area to cope with the virtual aliasing
  * constraints placed on us by the cache architecture.
  */
arch/mips/loongson/Kconfig +12 -0
index 9cc817f..3d582cb 100644
@@ -114,3 +114,15 @@ config CS5536_UDC
 
 config SYS_HAS_MACH_PROM_INIT_CMDLINE
 	bool
+
+config UCA_SIZE
+	hex "Uncache Accelerated Region size"
+	depends on CPU_LOONGSON2F
+	default 0x400000 if LEMOTE_YEELOONG2F
+	default 0x2000000 if LEMOTE_FULOONG2F
+	help
+	  Uncached Acceleration(UCA) can greatly improve video performance.
+	  Normally the Video memory can be accessed in Uncached Accelerated mode,
+	  other peripheral spaces not.
+
+	  Specify a zeroed size to disable this feature.
arch/mips/loongson/common/mem.c +63 -0

66 lines not on this page · raw message

Signature · 1 line
1.6.0.4
#29 lore raw

PATCH 20/25 Loongson2 specific OProfile driver

In reply to a message not in the archive

From: Wu Zhangjin <[email protected]>

this driver is used by the user-space tool:oprofile to profile linux kernel or applications via loongson2 performance counters. you can enable this driver via CONFIG_OPROFILE = y or m.

In loongson2, there are two performance counters, each one can count 16 events respectively. when anyone of the performance counter overflows, an interrupt will generate and goes to the interrupt line:
MIPS_CPU_IRQ_BASE + 6, in fuloong2e, this interrupt line is exclusivly used by perf counter, but in fuloong2f & yeeloong2f, this interrupt line is shared by perf counter and the CPU internal north bridge(bonito64 compatiable).

NOTE: a patch should be sent to oprofile with the loongson-specific support. otherwise, the oprofile tool will not recognize this and complain about "cpu_type 'unset' is not valid". currently, the cpu_type is hard-coded in arch/mips/oprofile/op_model_loongson2.c as 'mips/loongson2'

---
 arch/mips/include/asm/mach-loongson/loongson.h |    2 +
 arch/mips/include/asm/mach-loongson/machine.h  |    1 -
 arch/mips/loongson/common/irq.c                |   25 +++-
 arch/mips/loongson/fuloong-2e/irq.c            |    2 +
 arch/mips/loongson/fuloong-2f/irq.c            |    6 +-
 arch/mips/loongson/yeeloong-2f/irq.c           |    6 +-
 arch/mips/oprofile/Makefile                    |    1 +
 arch/mips/oprofile/common.c                    |    5 +
 arch/mips/oprofile/op_model_loongson2.c        |  186 ++++++++++++++++++++++++
 9 files changed, 226 insertions(+), 8 deletions(-)
 create mode 100644 arch/mips/oprofile/op_model_loongson2.c
arch/mips/include/asm/mach-loongson/loongson.h +2 -0
index ea99209..b458a1e 100644
@@ -53,7 +53,9 @@ extern void mach_prepare_shutdown(void);
 
 #define LOONGSON_REG(x) \
 	(*(u32 *)((char *)CKSEG1ADDR(LOONGSON_REG_BASE) + (x)))
+
 #define LOONGSON_IRQ_BASE	32
+#define LOONGSON_PERFCNT_IRQ	(MIPS_CPU_IRQ_BASE + 6) /* cpu perf counter */
 
 #define LOONGSON_FLASH_BASE	0x1c000000
 #define LOONGSON_FLASH_SIZE	0x02000000	/* 32M */
arch/mips/include/asm/mach-loongson/machine.h +0 -1
index 9f8a607..8109a9e 100644
@@ -51,7 +51,6 @@
 #if defined(CONFIG_LEMOTE_FULOONG2F) || defined(CONFIG_LEMOTE_YEELOONG2F)
 
 #define LOONGSON_TIMER_IRQ	(MIPS_CPU_IRQ_BASE + 7)	/* cpu timer */
-#define LOONGSON_PERFCNT_IRQ	(MIPS_CPU_IRQ_BASE + 6) /* cpu perf counter */
 #define LOONGSON_NORTH_BRIDGE_IRQ	(MIPS_CPU_IRQ_BASE + 6)	/* bonito */
 #define LOONGSON_UART_IRQ	(MIPS_CPU_IRQ_BASE + 3)	/* cpu serial port */
 #define LOONGSON_SOUTH_BRIDGE_IRQ	(MIPS_CPU_IRQ_BASE + 2)	/* i8259 */
arch/mips/loongson/common/irq.c +24 -1
index 5834f35..37bf722 100644
@@ -70,6 +70,29 @@ static struct irqaction cascade_irqaction = {
 	.name = "cascade",
 };
 
+/*
+ * fuloong2f and yeeloong2f share the cpu perf counter interrupt and the north
+ * bridge interrupt in IP6, so, the ip6_irqaction should be sharable.
+ * otherwise, we will can not request the perf counter irq(setup the perf
+ * counter irq handler) in op_model_loongson2.c.
+ */
+
+#if defined(CONFIG_OPROFILE) && \
+	(defined(CONFIG_LEMOTE_FULOONG2F) || defined(CONFIG_LEMOTE_YEELOONG2F))
+irqreturn_t ip6_action(int cpl, void *dev_id)
+{
+	return IRQ_HANDLED;
+}
+
+static struct irqaction ip6_irqaction = {
+	.handler = ip6_action,
+	.name = "cascade",
+	.flags = IRQF_SHARED,
+};
+#else
+#define	ip6_irqaction	cascade_irqaction
+#endif
+
 void __init arch_init_irq(void)
 {
 	/*
@@ -103,7 +126,7 @@ void __init arch_init_irq(void)
 	bonito_irq_init();
 
 	/* setup north bridge irq (bonito) */
-	setup_irq(LOONGSON_NORTH_BRIDGE_IRQ, &cascade_irqaction);
+	setup_irq(LOONGSON_NORTH_BRIDGE_IRQ, &ip6_irqaction);
 	/* setup source bridge irq (i8259) */
 	setup_irq(LOONGSON_SOUTH_BRIDGE_IRQ, &cascade_irqaction);
 }
arch/mips/loongson/fuloong-2e/irq.c +2 -0
index 9057709..e4da30c 100644
@@ -40,6 +40,8 @@ void mach_irq_dispatch(unsigned int pending)
 {
 	if (pending & CAUSEF_IP7)
 		do_IRQ(LOONGSON_TIMER_IRQ);
+	else if (pending & CAUSEF_IP6)	/* perf counter loverflow */
+		do_IRQ(LOONGSON_PERFCNT_IRQ);
 	else if (pending & CAUSEF_IP5)
 		i8259_irqdispatch();
 	else if (pending & CAUSEF_IP2)
arch/mips/loongson/fuloong-2f/irq.c +3 -3
index 4e4112a..d7a60fe 100644
@@ -34,9 +34,9 @@ void mach_irq_dispatch(unsigned int pending)
 {
 	if (pending & CAUSEF_IP7)
 		do_IRQ(LOONGSON_TIMER_IRQ);
-	else if (pending & CAUSEF_IP6) {	/* North Bridge, Perf counter */
-		do_IRQ(LOONGSON_PERFCNT_IRQ);
-		bonito_irqdispatch();
+	else if (pending & CAUSEF_IP6) {
+		do_IRQ(LOONGSON_PERFCNT_IRQ);	/* Perf counter overflow */
+		bonito_irqdispatch();		/* North Bridge */
 	} else if (pending & CAUSEF_IP3)	/* CPU UART */
 		do_IRQ(LOONGSON_UART_IRQ);
 	else if (pending & CAUSEF_IP2)	/* South Bridge */
arch/mips/loongson/yeeloong-2f/irq.c +3 -3
index 4e4112a..d7a60fe 100644
@@ -34,9 +34,9 @@ void mach_irq_dispatch(unsigned int pending)
 {
 	if (pending & CAUSEF_IP7)
 		do_IRQ(LOONGSON_TIMER_IRQ);
-	else if (pending & CAUSEF_IP6) {	/* North Bridge, Perf counter */
-		do_IRQ(LOONGSON_PERFCNT_IRQ);
-		bonito_irqdispatch();
+	else if (pending & CAUSEF_IP6) {
+		do_IRQ(LOONGSON_PERFCNT_IRQ);	/* Perf counter overflow */
+		bonito_irqdispatch();		/* North Bridge */
 	} else if (pending & CAUSEF_IP3)	/* CPU UART */
 		do_IRQ(LOONGSON_UART_IRQ);
 	else if (pending & CAUSEF_IP2)	/* South Bridge */
arch/mips/oprofile/Makefile +1 -0
index bf3be6f..d039d6b 100644
@@ -15,3 +15,4 @@ oprofile-$(CONFIG_CPU_MIPS64)		+= op_model_mipsxx.o
 oprofile-$(CONFIG_CPU_R10000)		+= op_model_mipsxx.o
 oprofile-$(CONFIG_CPU_SB1)		+= op_model_mipsxx.o
 oprofile-$(CONFIG_CPU_RM9000)		+= op_model_rm9000.o
+oprofile-$(CONFIG_CPU_LOONGSON2)  	+= op_model_loongson2.o
arch/mips/oprofile/common.c +5 -0
index 3bf3354..fd52bf6 100644
@@ -16,6 +16,7 @@
 
 extern struct op_mips_model op_model_mipsxx_ops __attribute__((weak));
 extern struct op_mips_model op_model_rm9000_ops __attribute__((weak));
+extern struct op_mips_model op_model_loongson2_ops __attribute__((weak));
 
 static struct op_mips_model *model;
 
@@ -93,6 +94,10 @@ int __init oprofile_arch_init(struct oprofile_operations *ops)
 	case CPU_RM9000:
 		lmodel = &op_model_rm9000_ops;
 		break;
+
+	case CPU_LOONGSON2:
+		lmodel = &op_model_loongson2_ops;
+		break;
 	};
 
 	if (!lmodel)
arch/mips/oprofile/op_model_loongson2.c new file +186 -0

186 lines not on this page · raw message

Signature · 1 line
1.6.0.4
#30 lore raw

PATCH 21/25 flush posted write to irq

In reply to a message not in the archive

From: Wu Zhangjin <[email protected]>

read back to flush the posted write, otherwise, there will be many spurious irqs.

the previous talk: http://www.spinics.net/lists/mips/msg33749.html

---
 arch/mips/kernel/i8259.c               |    2 ++
 arch/mips/loongson/common/bonito-irq.c |    4 ++++
 2 files changed, 6 insertions(+), 0 deletions(-)
arch/mips/kernel/i8259.c +2 -0
index 01c0885..b0254c6 100644
@@ -177,10 +177,12 @@ handle_real_irq:
 		outb(cached_slave_mask, PIC_SLAVE_IMR);
 		outb(0x60+(irq&7), PIC_SLAVE_CMD);/* 'Specific EOI' to slave */
 		outb(0x60+PIC_CASCADE_IR, PIC_MASTER_CMD); /* 'Specific EOI' to master-IRQ2 */
+		inb(PIC_MASTER_CMD);	/* flush posted write */
 	} else {
 		inb(PIC_MASTER_IMR);	/* DUMMY - (do we need this?) */
 		outb(cached_master_mask, PIC_MASTER_IMR);
 		outb(0x60+irq, PIC_MASTER_CMD);	/* 'Specific EOI to master */
+		inb(PIC_MASTER_CMD);	/* flush posted write */
 	}
 	smtc_im_ack_irq(irq);
 	spin_unlock_irqrestore(&i8259A_lock, flags);
arch/mips/loongson/common/bonito-irq.c +4 -0
index 940c1f0..8f5a455 100644
@@ -36,12 +36,16 @@
 static inline void bonito_irq_enable(unsigned int irq)
 {
 	LOONGSON_INTENSET = (1 << (irq - LOONGSON_IRQ_BASE));
+	/* flush posted write */
+	(void)LOONGSON_INTENSET;
 	mmiowb();
 }
 
 static inline void bonito_irq_disable(unsigned int irq)
 {
 	LOONGSON_INTENCLR = (1 << (irq - LOONGSON_IRQ_BASE));
+	/* flush posted write */
+	(void)LOONGSON_INTENCLR;
 	mmiowb();
 }
 
Signature · 1 line
1.6.0.4
#31 lore raw

PATCH 22/25 CS5536 MFGPT as system clock source support

In reply to a message not in the archive

From: Wu Zhangjin <[email protected]>

The cpu count timer should not be used if oprofile and cpufreq are enabled. Instead, the CS5536's mfgpt is a proper timer alternative.

---
 .../asm/mach-loongson/cs5536/cs5536_mfgpt.h        |   26 ++
 arch/mips/loongson/Kconfig                         |   15 +-
 arch/mips/loongson/common/cs5536/Makefile          |    5 +
 arch/mips/loongson/common/cs5536/cs5536_mfgpt.c    |  257 ++++++++++++++++++++
 arch/mips/loongson/common/time.c                   |    7 +
 5 files changed, 306 insertions(+), 4 deletions(-)
 create mode 100644 arch/mips/include/asm/mach-loongson/cs5536/cs5536_mfgpt.h
 create mode 100644 arch/mips/loongson/common/cs5536/cs5536_mfgpt.c
arch/mips/include/asm/mach-loongson/cs5536/cs5536_mfgpt.h new file +26 -0
new file mode 100644
index 0000000..92808ce
@@ -0,0 +1,26 @@
+/*
+ * cs5536 mfgpt header file
+ */
+
+#ifndef _CS5536_MFGPT_H
+#define _CS5536_MFGPT_H
+
+#include <cs5536/cs5536.h>
+
+extern void setup_mfgpt_timer(void);
+
+#if 1
+#define MFGPT_TICK_RATE 14318000
+#else
+#define MFGPT_TICK_RATE (14318180 / 8)
+#endif
+#define COMPARE  ((MFGPT_TICK_RATE + HZ/2) / HZ)
+
+#define	CS5536_MFGPT_INTR	5
+
+#define MFGPT_BASE	mfgpt_base
+#define MFGPT0_CMP2	(MFGPT_BASE + 2)
+#define MFGPT0_CNT	(MFGPT_BASE + 4)
+#define MFGPT0_SETUP	(MFGPT_BASE + 6)
+
+#endif /*!_CS5536_MFGPT_H */
arch/mips/loongson/Kconfig +11 -4
index 3d582cb..c2ff73a 100644
@@ -32,8 +32,8 @@ config LEMOTE_FULOONG2E
 config LEMOTE_FULOONG2F
 	bool "Lemote Fuloong(2f) mini-PC"
 	select ARCH_SPARSEMEM_ENABLE
-	select CEVT_R4K
-	select CSRC_R4K
+	select CEVT_R4K if !CS5536_MFGPT
+	select CSRC_R4K if !CS5536_MFGPT
 	select SYS_HAS_CPU_LOONGSON2F
 	select DMA_NONCOHERENT
 	select BOOT_ELF32
@@ -62,8 +62,8 @@ config LEMOTE_FULOONG2F
 config LEMOTE_YEELOONG2F
 	bool "Lemote Yeeloong(2f) mini Notebook"
 	select ARCH_SPARSEMEM_ENABLE
-	select CEVT_R4K
-	select CSRC_R4K
+	select CEVT_R4K if !CS5536_MFGPT
+	select CSRC_R4K if !CS5536_MFGPT
 	select SYS_HAS_CPU_LOONGSON2F
 	select DMA_NONCOHERENT
 	select BOOT_ELF32
@@ -115,6 +115,13 @@ config CS5536_UDC
 config SYS_HAS_MACH_PROM_INIT_CMDLINE
 	bool
 
+config CS5536_MFGPT
+	bool "Using cs5536's MFGPT as system clock"
+	depends on CS5536
+	help
+	  This is needed if cpufreq and oprofile is enabled in Loongson2(F)
+	  machines
+
 config UCA_SIZE
 	hex "Uncache Accelerated Region size"
 	depends on CPU_LOONGSON2F
arch/mips/loongson/common/cs5536/Makefile +5 -0
index 09bc177..6fd6dd0 100644
@@ -17,4 +17,9 @@ obj-$(CONFIG_CS5536_NOR_FLASH) += cs5536_flash.o
 obj-$(CONFIG_CS5536_OTG) += cs5536_otg.o
 obj-$(CONFIG_CS5536_UDC) += cs5536_udc.o
 
+#
+# Enable cs5536 mfgpt Timer
+#
+obj-$(CONFIG_CS5536_MFGPT) += cs5536_mfgpt.o
+
 EXTRA_CFLAGS += -Werror
arch/mips/loongson/common/cs5536/cs5536_mfgpt.c new file +257 -0

257 lines not on this page · raw message

arch/mips/loongson/common/time.c +7 -0
index 231f0c2..deec242 100644
@@ -14,6 +14,9 @@
 #include <asm/time.h>
 
 #include <loongson.h>
+#ifdef CONFIG_CS5536_MFGPT
+#include <cs5536/cs5536_mfgpt.h>
+#endif
 
 unsigned long read_persistent_clock(void)
 {
@@ -24,4 +27,8 @@ void __init plat_time_init(void)
 {
 	/* setup mips r4k timer */
 	mips_hpt_frequency = cpu_clock_freq / 2;
+
+#ifdef CONFIG_CS5536_MFGPT
+	setup_mfgpt_timer();
+#endif
 }
Signature · 1 line
1.6.0.4
#32 lore raw

PATCH 23/25 Loongson2F cpufreq support

In reply to a message not in the archive

From: Wu Zhangjin <[email protected]>

Loongson2F add a new capability to dynamic scaling cpu frequency. However the cpu count timer depends on cpu frequency. So an alternative clock must be used if this driver is enabled. Besides, the CPU enter wait state when the frequency is setting zero. All these features help power save.

In fuloong(2f) and yeeloong(2f), if you want to use this feature, you should enable the cs5536 mfgpt timer.

---
 arch/mips/Kconfig                              |   17 ++
 arch/mips/include/asm/mach-loongson/clock.h    |   64 +++++++
 arch/mips/include/asm/mach-loongson/loongson.h |    7 +
 arch/mips/kernel/Makefile                      |    1 +
 arch/mips/kernel/loongson2f_freq.c             |  216 ++++++++++++++++++++++++
 arch/mips/loongson/common/Makefile             |    6 +
 arch/mips/loongson/common/clock.c              |  166 ++++++++++++++++++
 7 files changed, 477 insertions(+), 0 deletions(-)
 create mode 100644 arch/mips/include/asm/mach-loongson/clock.h
 create mode 100644 arch/mips/kernel/loongson2f_freq.c
 create mode 100644 arch/mips/loongson/common/clock.c
arch/mips/Kconfig +17 -0
index 74efb43..c7d1d08 100644
@@ -2136,6 +2136,23 @@ source "kernel/power/Kconfig"
 
 endmenu
 
+menu "CPU Frequency scaling"
+
+source "drivers/cpufreq/Kconfig"
+
+config LOONGSON2F_CPU_FREQ
+	bool "Loongson-2F CPU Frequency driver"
+	depends on CPU_LOONGSON2F && CPU_FREQ && (CS5536_MFGPT || I8253)
+	select CPU_FREQ_TABLE
+	help
+	  This adds the cpufreq driver for Loongson-2F.
+
+	  For details, take a look at <file:Documentation/cpu-freq>.
+
+	  If unsure, say N.
+
+endmenu
+
 source "net/Kconfig"
 
 source "drivers/Kconfig"
arch/mips/include/asm/mach-loongson/clock.h new file +64 -0

64 lines not on this page · raw message

arch/mips/include/asm/mach-loongson/loongson.h +7 -0
index b458a1e..4354c29 100644
@@ -51,6 +51,13 @@ extern void mach_prepare_shutdown(void);
 		__asm__ __volatile__(""); \
 })
 
+/* loongson-specific cpu frequency relative stuff */
+#ifdef CONFIG_LOONGSON2F_CPU_FREQ
+#include <linux/cpufreq.h>
+extern void loongson2f_cpu_wait(void);
+extern struct cpufreq_frequency_table loongson2f_clockmod_table[];
+#endif
+
 #define LOONGSON_REG(x) \
 	(*(u32 *)((char *)CKSEG1ADDR(LOONGSON_REG_BASE) + (x)))
 
arch/mips/kernel/Makefile +1 -0
index e961221..78c8002 100644
@@ -73,6 +73,7 @@ obj-$(CONFIG_64BIT)		+= scall64-64.o
 obj-$(CONFIG_MIPS32_COMPAT)	+= linux32.o ptrace32.o signal32.o
 obj-$(CONFIG_MIPS32_N32)	+= binfmt_elfn32.o scall64-n32.o signal_n32.o
 obj-$(CONFIG_MIPS32_O32)	+= binfmt_elfo32.o scall64-o32.o
+obj-$(CONFIG_LOONGSON2F_CPU_FREQ) += loongson2f_freq.o
 
 obj-$(CONFIG_KGDB)		+= kgdb.o
 obj-$(CONFIG_PROC_FS)		+= proc.o
arch/mips/kernel/loongson2f_freq.c new file +216 -0

216 lines not on this page · raw message

arch/mips/loongson/common/Makefile +6 -0
index df782d6..a4d46c3 100644
@@ -24,6 +24,12 @@ obj-$(CONFIG_RTC_DRV_CMOS) += rtc.o
 obj-$(CONFIG_CS5536) += cs5536/
 
 #
+# Enable fuloong(2f) and yeeloong(2f) cpu frequency scaling support
+# This is based on CS5536 mfgpt timer
+#
+obj-$(CONFIG_LOONGSON2F_CPU_FREQ) += clock.o
+
+#
 # Enable serial port
 #
 obj-$(CONFIG_SERIAL_8250) += serial.o
arch/mips/loongson/common/clock.c new file +166 -0

166 lines not on this page · raw message

Signature · 1 line
1.6.0.4
#33 lore raw

PATCH 24/25 add gcc 4.4 support for MIPS and loongson

In reply to a message not in the archive

From: Wu Zhangjin <[email protected]>

the gcc 4.4 support for MIPS mostly refer to this PATCH:
http://www.nabble.com/-PATCH--MIPS:-Handle-removal-of-%27h%27-constraint-in-GCC-4.4-td22192768.html
but have been tuned a little.

because only gcc 4.4 have loongson-specific support, so, we need to choose the suitable -march argument for gcc <= 4.3 and gcc >= 4.4, and we also need to consider use -march=loongson2e and -march=loongson2f for loongson2e and loongson2f respectively. this is handled by adding two new kernel options: CPU_LOONGSON2E and CPU_LOONGSON2F(thanks for the solutin provided by ZhangLe).

I have tested it on FuLoong(2f) in 32bit and 64bit with gcc-4.4 and gcc-4.3. so, basically, it works.

---
 arch/mips/Makefile               |    9 +++++-
 arch/mips/include/asm/compiler.h |   10 ++++++
 arch/mips/include/asm/delay.h    |   58 +++++++++++++++++++++++++------------
 3 files changed, 57 insertions(+), 20 deletions(-)
arch/mips/Makefile +8 -1
index a25c2e5..6d39fdf 100644
@@ -120,7 +120,14 @@ 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
+
+# only gcc >= 4.4 have the loongson-specific support
+cflags-$(CONFIG_CPU_LOONGSON2)	+= -Wa,--trap
+cflags-$(CONFIG_CPU_LOONGSON2E) += \
+	$(call cc-option,-march=loongson2e,$(call cc-option,-march=r4600))
+cflags-$(CONFIG_CPU_LOONGSON2F) += \
+	$(call cc-option,-march=loongson2f,$(call cc-option,-march=r4600))
+
 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) \
arch/mips/include/asm/compiler.h +10 -0
index 71f5c5c..95256a8 100644
@@ -1,5 +1,6 @@
 /*
  * Copyright (C) 2004, 2007  Maciej W. Rozycki
+ * Copyright (C) 2009  Wu Zhangjin, [email protected]
  *
  * 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
@@ -16,4 +17,13 @@
 #define GCC_REG_ACCUM "accum"
 #endif
 
+#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4)
+#define GCC_NO_H_CONSTRAINT
+#ifdef CONFIG_64BIT
+typedef unsigned int uintx_t __attribute__((mode(TI)));
+#else
+typedef u64 uintx_t;
+#endif
+#endif
+
 #endif /* _ASM_COMPILER_H */
arch/mips/include/asm/delay.h +39 -19

82 lines not on this page · raw message

Signature · 1 line
1.6.0.4
#34 lore raw

PATCH 25/25 add default kernel config file for loongson-based machines

In reply to a message not in the archive

From: Wu Zhangjin <[email protected]>

these default kernel config files are stored in arch/mips/configs

    config file                   machine

    fuloong2e_defconfig  -->      fuloong(2e)
    fuloong2f_defconfig  -->      fuloong(2f)
    yeeloong2f_defconfig -->      yeeloong(2f)-8.9inch
	yeeloong2f-7inch_defconfig -->yeeloong(2f)-7inch

by default, RTC, Serial Port, STD, MFGPT Timer(only for -2f), cpufreq(2f) are compilied in.

---
 arch/mips/configs/fulong_defconfig           | 1912 -------------------
 arch/mips/configs/fuloong2e_defconfig        | 1977 +++++++++++++++++++
 arch/mips/configs/fuloong2f_defconfig        | 2630 +++++++++++++++++++++++++
 arch/mips/configs/yeeloong2f-7inch_defconfig | 1720 +++++++++++++++++
 arch/mips/configs/yeeloong2f_defconfig       | 2641 ++++++++++++++++++++++++++
 5 files changed, 8968 insertions(+), 1912 deletions(-)
 delete mode 100644 arch/mips/configs/fulong_defconfig
 create mode 100644 arch/mips/configs/fuloong2e_defconfig
 create mode 100644 arch/mips/configs/fuloong2f_defconfig
 create mode 100644 arch/mips/configs/yeeloong2f-7inch_defconfig
 create mode 100644 arch/mips/configs/yeeloong2f_defconfig
arch/mips/configs/fulong_defconfig deleted +0 -1912
deleted file mode 100644
index 786a9bc..0000000
@@ -1,1912 +0,0 @@
-#
-# Automatically generated make config: don't edit
-# Linux kernel version: 2.6.28-rc6
-# Fri Nov 28 17:53:48 2008
-#
-CONFIG_MIPS=y
-
-#
-# Machine selection
-#
-# CONFIG_MACH_ALCHEMY is not set
-# CONFIG_BASLER_EXCITE is not set
-# CONFIG_BCM47XX is not set
-# CONFIG_MIPS_COBALT is not set
-# CONFIG_MACH_DECSTATION is not set
-# CONFIG_MACH_JAZZ is not set
-# CONFIG_LASAT is not set
-CONFIG_LEMOTE_FULONG=y
-# CONFIG_MIPS_MALTA is not set
-# CONFIG_MIPS_SIM is not set
-# CONFIG_MACH_EMMA is not set
-# CONFIG_MACH_VR41XX is not set
-# CONFIG_NXP_STB220 is not set
-# CONFIG_NXP_STB225 is not set
-# CONFIG_PNX8550_JBS is not set
-# CONFIG_PNX8550_STB810 is not set
-# CONFIG_PMC_MSP is not set
-# CONFIG_PMC_YOSEMITE is not set
-# CONFIG_SGI_IP22 is not set
-# CONFIG_SGI_IP27 is not set
-# CONFIG_SGI_IP28 is not set
-# CONFIG_SGI_IP32 is not set
-# CONFIG_SIBYTE_CRHINE is not set
-# CONFIG_SIBYTE_CARMEL is not set
-# CONFIG_SIBYTE_CRHONE is not set
-# CONFIG_SIBYTE_RHONE is not set
-# CONFIG_SIBYTE_SWARM is not set
-# CONFIG_SIBYTE_LITTLESUR is not set
-# CONFIG_SIBYTE_SENTOSA is not set
-# CONFIG_SIBYTE_BIGSUR is not set
-# CONFIG_SNI_RM is not set
-# CONFIG_MACH_TX39XX is not set
-# CONFIG_MACH_TX49XX is not set
-# CONFIG_MIKROTIK_RB532 is not set
-# CONFIG_WR_PPMC is not set
-CONFIG_RWSEM_GENERIC_SPINLOCK=y
-# CONFIG_ARCH_HAS_ILOG2_U32 is not set
-# CONFIG_ARCH_HAS_ILOG2_U64 is not set
-CONFIG_ARCH_SUPPORTS_OPROFILE=y
-CONFIG_GENERIC_FIND_NEXT_BIT=y
-CONFIG_GENERIC_HWEIGHT=y
-CONFIG_GENERIC_CALIBRATE_DELAY=y
-CONFIG_GENERIC_CLOCKEVENTS=y
-CONFIG_GENERIC_TIME=y
-CONFIG_GENERIC_CMOS_UPDATE=y
-CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
-CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
-CONFIG_CEVT_R4K=y
-CONFIG_CSRC_R4K=y
-CONFIG_DMA_NONCOHERENT=y
-CONFIG_DMA_NEED_PCI_MAP_STATE=y
-CONFIG_EARLY_PRINTK=y
-CONFIG_SYS_HAS_EARLY_PRINTK=y
-# CONFIG_HOTPLUG_CPU is not set
-CONFIG_I8259=y
-# CONFIG_NO_IOPORT is not set
-CONFIG_GENERIC_ISA_DMA=y
-CONFIG_GENERIC_ISA_DMA_SUPPORT_BROKEN=y
-# CONFIG_CPU_BIG_ENDIAN is not set
-CONFIG_CPU_LITTLE_ENDIAN=y
-CONFIG_SYS_SUPPORTS_LITTLE_ENDIAN=y
-CONFIG_IRQ_CPU=y
-CONFIG_BOOT_ELF32=y
-CONFIG_MIPS_L1_CACHE_SHIFT=5
-CONFIG_HAVE_STD_PC_SERIAL_PORT=y
-
-#
-# CPU selection
-#
-CONFIG_CPU_LOONGSON2=y
-# CONFIG_CPU_MIPS32_R1 is not set
-# CONFIG_CPU_MIPS32_R2 is not set
-# CONFIG_CPU_MIPS64_R1 is not set
-# CONFIG_CPU_MIPS64_R2 is not set
-# CONFIG_CPU_R3000 is not set
-# CONFIG_CPU_TX39XX is not set
-# CONFIG_CPU_VR41XX is not set
-# CONFIG_CPU_R4300 is not set
-# CONFIG_CPU_R4X00 is not set
-# CONFIG_CPU_TX49XX is not set
-# CONFIG_CPU_R5000 is not set
-# CONFIG_CPU_R5432 is not set
-# CONFIG_CPU_R5500 is not set
-# CONFIG_CPU_R6000 is not set
-# CONFIG_CPU_NEVADA is not set
-# CONFIG_CPU_R8000 is not set
-# CONFIG_CPU_R10000 is not set
-# CONFIG_CPU_RM7000 is not set
-# CONFIG_CPU_RM9000 is not set
-# CONFIG_CPU_SB1 is not set
-CONFIG_SYS_HAS_CPU_LOONGSON2=y
-CONFIG_SYS_SUPPORTS_32BIT_KERNEL=y
-CONFIG_SYS_SUPPORTS_64BIT_KERNEL=y
-CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y
-CONFIG_CPU_SUPPORTS_64BIT_KERNEL=y
-
-#
-# Kernel type
-#
-# CONFIG_32BIT is not set
-CONFIG_64BIT=y
-# CONFIG_PAGE_SIZE_4KB is not set
-# CONFIG_PAGE_SIZE_8KB is not set
-CONFIG_PAGE_SIZE_16KB=y
-# CONFIG_PAGE_SIZE_64KB is not set
-CONFIG_BOARD_SCACHE=y
-CONFIG_MIPS_MT_DISABLED=y
-# CONFIG_MIPS_MT_SMP is not set
-# CONFIG_MIPS_MT_SMTC is not set
-CONFIG_CPU_HAS_WB=y
-CONFIG_CPU_HAS_SYNC=y
-CONFIG_GENERIC_HARDIRQS=y
-CONFIG_GENERIC_IRQ_PROBE=y
-CONFIG_CPU_SUPPORTS_HIGHMEM=y
-CONFIG_SYS_SUPPORTS_HIGHMEM=y
-CONFIG_ARCH_FLATMEM_ENABLE=y
-CONFIG_ARCH_POPULATES_NODE_MAP=y
-CONFIG_ARCH_SPARSEMEM_ENABLE=y
-CONFIG_SELECT_MEMORY_MODEL=y
-CONFIG_FLATMEM_MANUAL=y
-# CONFIG_DISCONTIGMEM_MANUAL is not set
-# CONFIG_SPARSEMEM_MANUAL is not set
-CONFIG_FLATMEM=y
-CONFIG_FLAT_NODE_MEM_MAP=y
-CONFIG_SPARSEMEM_STATIC=y
-CONFIG_PAGEFLAGS_EXTENDED=y
-CONFIG_SPLIT_PTLOCK_CPUS=4
-CONFIG_RESOURCES_64BIT=y
-CONFIG_PHYS_ADDR_T_64BIT=y
-CONFIG_ZONE_DMA_FLAG=0
-CONFIG_VIRT_TO_BUS=y
-CONFIG_UNEVICTABLE_LRU=y
-CONFIG_TICK_ONESHOT=y
-CONFIG_NO_HZ=y
-CONFIG_HIGH_RES_TIMERS=y
-CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
-# CONFIG_HZ_48 is not set
-# CONFIG_HZ_100 is not set
-# CONFIG_HZ_128 is not set
-CONFIG_HZ_250=y
-# CONFIG_HZ_256 is not set
-# CONFIG_HZ_1000 is not set
-# CONFIG_HZ_1024 is not set
-CONFIG_SYS_SUPPORTS_ARBIT_HZ=y
-CONFIG_HZ=250
-# CONFIG_PREEMPT_NONE is not set
-CONFIG_PREEMPT_VOLUNTARY=y
-# CONFIG_PREEMPT is not set
-# CONFIG_KEXEC is not set
-CONFIG_SECCOMP=y
-CONFIG_LOCKDEP_SUPPORT=y
-CONFIG_STACKTRACE_SUPPORT=y
-CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
-
-#
-# General setup
-#
-CONFIG_EXPERIMENTAL=y
-CONFIG_BROKEN_ON_SMP=y
-CONFIG_INIT_ENV_ARG_LIMIT=32
-CONFIG_LOCALVERSION="lm32"
-# CONFIG_LOCALVERSION_AUTO is not set
-CONFIG_SWAP=y
-CONFIG_SYSVIPC=y
-CONFIG_SYSVIPC_SYSCTL=y
-CONFIG_POSIX_MQUEUE=y
-CONFIG_BSD_PROCESS_ACCT=y
-# CONFIG_BSD_PROCESS_ACCT_V3 is not set
-# CONFIG_TASKSTATS is not set
-# CONFIG_AUDIT is not set
-CONFIG_IKCONFIG=y
-CONFIG_IKCONFIG_PROC=y
-CONFIG_LOG_BUF_SHIFT=14
-# CONFIG_CGROUPS is not set
-# CONFIG_GROUP_SCHED is not set
-CONFIG_SYSFS_DEPRECATED=y
-CONFIG_SYSFS_DEPRECATED_V2=y
-# CONFIG_RELAY is not set
-CONFIG_NAMESPACES=y
-# CONFIG_UTS_NS is not set
-# CONFIG_IPC_NS is not set
-CONFIG_USER_NS=y
-CONFIG_PID_NS=y
-# CONFIG_BLK_DEV_INITRD is not set
-# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
-CONFIG_SYSCTL=y
-CONFIG_EMBEDDED=y
-CONFIG_SYSCTL_SYSCALL=y
-CONFIG_KALLSYMS=y
-# CONFIG_KALLSYMS_EXTRA_PASS is not set
-CONFIG_HOTPLUG=y
-CONFIG_PRINTK=y
-CONFIG_BUG=y
-CONFIG_ELF_CORE=y
-# CONFIG_PCSPKR_PLATFORM is not set
-# CONFIG_COMPAT_BRK is not set
-CONFIG_BASE_FULL=y
-CONFIG_FUTEX=y
-CONFIG_ANON_INODES=y
-CONFIG_EPOLL=y
-CONFIG_SIGNALFD=y
-CONFIG_TIMERFD=y
-CONFIG_EVENTFD=y
-CONFIG_SHMEM=y
-CONFIG_AIO=y
-CONFIG_VM_EVENT_COUNTERS=y
-CONFIG_PCI_QUIRKS=y
-CONFIG_SLAB=y
-# CONFIG_SLUB is not set
-# CONFIG_SLOB is not set
-CONFIG_PROFILING=y
-# CONFIG_MARKERS is not set
-CONFIG_OPROFILE=m
-CONFIG_HAVE_OPROFILE=y
-# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
-CONFIG_SLABINFO=y
-CONFIG_RT_MUTEXES=y
-# CONFIG_TINY_SHMEM is not set
-CONFIG_BASE_SMALL=0
-CONFIG_MODULES=y
-# CONFIG_MODULE_FORCE_LOAD is not set
-CONFIG_MODULE_UNLOAD=y
-CONFIG_MODULE_FORCE_UNLOAD=y
-# CONFIG_MODVERSIONS is not set
-# CONFIG_MODULE_SRCVERSION_ALL is not set
-CONFIG_KMOD=y
-CONFIG_BLOCK=y
-# CONFIG_BLK_DEV_IO_TRACE is not set
-CONFIG_BLK_DEV_BSG=y
-# CONFIG_BLK_DEV_INTEGRITY is not set
-CONFIG_BLOCK_COMPAT=y
-
-#
-# IO Schedulers
-#
-CONFIG_IOSCHED_NOOP=y
-CONFIG_IOSCHED_AS=y
-CONFIG_IOSCHED_DEADLINE=y
-CONFIG_IOSCHED_CFQ=y
-# CONFIG_DEFAULT_AS is not set
-# CONFIG_DEFAULT_DEADLINE is not set
-CONFIG_DEFAULT_CFQ=y
-# CONFIG_DEFAULT_NOOP is not set
-CONFIG_DEFAULT_IOSCHED="cfq"
-CONFIG_CLASSIC_RCU=y
-CONFIG_FREEZER=y
-
-#
-# Bus options (PCI, PCMCIA, EISA, ISA, TC)
-#
-CONFIG_HW_HAS_PCI=y
-CONFIG_PCI=y
-CONFIG_PCI_DOMAINS=y
-# CONFIG_ARCH_SUPPORTS_MSI is not set
-CONFIG_PCI_LEGACY=y
-CONFIG_ISA=y
-CONFIG_MMU=y
-# CONFIG_PCCARD is not set
-# CONFIG_HOTPLUG_PCI is not set
-
-#
-# Executable file formats
-#
-CONFIG_BINFMT_ELF=y
-# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
-# CONFIG_HAVE_AOUT is not set
-CONFIG_BINFMT_MISC=y
-CONFIG_MIPS32_COMPAT=y
-CONFIG_COMPAT=y
-CONFIG_SYSVIPC_COMPAT=y
-CONFIG_MIPS32_O32=y
-CONFIG_MIPS32_N32=y
-CONFIG_BINFMT_ELF32=y
-
-#
-# Power management options
-#
-CONFIG_ARCH_SUSPEND_POSSIBLE=y
-CONFIG_PM=y
-# CONFIG_PM_DEBUG is not set
-CONFIG_PM_SLEEP=y
-CONFIG_SUSPEND=y
-CONFIG_SUSPEND_FREEZER=y
-CONFIG_NET=y
-
-#
-# Networking options
-#
-CONFIG_PACKET=y
-CONFIG_PACKET_MMAP=y
-CONFIG_UNIX=y
-CONFIG_XFRM=y
-# CONFIG_XFRM_USER is not set
-# CONFIG_XFRM_SUB_POLICY is not set
-# CONFIG_XFRM_MIGRATE is not set
-# CONFIG_XFRM_STATISTICS is not set
-# CONFIG_NET_KEY is not set
-CONFIG_INET=y
-CONFIG_IP_MULTICAST=y
-# CONFIG_IP_ADVANCED_ROUTER is not set
-CONFIG_IP_FIB_HASH=y
-CONFIG_IP_PNP=y
-# CONFIG_IP_PNP_DHCP is not set
-CONFIG_IP_PNP_BOOTP=y
-# CONFIG_IP_PNP_RARP is not set
-CONFIG_NET_IPIP=m
-CONFIG_NET_IPGRE=m
-CONFIG_NET_IPGRE_BROADCAST=y
-# CONFIG_IP_MROUTE is not set
-# CONFIG_ARPD is not set
-# CONFIG_SYN_COOKIES is not set
-# CONFIG_INET_AH is not set
-# CONFIG_INET_ESP is not set
-# CONFIG_INET_IPCOMP is not set
-# CONFIG_INET_XFRM_TUNNEL is not set
-CONFIG_INET_TUNNEL=m
-# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
-# CONFIG_INET_XFRM_MODE_TUNNEL is not set
-CONFIG_INET_XFRM_MODE_BEET=y
-# CONFIG_INET_LRO is not set
-# CONFIG_INET_DIAG is not set
-# CONFIG_TCP_CONG_ADVANCED is not set
-CONFIG_TCP_CONG_CUBIC=y
-CONFIG_DEFAULT_TCP_CONG="cubic"
-# CONFIG_TCP_MD5SIG is not set
-# CONFIG_IPV6 is not set
-# CONFIG_NETWORK_SECMARK is not set
-CONFIG_NETFILTER=y
-# CONFIG_NETFILTER_DEBUG is not set
-CONFIG_NETFILTER_ADVANCED=y
-
-#
-# Core Netfilter Configuration
-#
-CONFIG_NETFILTER_NETLINK=m
-CONFIG_NETFILTER_NETLINK_QUEUE=m
-CONFIG_NETFILTER_NETLINK_LOG=m
-# CONFIG_NF_CONNTRACK is not set
-CONFIG_NETFILTER_XTABLES=m
-CONFIG_NETFILTER_XT_TARGET_CLASSIFY=m
-# CONFIG_NETFILTER_XT_TARGET_DSCP is not set
-CONFIG_NETFILTER_XT_TARGET_MARK=m
-# CONFIG_NETFILTER_XT_TARGET_NFLOG is not set
-CONFIG_NETFILTER_XT_TARGET_NFQUEUE=m
-CONFIG_NETFILTER_XT_TARGET_RATEEST=m
-CONFIG_NETFILTER_XT_TARGET_TRACE=m
-# CONFIG_NETFILTER_XT_TARGET_TCPMSS is not set
-CONFIG_NETFILTER_XT_TARGET_TCPOPTSTRIP=m
-CONFIG_NETFILTER_XT_MATCH_COMMENT=m
-CONFIG_NETFILTER_XT_MATCH_DCCP=m
-# CONFIG_NETFILTER_XT_MATCH_DSCP is not set
-CONFIG_NETFILTER_XT_MATCH_ESP=m
-# CONFIG_NETFILTER_XT_MATCH_HASHLIMIT is not set
-CONFIG_NETFILTER_XT_MATCH_IPRANGE=m
-CONFIG_NETFILTER_XT_MATCH_LENGTH=m
-CONFIG_NETFILTER_XT_MATCH_LIMIT=m
-CONFIG_NETFILTER_XT_MATCH_MAC=m
-CONFIG_NETFILTER_XT_MATCH_MARK=m
-CONFIG_NETFILTER_XT_MATCH_MULTIPORT=m
-CONFIG_NETFILTER_XT_MATCH_OWNER=m
-# CONFIG_NETFILTER_XT_MATCH_POLICY is not set
-CONFIG_NETFILTER_XT_MATCH_PKTTYPE=m
-CONFIG_NETFILTER_XT_MATCH_QUOTA=m
-CONFIG_NETFILTER_XT_MATCH_RATEEST=m
-CONFIG_NETFILTER_XT_MATCH_REALM=m
-CONFIG_NETFILTER_XT_MATCH_RECENT=m
-# CONFIG_NETFILTER_XT_MATCH_RECENT_PROC_COMPAT is not set
-CONFIG_NETFILTER_XT_MATCH_SCTP=m
-CONFIG_NETFILTER_XT_MATCH_STATISTIC=m
-CONFIG_NETFILTER_XT_MATCH_STRING=m
-CONFIG_NETFILTER_XT_MATCH_TCPMSS=m
-CONFIG_NETFILTER_XT_MATCH_TIME=m
-CONFIG_NETFILTER_XT_MATCH_U32=m
-# CONFIG_IP_VS is not set
-
-#
-# IP: Netfilter Configuration
-#
-# CONFIG_NF_DEFRAG_IPV4 is not set
-CONFIG_IP_NF_QUEUE=m
-CONFIG_IP_NF_IPTABLES=m
-CONFIG_IP_NF_MATCH_ADDRTYPE=m
-CONFIG_IP_NF_MATCH_AH=m
-CONFIG_IP_NF_MATCH_ECN=m
-CONFIG_IP_NF_MATCH_TTL=m
-CONFIG_IP_NF_FILTER=m
-CONFIG_IP_NF_TARGET_REJECT=m
-CONFIG_IP_NF_TARGET_LOG=m
-CONFIG_IP_NF_TARGET_ULOG=m
-CONFIG_IP_NF_MANGLE=m
-CONFIG_IP_NF_TARGET_ECN=m
-CONFIG_IP_NF_TARGET_TTL=m
-CONFIG_IP_NF_RAW=m
-CONFIG_IP_NF_ARPTABLES=m
-CONFIG_IP_NF_ARPFILTER=m
-CONFIG_IP_NF_ARP_MANGLE=m
-# CONFIG_IP_DCCP is not set
-# CONFIG_IP_SCTP is not set
-# CONFIG_TIPC is not set
-# CONFIG_ATM is not set
-# CONFIG_BRIDGE is not set
-# CONFIG_NET_DSA is not set
-# CONFIG_VLAN_8021Q is not set
-# CONFIG_DECNET is not set
-# CONFIG_LLC2 is not set
-# CONFIG_IPX is not set
-# CONFIG_ATALK is not set
-# CONFIG_X25 is not set
-# CONFIG_LAPB is not set
-# CONFIG_ECONET is not set
-# CONFIG_WAN_ROUTER is not set
-# CONFIG_NET_SCHED is not set
-CONFIG_NET_CLS_ROUTE=y
-
-#
-# Network testing
-#
-# CONFIG_NET_PKTGEN is not set
-# CONFIG_HAMRADIO is not set
-# CONFIG_CAN is not set
-# CONFIG_IRDA is not set
-# CONFIG_BT is not set
-# CONFIG_AF_RXRPC is not set
-CONFIG_PHONET=m
-CONFIG_WIRELESS=y
-# CONFIG_CFG80211 is not set
-CONFIG_WIRELESS_OLD_REGULATORY=y
-CONFIG_WIRELESS_EXT=y
-CONFIG_WIRELESS_EXT_SYSFS=y
-# CONFIG_MAC80211 is not set
-CONFIG_IEEE80211=m
-# CONFIG_IEEE80211_DEBUG is not set
-CONFIG_IEEE80211_CRYPT_WEP=m
-# CONFIG_IEEE80211_CRYPT_CCMP is not set
-# CONFIG_IEEE80211_CRYPT_TKIP is not set
-# CONFIG_RFKILL is not set
-CONFIG_NET_9P=m
-# CONFIG_NET_9P_DEBUG is not set
-
-#
-# Device Drivers
-#
-
-#
-# Generic Driver Options
-#
-CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
-CONFIG_STANDALONE=y
-CONFIG_PREVENT_FIRMWARE_BUILD=y
-CONFIG_FW_LOADER=m
-CONFIG_FIRMWARE_IN_KERNEL=y
-CONFIG_EXTRA_FIRMWARE=""
-# CONFIG_SYS_HYPERVISOR is not set
-# CONFIG_CONNECTOR is not set
-CONFIG_MTD=m
-# CONFIG_MTD_DEBUG is not set
-# CONFIG_MTD_CONCAT is not set
-# CONFIG_MTD_PARTITIONS is not set
-
-#
-# User Modules And Translation Layers
-#
-CONFIG_MTD_CHAR=m
-CONFIG_MTD_BLKDEVS=m
-CONFIG_MTD_BLOCK=m
-# CONFIG_MTD_BLOCK_RO is not set
-# CONFIG_FTL is not set
-# CONFIG_NFTL is not set
-# CONFIG_INFTL is not set
-# CONFIG_RFD_FTL is not set
-# CONFIG_SSFDC is not set
-# CONFIG_MTD_OOPS is not set
-
-#
-# RAM/ROM/Flash chip drivers
-#
-CONFIG_MTD_CFI=m
-CONFIG_MTD_JEDECPROBE=m
-CONFIG_MTD_GEN_PROBE=m
-CONFIG_MTD_CFI_ADV_OPTIONS=y
-CONFIG_MTD_CFI_NOSWAP=y
-# CONFIG_MTD_CFI_BE_BYTE_SWAP is not set
-# CONFIG_MTD_CFI_LE_BYTE_SWAP is not set
-# CONFIG_MTD_CFI_GEOMETRY is not set
-CONFIG_MTD_MAP_BANK_WIDTH_1=y
-CONFIG_MTD_MAP_BANK_WIDTH_2=y
-CONFIG_MTD_MAP_BANK_WIDTH_4=y
-# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
-# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
-# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
-CONFIG_MTD_CFI_I1=y
-CONFIG_MTD_CFI_I2=y
-# CONFIG_MTD_CFI_I4 is not set
-# CONFIG_MTD_CFI_I8 is not set
-# CONFIG_MTD_OTP is not set
-# CONFIG_MTD_CFI_INTELEXT is not set
-CONFIG_MTD_CFI_AMDSTD=m
-CONFIG_MTD_CFI_STAA=m
-CONFIG_MTD_CFI_UTIL=m
-# CONFIG_MTD_RAM is not set
-# CONFIG_MTD_ROM is not set
-# CONFIG_MTD_ABSENT is not set
-
-#
-# Mapping drivers for chip access
-#
-# CONFIG_MTD_COMPLEX_MAPPINGS is not set
-CONFIG_MTD_PHYSMAP=m
-CONFIG_MTD_PHYSMAP_START=0x1fc00000
-CONFIG_MTD_PHYSMAP_LEN=0x80000
-CONFIG_MTD_PHYSMAP_BANKWIDTH=1
-# CONFIG_MTD_INTEL_VR_NOR is not set
-# CONFIG_MTD_PLATRAM is not set
-
-#
-# Self-contained MTD device drivers
-#
-# CONFIG_MTD_PMC551 is not set
-# CONFIG_MTD_SLRAM is not set
-# CONFIG_MTD_PHRAM is not set
-# CONFIG_MTD_MTDRAM is not set
-# CONFIG_MTD_BLOCK2MTD is not set
-
-#
-# Disk-On-Chip Device Drivers
-#
-# CONFIG_MTD_DOC2000 is not set
-# CONFIG_MTD_DOC2001 is not set
-# CONFIG_MTD_DOC2001PLUS is not set
-# CONFIG_MTD_NAND is not set
-# CONFIG_MTD_ONENAND is not set
-
-#
-# UBI - Unsorted block images
-#
-# CONFIG_MTD_UBI is not set
-# CONFIG_PARPORT is not set
-# CONFIG_PNP is not set
-CONFIG_BLK_DEV=y
-# CONFIG_BLK_CPQ_DA is not set
-# CONFIG_BLK_CPQ_CISS_DA is not set
-# CONFIG_BLK_DEV_DAC960 is not set
-# CONFIG_BLK_DEV_UMEM is not set
-# CONFIG_BLK_DEV_COW_COMMON is not set
-CONFIG_BLK_DEV_LOOP=y
-CONFIG_BLK_DEV_CRYPTOLOOP=m
-# CONFIG_BLK_DEV_NBD is not set
-# CONFIG_BLK_DEV_SX8 is not set
-# CONFIG_BLK_DEV_UB is not set
-CONFIG_BLK_DEV_RAM=m
-CONFIG_BLK_DEV_RAM_COUNT=16
-CONFIG_BLK_DEV_RAM_SIZE=4096
-# CONFIG_BLK_DEV_XIP is not set
-CONFIG_CDROM_PKTCDVD=m
-CONFIG_CDROM_PKTCDVD_BUFFERS=8
-# CONFIG_CDROM_PKTCDVD_WCACHE is not set
-CONFIG_ATA_OVER_ETH=m
-# CONFIG_BLK_DEV_HD is not set
-# CONFIG_MISC_DEVICES is not set
-CONFIG_HAVE_IDE=y
-CONFIG_IDE=y
-
-#
-# Please see Documentation/ide/ide.txt for help/info on IDE drives
-#
-CONFIG_IDE_TIMINGS=y
-CONFIG_IDE_ATAPI=y
-# CONFIG_BLK_DEV_IDE_SATA is not set
-CONFIG_IDE_GD=y
-CONFIG_IDE_GD_ATA=y
-# CONFIG_IDE_GD_ATAPI is not set
-CONFIG_BLK_DEV_IDECD=y
-CONFIG_BLK_DEV_IDECD_VERBOSE_ERRORS=y
-# CONFIG_BLK_DEV_IDETAPE is not set
-CONFIG_BLK_DEV_IDESCSI=y
-CONFIG_IDE_TASK_IOCTL=y
-CONFIG_IDE_PROC_FS=y
-
-#
-# IDE chipset support/bugfixes
-#
-CONFIG_IDE_GENERIC=y
-# CONFIG_BLK_DEV_PLATFORM is not set
-CONFIG_BLK_DEV_IDEDMA_SFF=y
-
-#
-# PCI IDE chipsets support
-#
-CONFIG_BLK_DEV_IDEPCI=y
-CONFIG_IDEPCI_PCIBUS_ORDER=y
-# CONFIG_BLK_DEV_OFFBOARD is not set
-CONFIG_BLK_DEV_GENERIC=y
-# CONFIG_BLK_DEV_OPTI621 is not set
-CONFIG_BLK_DEV_IDEDMA_PCI=y
-# CONFIG_BLK_DEV_AEC62XX is not set
-# CONFIG_BLK_DEV_ALI15X3 is not set
-# CONFIG_BLK_DEV_AMD74XX is not set
-# CONFIG_BLK_DEV_CMD64X is not set
-# CONFIG_BLK_DEV_TRIFLEX is not set
-# CONFIG_BLK_DEV_CS5520 is not set
-# CONFIG_BLK_DEV_CS5530 is not set
-# CONFIG_BLK_DEV_HPT366 is not set
-# CONFIG_BLK_DEV_JMICRON is not set
-# CONFIG_BLK_DEV_SC1200 is not set
-# CONFIG_BLK_DEV_PIIX is not set
-# CONFIG_BLK_DEV_IT8213 is not set
-# CONFIG_BLK_DEV_IT821X is not set
-# CONFIG_BLK_DEV_NS87415 is not set
-# CONFIG_BLK_DEV_PDC202XX_OLD is not set
-# CONFIG_BLK_DEV_PDC202XX_NEW is not set
-# CONFIG_BLK_DEV_SVWKS is not set
-# CONFIG_BLK_DEV_SIIMAGE is not set
-# CONFIG_BLK_DEV_SLC90E66 is not set
-# CONFIG_BLK_DEV_TRM290 is not set
-CONFIG_BLK_DEV_VIA82CXXX=y
-# CONFIG_BLK_DEV_TC86C001 is not set
-
-#
-# Other IDE chipsets support
-#
-
-#
-# Note: most of these also require special kernel boot parameters
-#
-# CONFIG_BLK_DEV_4DRIVES is not set
-# CONFIG_BLK_DEV_ALI14XX is not set
-# CONFIG_BLK_DEV_DTC2278 is not set
-# CONFIG_BLK_DEV_HT6560B is not set
-# CONFIG_BLK_DEV_QD65XX is not set
-# CONFIG_BLK_DEV_UMC8672 is not set
-CONFIG_BLK_DEV_IDEDMA=y
-
-#
-# SCSI device support
-#
-# CONFIG_RAID_ATTRS is not set
-CONFIG_SCSI=y
-CONFIG_SCSI_DMA=y
-# CONFIG_SCSI_TGT is not set
-# CONFIG_SCSI_NETLINK is not set
-CONFIG_SCSI_PROC_FS=y
-
-#
-# SCSI support type (disk, tape, CD-ROM)
-#
-CONFIG_BLK_DEV_SD=y
-# CONFIG_CHR_DEV_ST is not set
-# CONFIG_CHR_DEV_OSST is not set
-CONFIG_BLK_DEV_SR=y
-CONFIG_BLK_DEV_SR_VENDOR=y
-CONFIG_CHR_DEV_SG=y
-# CONFIG_CHR_DEV_SCH is not set
-
-#
-# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
-#
-# CONFIG_SCSI_MULTI_LUN is not set
-CONFIG_SCSI_CONSTANTS=y
-# CONFIG_SCSI_LOGGING is not set
-# CONFIG_SCSI_SCAN_ASYNC is not set
-CONFIG_SCSI_WAIT_SCAN=m
-
-#
-# SCSI Transports
-#
-# CONFIG_SCSI_SPI_ATTRS is not set
-# CONFIG_SCSI_FC_ATTRS is not set
-# CONFIG_SCSI_ISCSI_ATTRS is not set
-# CONFIG_SCSI_SAS_ATTRS is not set
-# CONFIG_SCSI_SAS_LIBSAS is not set
-# CONFIG_SCSI_SRP_ATTRS is not set
-# CONFIG_SCSI_LOWLEVEL is not set
-# CONFIG_SCSI_DH is not set
-# CONFIG_ATA is not set
-# CONFIG_MD is not set
-# CONFIG_FUSION is not set
-
-#
-# IEEE 1394 (FireWire) support
-#
-
-#
-# Enable only one of the two stacks, unless you know what you are doing
-#
-# CONFIG_FIREWIRE is not set
-# CONFIG_IEEE1394 is not set
-# CONFIG_I2O is not set
-CONFIG_NETDEVICES=y
-# CONFIG_DUMMY is not set
-# CONFIG_BONDING is not set
-CONFIG_MACVLAN=m
-# CONFIG_EQUALIZER is not set
-# CONFIG_TUN is not set
-CONFIG_VETH=m
-# CONFIG_ARCNET is not set
-CONFIG_PHYLIB=m
-
-#
-# MII PHY device drivers
-#
-CONFIG_MARVELL_PHY=m
-CONFIG_DAVICOM_PHY=m
-CONFIG_QSEMI_PHY=m
-CONFIG_LXT_PHY=m
-CONFIG_CICADA_PHY=m
-# CONFIG_VITESSE_PHY is not set
-# CONFIG_SMSC_PHY is not set
-# CONFIG_BROADCOM_PHY is not set
-# CONFIG_ICPLUS_PHY is not set
-# CONFIG_REALTEK_PHY is not set
-# CONFIG_MDIO_BITBANG is not set
-CONFIG_NET_ETHERNET=y
-CONFIG_MII=y
-# CONFIG_AX88796 is not set
-# CONFIG_HAPPYMEAL is not set
-# CONFIG_SUNGEM is not set
-# CONFIG_CASSINI is not set
-# CONFIG_NET_VENDOR_3COM is not set
-# CONFIG_NET_VENDOR_SMC is not set
-# CONFIG_SMC91X is not set
-# CONFIG_DM9000 is not set
-# CONFIG_NET_VENDOR_RACAL is not set
-# CONFIG_NET_TULIP is not set
-# CONFIG_AT1700 is not set
-# CONFIG_DEPCA is not set
-# CONFIG_HP100 is not set
-# CONFIG_NET_ISA is not set
-# CONFIG_IBM_NEW_EMAC_ZMII is not set
-# CONFIG_IBM_NEW_EMAC_RGMII is not set
-# CONFIG_IBM_NEW_EMAC_TAH is not set
-# CONFIG_IBM_NEW_EMAC_EMAC4 is not set
-# CONFIG_IBM_NEW_EMAC_NO_FLOW_CTRL is not set
-# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set
-# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
-CONFIG_NET_PCI=y
-# CONFIG_PCNET32 is not set
-# CONFIG_AMD8111_ETH is not set
-# CONFIG_ADAPTEC_STARFIRE is not set
-# CONFIG_AC3200 is not set
-# CONFIG_APRICOT is not set
-# CONFIG_B44 is not set
-# CONFIG_FORCEDETH is not set
-# CONFIG_CS89x0 is not set
-# CONFIG_TC35815 is not set
-# CONFIG_EEPRO100 is not set
-# CONFIG_E100 is not set
-# CONFIG_FEALNX is not set
-# CONFIG_NATSEMI is not set
-# CONFIG_NE2K_PCI is not set
-# CONFIG_8139CP is not set
-CONFIG_8139TOO=y
-# CONFIG_8139TOO_PIO is not set
-# CONFIG_8139TOO_TUNE_TWISTER is not set
-# CONFIG_8139TOO_8129 is not set
-# CONFIG_8139_OLD_RX_RESET is not set
-# CONFIG_R6040 is not set
-# CONFIG_SIS900 is not set
-# CONFIG_EPIC100 is not set
-# CONFIG_SUNDANCE is not set
-# CONFIG_TLAN is not set
-# CONFIG_VIA_RHINE is not set
-# CONFIG_SC92031 is not set
-# CONFIG_ATL2 is not set
-CONFIG_NETDEV_1000=y
-# CONFIG_ACENIC is not set
-# CONFIG_DL2K is not set
-# CONFIG_E1000 is not set
-# CONFIG_E1000E is not set
-# CONFIG_IP1000 is not set
-# CONFIG_IGB is not set
-# CONFIG_NS83820 is not set
-# CONFIG_HAMACHI is not set
-# CONFIG_YELLOWFIN is not set
-# CONFIG_R8169 is not set
-# CONFIG_SIS190 is not set
-# CONFIG_SKGE is not set
-# CONFIG_SKY2 is not set
-# CONFIG_VIA_VELOCITY is not set
-# CONFIG_TIGON3 is not set
-# CONFIG_BNX2 is not set
-# CONFIG_QLA3XXX is not set
-# CONFIG_ATL1 is not set
-# CONFIG_ATL1E is not set
-# CONFIG_JME is not set
-CONFIG_NETDEV_10000=y
-# CONFIG_CHELSIO_T1 is not set
-# CONFIG_CHELSIO_T3 is not set
-# CONFIG_ENIC is not set
-# CONFIG_IXGBE is not set
-# CONFIG_IXGB is not set
-# CONFIG_S2IO is not set
-# CONFIG_MYRI10GE is not set
-# CONFIG_NETXEN_NIC is not set
-# CONFIG_NIU is not set
-# CONFIG_MLX4_EN is not set
-# CONFIG_MLX4_CORE is not set
-# CONFIG_TEHUTI is not set
-# CONFIG_BNX2X is not set
-# CONFIG_QLGE is not set
-# CONFIG_SFC is not set
-# CONFIG_TR is not set
-
-#
-# Wireless LAN
-#
-# CONFIG_WLAN_PRE80211 is not set
-# CONFIG_WLAN_80211 is not set
-# CONFIG_IWLWIFI_LEDS is not set
-
-#
-# USB Network Adapters
-#
-# CONFIG_USB_CATC is not set
-# CONFIG_USB_KAWETH is not set
-# CONFIG_USB_PEGASUS is not set
-# CONFIG_USB_RTL8150 is not set
-# CONFIG_USB_USBNET is not set
-# CONFIG_WAN is not set
-# CONFIG_FDDI is not set
-# CONFIG_HIPPI is not set
-CONFIG_PPP=m
-CONFIG_PPP_MULTILINK=y
-CONFIG_PPP_FILTER=y
-CONFIG_PPP_ASYNC=m
-CONFIG_PPP_SYNC_TTY=m
-CONFIG_PPP_DEFLATE=m
-CONFIG_PPP_BSDCOMP=m
-CONFIG_PPP_MPPE=m
-CONFIG_PPPOE=m
-CONFIG_PPPOL2TP=m
-CONFIG_SLIP=m
-CONFIG_SLIP_COMPRESSED=y
-CONFIG_SLHC=m
-CONFIG_SLIP_SMART=y
-CONFIG_SLIP_MODE_SLIP6=y
-CONFIG_NET_FC=y
-# CONFIG_NETCONSOLE is not set
-# CONFIG_NETPOLL is not set
-# CONFIG_NET_POLL_CONTROLLER is not set
-# CONFIG_ISDN is not set
-# CONFIG_PHONE is not set
-
-#
-# Input device support
-#
-CONFIG_INPUT=y
-CONFIG_INPUT_FF_MEMLESS=y
-# CONFIG_INPUT_POLLDEV is not set
-
-#
-# Userland interfaces
-#
-CONFIG_INPUT_MOUSEDEV=y
-CONFIG_INPUT_MOUSEDEV_PSAUX=y
-CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
-CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
-# CONFIG_INPUT_JOYDEV is not set
-# CONFIG_INPUT_EVDEV is not set
-# CONFIG_INPUT_EVBUG is not set
-
-#
-# Input Device Drivers
-#
-CONFIG_INPUT_KEYBOARD=y
-CONFIG_KEYBOARD_ATKBD=m
-# CONFIG_KEYBOARD_SUNKBD is not set
-# CONFIG_KEYBOARD_LKKBD is not set
-# CONFIG_KEYBOARD_XTKBD is not set
-# CONFIG_KEYBOARD_NEWTON is not set
-# CONFIG_KEYBOARD_STOWAWAY is not set
-CONFIG_INPUT_MOUSE=y
-CONFIG_MOUSE_PS2=y
-CONFIG_MOUSE_PS2_ALPS=y
-CONFIG_MOUSE_PS2_LOGIPS2PP=y
-CONFIG_MOUSE_PS2_SYNAPTICS=y
-CONFIG_MOUSE_PS2_LIFEBOOK=y
-CONFIG_MOUSE_PS2_TRACKPOINT=y
-# CONFIG_MOUSE_PS2_ELANTECH is not set
-# CONFIG_MOUSE_PS2_TOUCHKIT is not set
-CONFIG_MOUSE_SERIAL=y
-# CONFIG_MOUSE_APPLETOUCH is not set
-# CONFIG_MOUSE_BCM5974 is not set
-# CONFIG_MOUSE_INPORT is not set
-# CONFIG_MOUSE_LOGIBM is not set
-# CONFIG_MOUSE_PC110PAD is not set
-# CONFIG_MOUSE_VSXXXAA is not set
-# CONFIG_INPUT_JOYSTICK is not set
-# CONFIG_INPUT_TABLET is not set
-# CONFIG_INPUT_TOUCHSCREEN is not set
-# CONFIG_INPUT_MISC is not set
-
-#
-# Hardware I/O ports
-#
-CONFIG_SERIO=y
-CONFIG_SERIO_I8042=y
-CONFIG_SERIO_SERPORT=y
-# CONFIG_SERIO_PCIPS2 is not set
-CONFIG_SERIO_LIBPS2=y
-# CONFIG_SERIO_RAW is not set
-# CONFIG_GAMEPORT is not set
-
-#
-# Character devices
-#
-CONFIG_VT=y
-CONFIG_CONSOLE_TRANSLATIONS=y
-CONFIG_VT_CONSOLE=y
-CONFIG_HW_CONSOLE=y
-# CONFIG_VT_HW_CONSOLE_BINDING is not set
-CONFIG_DEVKMEM=y
-# CONFIG_SERIAL_NONSTANDARD is not set
-# CONFIG_NOZOMI is not set
-
-#
-# Serial drivers
-#
-CONFIG_SERIAL_8250=y
-CONFIG_SERIAL_8250_CONSOLE=y
-CONFIG_SERIAL_8250_PCI=y
-CONFIG_SERIAL_8250_NR_UARTS=2
-CONFIG_SERIAL_8250_RUNTIME_UARTS=2
-# CONFIG_SERIAL_8250_EXTENDED is not set
-
-#
-# Non-8250 serial port support
-#
-CONFIG_SERIAL_CORE=y
-CONFIG_SERIAL_CORE_CONSOLE=y
-# CONFIG_SERIAL_JSM is not set
-CONFIG_UNIX98_PTYS=y
-CONFIG_LEGACY_PTYS=y
-CONFIG_LEGACY_PTY_COUNT=256
-# CONFIG_IPMI_HANDLER is not set
-CONFIG_HW_RANDOM=y
-# CONFIG_DTLK is not set
-# CONFIG_R3964 is not set
-# CONFIG_APPLICOM is not set
-# CONFIG_RAW_DRIVER is not set
-# CONFIG_TCG_TPM is not set
-CONFIG_DEVPORT=y
-CONFIG_I2C=m
-CONFIG_I2C_BOARDINFO=y
-CONFIG_I2C_CHARDEV=m
-CONFIG_I2C_HELPER_AUTO=y
-
-#
-# I2C Hardware Bus support
-#
-
-#
-# PC SMBus host controller drivers
-#
-# CONFIG_I2C_ALI1535 is not set
-# CONFIG_I2C_ALI1563 is not set
-# CONFIG_I2C_ALI15X3 is not set
-# CONFIG_I2C_AMD756 is not set
-# CONFIG_I2C_AMD8111 is not set
-# CONFIG_I2C_I801 is not set
-# CONFIG_I2C_ISCH is not set
-# CONFIG_I2C_PIIX4 is not set
-# CONFIG_I2C_NFORCE2 is not set
-# CONFIG_I2C_SIS5595 is not set
-# CONFIG_I2C_SIS630 is not set
-# CONFIG_I2C_SIS96X is not set
-# CONFIG_I2C_VIA is not set
-CONFIG_I2C_VIAPRO=m
-
-#
-# I2C system bus drivers (mostly embedded / system-on-chip)
-#
-# CONFIG_I2C_OCORES is not set
-# CONFIG_I2C_SIMTEC is not set
-
-#
-# External I2C/SMBus adapter drivers
-#
-# CONFIG_I2C_PARPORT_LIGHT is not set
-# CONFIG_I2C_TAOS_EVM is not set
-# CONFIG_I2C_TINY_USB is not set
-
-#
-# Graphics adapter I2C/DDC channel drivers
-#
-# CONFIG_I2C_VOODOO3 is not set
-
-#
-# Other I2C/SMBus bus drivers
-#
-# CONFIG_I2C_ELEKTOR is not set
-# CONFIG_I2C_PCA_ISA is not set
-# CONFIG_I2C_PCA_PLATFORM is not set
-# CONFIG_I2C_STUB is not set
-
-#
-# Miscellaneous I2C Chip support
-#
-# CONFIG_DS1682 is not set
-# CONFIG_EEPROM_AT24 is not set
-# CONFIG_EEPROM_LEGACY is not set
-# CONFIG_SENSORS_PCF8574 is not set
-# CONFIG_PCF8575 is not set
-# CONFIG_SENSORS_PCA9539 is not set
-# CONFIG_SENSORS_PCF8591 is not set
-# CONFIG_SENSORS_MAX6875 is not set
-# CONFIG_SENSORS_TSL2550 is not set
-# CONFIG_I2C_DEBUG_CORE is not set
-# CONFIG_I2C_DEBUG_ALGO is not set
-# CONFIG_I2C_DEBUG_BUS is not set
-# CONFIG_I2C_DEBUG_CHIP is not set
-# CONFIG_SPI is not set
-# CONFIG_W1 is not set
-# CONFIG_POWER_SUPPLY is not set
-# CONFIG_HWMON is not set
-# CONFIG_THERMAL is not set
-# CONFIG_THERMAL_HWMON is not set
-# CONFIG_WATCHDOG is not set
-CONFIG_SSB_POSSIBLE=y
-
-#
-# Sonics Silicon Backplane
-#
-# CONFIG_SSB is not set
-
-#
-# Multifunction device drivers
-#
-# CONFIG_MFD_CORE is not set
-# CONFIG_MFD_SM501 is not set
-# CONFIG_HTC_PASIC3 is not set
-# CONFIG_MFD_TMIO is not set
-# CONFIG_MFD_WM8400 is not set
-# CONFIG_MFD_WM8350_I2C is not set
-# CONFIG_REGULATOR is not set
-
-#
-# Multimedia devices
-#
-
-#
-# Multimedia core support
-#
-CONFIG_VIDEO_DEV=m
-CONFIG_VIDEO_V4L2_COMMON=m
-CONFIG_VIDEO_ALLOW_V4L1=y
-CONFIG_VIDEO_V4L1_COMPAT=y
-# CONFIG_DVB_CORE is not set
-CONFIG_VIDEO_MEDIA=m
-
-#
-# Multimedia drivers
-#
-CONFIG_MEDIA_ATTACH=y
-CONFIG_MEDIA_TUNER=m
-CONFIG_MEDIA_TUNER_CUSTOMIZE=y
-CONFIG_MEDIA_TUNER_SIMPLE=m
-CONFIG_MEDIA_TUNER_TDA8290=m
-CONFIG_MEDIA_TUNER_TDA827X=m
-CONFIG_MEDIA_TUNER_TDA18271=m
-CONFIG_MEDIA_TUNER_TDA9887=m
-CONFIG_MEDIA_TUNER_TEA5761=m
-CONFIG_MEDIA_TUNER_TEA5767=m
-CONFIG_MEDIA_TUNER_MT20XX=m
-CONFIG_MEDIA_TUNER_MT2060=m
-CONFIG_MEDIA_TUNER_MT2266=m
-CONFIG_MEDIA_TUNER_MT2131=m
-CONFIG_MEDIA_TUNER_QT1010=m
-CONFIG_MEDIA_TUNER_XC2028=m
-CONFIG_MEDIA_TUNER_XC5000=m
-CONFIG_MEDIA_TUNER_MXL5005S=m
-CONFIG_MEDIA_TUNER_MXL5007T=m
-CONFIG_VIDEO_V4L2=m
-CONFIG_VIDEO_V4L1=m
-CONFIG_VIDEOBUF_GEN=m
-CONFIG_VIDEOBUF_VMALLOC=m
-CONFIG_VIDEOBUF_DMA_CONTIG=m
-CONFIG_VIDEO_CAPTURE_DRIVERS=y
-# CONFIG_VIDEO_ADV_DEBUG is not set
-# CONFIG_VIDEO_FIXED_MINOR_RANGES is not set
-CONFIG_VIDEO_HELPER_CHIPS_AUTO=y
-# CONFIG_VIDEO_VIVI is not set
-# CONFIG_VIDEO_BT848 is not set
-# CONFIG_VIDEO_PMS is not set
-# CONFIG_VIDEO_CPIA is not set
-# CONFIG_VIDEO_CPIA2 is not set
-# CONFIG_VIDEO_SAA5246A is not set
-# CONFIG_VIDEO_SAA5249 is not set
-# CONFIG_VIDEO_STRADIS is not set
-# CONFIG_VIDEO_SAA7134 is not set
-# CONFIG_VIDEO_MXB is not set
-# CONFIG_VIDEO_HEXIUM_ORION is not set
-# CONFIG_VIDEO_HEXIUM_GEMINI is not set
-# CONFIG_VIDEO_CX88 is not set
-# CONFIG_VIDEO_IVTV is not set
-# CONFIG_VIDEO_CAFE_CCIC is not set
-CONFIG_SOC_CAMERA=m
-CONFIG_SOC_CAMERA_MT9M001=m
-CONFIG_SOC_CAMERA_MT9M111=m
-CONFIG_SOC_CAMERA_MT9V022=m
-CONFIG_SOC_CAMERA_PLATFORM=m
-CONFIG_VIDEO_SH_MOBILE_CEU=m
-CONFIG_V4L_USB_DRIVERS=y
-CONFIG_USB_VIDEO_CLASS=m
-CONFIG_USB_VIDEO_CLASS_INPUT_EVDEV=y
-CONFIG_USB_GSPCA=m
-CONFIG_USB_M5602=m
-CONFIG_USB_GSPCA_CONEX=m
-CONFIG_USB_GSPCA_ETOMS=m
-CONFIG_USB_GSPCA_FINEPIX=m
-CONFIG_USB_GSPCA_MARS=m
-CONFIG_USB_GSPCA_OV519=m
-CONFIG_USB_GSPCA_PAC207=m
-CONFIG_USB_GSPCA_PAC7311=m
-CONFIG_USB_GSPCA_SONIXB=m
-CONFIG_USB_GSPCA_SONIXJ=m
-CONFIG_USB_GSPCA_SPCA500=m
-CONFIG_USB_GSPCA_SPCA501=m
-CONFIG_USB_GSPCA_SPCA505=m
-CONFIG_USB_GSPCA_SPCA506=m
-CONFIG_USB_GSPCA_SPCA508=m
-CONFIG_USB_GSPCA_SPCA561=m
-CONFIG_USB_GSPCA_STK014=m
-CONFIG_USB_GSPCA_SUNPLUS=m
-CONFIG_USB_GSPCA_T613=m
-CONFIG_USB_GSPCA_TV8532=m
-CONFIG_USB_GSPCA_VC032X=m
-CONFIG_USB_GSPCA_ZC3XX=m
-# CONFIG_VIDEO_PVRUSB2 is not set
-# CONFIG_VIDEO_EM28XX is not set
-# CONFIG_VIDEO_USBVISION is not set
-CONFIG_VIDEO_USBVIDEO=m
-CONFIG_USB_VICAM=m
-CONFIG_USB_IBMCAM=m
-CONFIG_USB_KONICAWC=m
-CONFIG_USB_QUICKCAM_MESSENGER=m
-CONFIG_USB_ET61X251=m
-# CONFIG_VIDEO_OVCAMCHIP is not set
-CONFIG_USB_OV511=m
-CONFIG_USB_SE401=m
-CONFIG_USB_SN9C102=m
-CONFIG_USB_STV680=m
-CONFIG_USB_ZC0301=m
-CONFIG_USB_PWC=m
-# CONFIG_USB_PWC_DEBUG is not set
-# CONFIG_USB_ZR364XX is not set
-CONFIG_USB_STKWEBCAM=m
-CONFIG_USB_S2255=m
-CONFIG_RADIO_ADAPTERS=y
-# CONFIG_RADIO_CADET is not set
-# CONFIG_RADIO_RTRACK is not set
-# CONFIG_RADIO_RTRACK2 is not set
-# CONFIG_RADIO_AZTECH is not set
-# CONFIG_RADIO_GEMTEK is not set
-# CONFIG_RADIO_GEMTEK_PCI is not set
-# CONFIG_RADIO_MAXIRADIO is not set
-# CONFIG_RADIO_MAESTRO is not set
-# CONFIG_RADIO_SF16FMI is not set
-# CONFIG_RADIO_SF16FMR2 is not set
-# CONFIG_RADIO_TERRATEC is not set
-# CONFIG_RADIO_TRUST is not set
-# CONFIG_RADIO_TYPHOON is not set
-# CONFIG_RADIO_ZOLTRIX is not set
-# CONFIG_USB_DSBR is not set
-CONFIG_USB_SI470X=m
-CONFIG_USB_MR800=m
-CONFIG_DAB=y
-# CONFIG_USB_DABUSB is not set
-
-#
-# Graphics support
-#
-# CONFIG_DRM is not set
-# CONFIG_VGASTATE is not set
-CONFIG_VIDEO_OUTPUT_CONTROL=m
-CONFIG_FB=y
-# CONFIG_FIRMWARE_EDID is not set
-# CONFIG_FB_DDC is not set
-# CONFIG_FB_BOOT_VESA_SUPPORT is not set
-CONFIG_FB_CFB_FILLRECT=y
-CONFIG_FB_CFB_COPYAREA=y
-CONFIG_FB_CFB_IMAGEBLIT=y
-# CONFIG_FB_CFB_REV_PIXELS_IN_BYTE is not set
-# CONFIG_FB_SYS_FILLRECT is not set
-# CONFIG_FB_SYS_COPYAREA is not set
-# CONFIG_FB_SYS_IMAGEBLIT is not set
-# CONFIG_FB_FOREIGN_ENDIAN is not set
-# CONFIG_FB_SYS_FOPS is not set
-# CONFIG_FB_SVGALIB is not set
-# CONFIG_FB_MACMODES is not set
-CONFIG_FB_BACKLIGHT=y
-CONFIG_FB_MODE_HELPERS=y
-# CONFIG_FB_TILEBLITTING is not set
-
-#
-# Frame buffer hardware drivers
-#
-# CONFIG_FB_CIRRUS is not set
-# CONFIG_FB_PM2 is not set
-# CONFIG_FB_CYBER2000 is not set
-# CONFIG_FB_ASILIANT is not set
-# CONFIG_FB_IMSTT is not set
-# CONFIG_FB_S1D13XXX is not set
-# CONFIG_FB_NVIDIA is not set
-# CONFIG_FB_RIVA is not set
-# CONFIG_FB_MATROX is not set
-CONFIG_FB_RADEON=y
-# CONFIG_FB_RADEON_I2C is not set
-CONFIG_FB_RADEON_BACKLIGHT=y
-# CONFIG_FB_RADEON_DEBUG is not set
-# CONFIG_FB_ATY128 is not set
-# CONFIG_FB_ATY is not set
-# CONFIG_FB_S3 is not set
-# CONFIG_FB_SAVAGE is not set
-# CONFIG_FB_SIS is not set
-# CONFIG_FB_VIA is not set
-# CONFIG_FB_NEOMAGIC is not set
-# CONFIG_FB_KYRO is not set
-# CONFIG_FB_3DFX is not set
-# CONFIG_FB_VOODOO1 is not set
-# CONFIG_FB_VT8623 is not set
-# CONFIG_FB_TRIDENT is not set
-# CONFIG_FB_ARK is not set
-# CONFIG_FB_PM3 is not set
-# CONFIG_FB_CARMINE is not set
-# CONFIG_FB_VIRTUAL is not set
-# CONFIG_FB_METRONOME is not set
-# CONFIG_FB_MB862XX is not set
-CONFIG_BACKLIGHT_LCD_SUPPORT=y
-CONFIG_LCD_CLASS_DEVICE=m
-# CONFIG_LCD_ILI9320 is not set
-# CONFIG_LCD_PLATFORM is not set
-CONFIG_BACKLIGHT_CLASS_DEVICE=y
-# CONFIG_BACKLIGHT_CORGI is not set
-
-#
-# Display device support
-#
-# CONFIG_DISPLAY_SUPPORT is not set
-
-#
-# Console display driver support
-#
-# CONFIG_VGA_CONSOLE is not set
-# CONFIG_MDA_CONSOLE is not set
-CONFIG_DUMMY_CONSOLE=y
-CONFIG_FRAMEBUFFER_CONSOLE=y
-# CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY is not set
-# CONFIG_FRAMEBUFFER_CONSOLE_ROTATION is not set
-# CONFIG_FONTS is not set
-CONFIG_FONT_8x8=y
-CONFIG_FONT_8x16=y
-# CONFIG_LOGO is not set
-CONFIG_SOUND=y
-CONFIG_SOUND_OSS_CORE=y
-CONFIG_SND=m
-CONFIG_SND_TIMER=m
-CONFIG_SND_PCM=m
-CONFIG_SND_RAWMIDI=m
-CONFIG_SND_SEQUENCER=m
-CONFIG_SND_SEQ_DUMMY=m
-CONFIG_SND_OSSEMUL=y
-CONFIG_SND_MIXER_OSS=m
-CONFIG_SND_PCM_OSS=m
-CONFIG_SND_PCM_OSS_PLUGINS=y
-CONFIG_SND_SEQUENCER_OSS=y
-# CONFIG_SND_DYNAMIC_MINORS is not set
-CONFIG_SND_SUPPORT_OLD_API=y
-CONFIG_SND_VERBOSE_PROCFS=y
-# CONFIG_SND_VERBOSE_PRINTK is not set
-# CONFIG_SND_DEBUG is not set
-CONFIG_SND_VMASTER=y
-CONFIG_SND_MPU401_UART=m
-CONFIG_SND_AC97_CODEC=m
-CONFIG_SND_DRIVERS=y
-# CONFIG_SND_DUMMY is not set
-# CONFIG_SND_VIRMIDI is not set
-# CONFIG_SND_MTPAV is not set
-# CONFIG_SND_SERIAL_U16550 is not set
-# CONFIG_SND_MPU401 is not set
-# CONFIG_SND_AC97_POWER_SAVE is not set
-CONFIG_SND_PCI=y
-# CONFIG_SND_AD1889 is not set
-# CONFIG_SND_ALS300 is not set
-# CONFIG_SND_ALI5451 is not set
-# CONFIG_SND_ATIIXP is not set
-# CONFIG_SND_ATIIXP_MODEM is not set
-# CONFIG_SND_AU8810 is not set
-# CONFIG_SND_AU8820 is not set
-# CONFIG_SND_AU8830 is not set
-# CONFIG_SND_AW2 is not set
-# CONFIG_SND_AZT3328 is not set
-# CONFIG_SND_BT87X is not set
-# CONFIG_SND_CA0106 is not set
-# CONFIG_SND_CMIPCI is not set
-# CONFIG_SND_OXYGEN is not set
-# CONFIG_SND_CS4281 is not set
-# CONFIG_SND_CS46XX is not set
-# CONFIG_SND_DARLA20 is not set
-# CONFIG_SND_GINA20 is not set
-# CONFIG_SND_LAYLA20 is not set
-# CONFIG_SND_DARLA24 is not set
-# CONFIG_SND_GINA24 is not set
-# CONFIG_SND_LAYLA24 is not set
-# CONFIG_SND_MONA is not set
-# CONFIG_SND_MIA is not set
-# CONFIG_SND_ECHO3G is not set
-# CONFIG_SND_INDIGO is not set
-# CONFIG_SND_INDIGOIO is not set
-# CONFIG_SND_INDIGODJ is not set
-# CONFIG_SND_EMU10K1 is not set
-# CONFIG_SND_EMU10K1X is not set
-# CONFIG_SND_ENS1370 is not set
-# CONFIG_SND_ENS1371 is not set
-# CONFIG_SND_ES1938 is not set
-# CONFIG_SND_ES1968 is not set
-# CONFIG_SND_FM801 is not set
-# CONFIG_SND_HDA_INTEL is not set
-# CONFIG_SND_HDSP is not set
-# CONFIG_SND_HDSPM is not set
-# CONFIG_SND_HIFIER is not set
-# CONFIG_SND_ICE1712 is not set
-# CONFIG_SND_ICE1724 is not set
-# CONFIG_SND_INTEL8X0 is not set
-# CONFIG_SND_INTEL8X0M is not set
-# CONFIG_SND_KORG1212 is not set
-# CONFIG_SND_MAESTRO3 is not set
-# CONFIG_SND_MIXART is not set
-# CONFIG_SND_NM256 is not set
-# CONFIG_SND_PCXHR is not set
-# CONFIG_SND_RIPTIDE is not set
-# CONFIG_SND_RME32 is not set
-# CONFIG_SND_RME96 is not set
-# CONFIG_SND_RME9652 is not set
-# CONFIG_SND_SONICVIBES is not set
-# CONFIG_SND_TRIDENT is not set
-CONFIG_SND_VIA82XX=m
-# CONFIG_SND_VIA82XX_MODEM is not set
-# CONFIG_SND_VIRTUOSO is not set
-# CONFIG_SND_VX222 is not set
-# CONFIG_SND_YMFPCI is not set
-CONFIG_SND_MIPS=y
-CONFIG_SND_USB=y
-# CONFIG_SND_USB_AUDIO is not set
-# CONFIG_SND_USB_CAIAQ is not set
-# CONFIG_SND_SOC is not set
-# CONFIG_SOUND_PRIME is not set
-CONFIG_AC97_BUS=m
-CONFIG_HID_SUPPORT=y
-CONFIG_HID=y
-# CONFIG_HID_DEBUG is not set
-CONFIG_HIDRAW=y
-
-#
-# USB Input Devices
-#
-CONFIG_USB_HID=m
-CONFIG_HID_PID=y
-CONFIG_USB_HIDDEV=y
-
-#
-# USB HID Boot Protocol drivers
-#
-# CONFIG_USB_KBD is not set
-# CONFIG_USB_MOUSE is not set
-
-#
-# Special HID drivers
-#
-CONFIG_HID_COMPAT=y
-CONFIG_HID_A4TECH=m
-CONFIG_HID_APPLE=m
-CONFIG_HID_BELKIN=m
-CONFIG_HID_BRIGHT=m
-CONFIG_HID_CHERRY=m
-CONFIG_HID_CHICONY=m
-CONFIG_HID_CYPRESS=m
-CONFIG_HID_DELL=m
-CONFIG_HID_EZKEY=m
-CONFIG_HID_GYRATION=m
-CONFIG_HID_LOGITECH=m
-CONFIG_LOGITECH_FF=y
-CONFIG_LOGIRUMBLEPAD2_FF=y
-CONFIG_HID_MICROSOFT=m
-CONFIG_HID_MONTEREY=m
-CONFIG_HID_PANTHERLORD=m
-# CONFIG_PANTHERLORD_FF is not set
-CONFIG_HID_PETALYNX=m
-CONFIG_HID_SAMSUNG=m
-CONFIG_HID_SONY=m
-CONFIG_HID_SUNPLUS=m
-# CONFIG_THRUSTMASTER_FF is not set
-CONFIG_ZEROPLUS_FF=m
-CONFIG_USB_SUPPORT=y
-CONFIG_USB_ARCH_HAS_HCD=y
-CONFIG_USB_ARCH_HAS_OHCI=y
-CONFIG_USB_ARCH_HAS_EHCI=y
-CONFIG_USB=y
-# CONFIG_USB_DEBUG is not set
-CONFIG_USB_ANNOUNCE_NEW_DEVICES=y
-
-#
-# Miscellaneous USB options
-#
-CONFIG_USB_DEVICEFS=y
-# CONFIG_USB_DEVICE_CLASS is not set
-# CONFIG_USB_DYNAMIC_MINORS is not set
-# CONFIG_USB_SUSPEND is not set
-# CONFIG_USB_OTG is not set
-CONFIG_USB_OTG_WHITELIST=y
-# CONFIG_USB_OTG_BLACKLIST_HUB is not set
-# CONFIG_USB_MON is not set
-# CONFIG_USB_WUSB is not set
-CONFIG_USB_WUSB_CBAF=m
-# CONFIG_USB_WUSB_CBAF_DEBUG is not set
-
-#
-# USB Host Controller Drivers
-#
-CONFIG_USB_C67X00_HCD=m
-CONFIG_USB_EHCI_HCD=y
-CONFIG_USB_EHCI_ROOT_HUB_TT=y
-CONFIG_USB_EHCI_TT_NEWSCHED=y
-# CONFIG_USB_ISP116X_HCD is not set
-CONFIG_USB_ISP1760_HCD=m
-CONFIG_USB_OHCI_HCD=y
-# CONFIG_USB_OHCI_BIG_ENDIAN_DESC is not set
-# CONFIG_USB_OHCI_BIG_ENDIAN_MMIO is not set
-CONFIG_USB_OHCI_LITTLE_ENDIAN=y
-CONFIG_USB_UHCI_HCD=m
-# CONFIG_USB_SL811_HCD is not set
-CONFIG_USB_R8A66597_HCD=m
-# CONFIG_USB_WHCI_HCD is not set
-# CONFIG_USB_HWA_HCD is not set
-
-#
-# USB Device Class drivers
-#
-CONFIG_USB_ACM=y
-CONFIG_USB_PRINTER=y
-CONFIG_USB_WDM=m
-CONFIG_USB_TMC=m
-
-#
-# NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD may also be needed;
-#
-
-#
-# see USB_STORAGE Help for more information
-#
-CONFIG_USB_STORAGE=y
-# CONFIG_USB_STORAGE_DEBUG is not set
-# CONFIG_USB_STORAGE_DATAFAB is not set
-# CONFIG_USB_STORAGE_FREECOM is not set
-# CONFIG_USB_STORAGE_ISD200 is not set
-# CONFIG_USB_STORAGE_DPCM is not set
-# CONFIG_USB_STORAGE_USBAT is not set
-# CONFIG_USB_STORAGE_SDDR09 is not set
-# CONFIG_USB_STORAGE_SDDR55 is not set
-# CONFIG_USB_STORAGE_JUMPSHOT is not set
-# CONFIG_USB_STORAGE_ALAUDA is not set
-CONFIG_USB_STORAGE_ONETOUCH=y
-# CONFIG_USB_STORAGE_KARMA is not set
-CONFIG_USB_STORAGE_CYPRESS_ATACB=y
-CONFIG_USB_LIBUSUAL=y
-
-#
-# USB Imaging devices
-#
-# CONFIG_USB_MDC800 is not set
-# CONFIG_USB_MICROTEK is not set
-
-#
-# USB port drivers
-#
-# CONFIG_USB_SERIAL is not set
-
-#
-# USB Miscellaneous drivers
-#
-# CONFIG_USB_EMI62 is not set
-# CONFIG_USB_EMI26 is not set
-# CONFIG_USB_ADUTUX is not set
-CONFIG_USB_SEVSEG=m
-# CONFIG_USB_RIO500 is not set
-# CONFIG_USB_LEGOTOWER is not set
-# CONFIG_USB_LCD is not set
-# CONFIG_USB_BERRY_CHARGE is not set
-# CONFIG_USB_LED is not set
-# CONFIG_USB_CYPRESS_CY7C63 is not set
-# CONFIG_USB_CYTHERM is not set
-# CONFIG_USB_PHIDGET is not set
-# CONFIG_USB_IDMOUSE is not set
-# CONFIG_USB_FTDI_ELAN is not set
-# CONFIG_USB_APPLEDISPLAY is not set
-# CONFIG_USB_SISUSBVGA is not set
-# CONFIG_USB_LD is not set
-# CONFIG_USB_TRANCEVIBRATOR is not set
-# CONFIG_USB_IOWARRIOR is not set
-# CONFIG_USB_TEST is not set
-CONFIG_USB_ISIGHTFW=m
-CONFIG_USB_VST=m
-# CONFIG_USB_GADGET is not set
-# CONFIG_UWB is not set
-# CONFIG_MMC is not set
-# CONFIG_MEMSTICK is not set
-# CONFIG_NEW_LEDS is not set
-# CONFIG_ACCESSIBILITY is not set
-# CONFIG_INFINIBAND is not set
-CONFIG_RTC_LIB=y
-CONFIG_RTC_CLASS=m
-
-#
-# RTC interfaces
-#
-CONFIG_RTC_INTF_SYSFS=y
-CONFIG_RTC_INTF_PROC=y
-CONFIG_RTC_INTF_DEV=y
-CONFIG_RTC_INTF_DEV_UIE_EMUL=y
-# CONFIG_RTC_DRV_TEST is not set
-
-#
-# I2C RTC drivers
-#
-# CONFIG_RTC_DRV_DS1307 is not set
-# CONFIG_RTC_DRV_DS1374 is not set
-# CONFIG_RTC_DRV_DS1672 is not set
-# CONFIG_RTC_DRV_MAX6900 is not set
-# CONFIG_RTC_DRV_RS5C372 is not set
-# CONFIG_RTC_DRV_ISL1208 is not set
-# CONFIG_RTC_DRV_X1205 is not set
-# CONFIG_RTC_DRV_PCF8563 is not set
-# CONFIG_RTC_DRV_PCF8583 is not set
-# CONFIG_RTC_DRV_M41T80 is not set
-# CONFIG_RTC_DRV_S35390A is not set
-# CONFIG_RTC_DRV_FM3130 is not set
-# CONFIG_RTC_DRV_RX8581 is not set
-
-#
-# SPI RTC drivers
-#
-
-#
-# Platform RTC drivers
-#
-CONFIG_RTC_DRV_CMOS=m
-# CONFIG_RTC_DRV_DS1286 is not set
-# CONFIG_RTC_DRV_DS1511 is not set
-# CONFIG_RTC_DRV_DS1553 is not set
-# CONFIG_RTC_DRV_DS1742 is not set
-# CONFIG_RTC_DRV_STK17TA8 is not set
-# CONFIG_RTC_DRV_M48T86 is not set
-# CONFIG_RTC_DRV_M48T35 is not set
-# CONFIG_RTC_DRV_M48T59 is not set
-# CONFIG_RTC_DRV_BQ4802 is not set
-# CONFIG_RTC_DRV_V3020 is not set
-
-#
-# on-CPU RTC drivers
-#
-# CONFIG_DMADEVICES is not set
-CONFIG_UIO=m
-CONFIG_UIO_CIF=m
-# CONFIG_UIO_PDRV is not set
-# CONFIG_UIO_PDRV_GENIRQ is not set
-# CONFIG_UIO_SMX is not set
-# CONFIG_UIO_SERCOS3 is not set
-# CONFIG_STAGING is not set
-CONFIG_STAGING_EXCLUDE_BUILD=y
-
-#
-# File systems
-#
-CONFIG_EXT2_FS=y
-# CONFIG_EXT2_FS_XATTR is not set
-CONFIG_EXT2_FS_XIP=y
-CONFIG_EXT3_FS=y
-# CONFIG_EXT3_FS_XATTR is not set
-CONFIG_EXT4_FS=m
-CONFIG_EXT4DEV_COMPAT=y
-CONFIG_EXT4_FS_XATTR=y
-CONFIG_EXT4_FS_POSIX_ACL=y
-CONFIG_EXT4_FS_SECURITY=y
-CONFIG_FS_XIP=y
-CONFIG_JBD=y
-CONFIG_JBD2=m
-CONFIG_FS_MBCACHE=m
-CONFIG_REISERFS_FS=m
-# CONFIG_REISERFS_CHECK is not set
-# CONFIG_REISERFS_PROC_INFO is not set
-# CONFIG_REISERFS_FS_XATTR is not set
-# CONFIG_JFS_FS is not set
-CONFIG_FS_POSIX_ACL=y
-CONFIG_FILE_LOCKING=y
-# CONFIG_XFS_FS is not set
-# CONFIG_GFS2_FS is not set
-# CONFIG_OCFS2_FS is not set
-CONFIG_DNOTIFY=y
-CONFIG_INOTIFY=y
-CONFIG_INOTIFY_USER=y
-# CONFIG_QUOTA is not set
-CONFIG_AUTOFS_FS=y
-CONFIG_AUTOFS4_FS=y
-CONFIG_FUSE_FS=y
-
-#
-# CD-ROM/DVD Filesystems
-#
-CONFIG_ISO9660_FS=m
-CONFIG_JOLIET=y
-CONFIG_ZISOFS=y
-CONFIG_UDF_FS=m
-CONFIG_UDF_NLS=y
-
-#
-# DOS/FAT/NT Filesystems
-#
-CONFIG_FAT_FS=m
-CONFIG_MSDOS_FS=m
-CONFIG_VFAT_FS=m
-CONFIG_FAT_DEFAULT_CODEPAGE=936
-CONFIG_FAT_DEFAULT_IOCHARSET="utf8"
-CONFIG_NTFS_FS=m
-# CONFIG_NTFS_DEBUG is not set
-CONFIG_NTFS_RW=y
-
-#
-# Pseudo filesystems
-#
-CONFIG_PROC_FS=y
-CONFIG_PROC_KCORE=y
-CONFIG_PROC_SYSCTL=y
-CONFIG_PROC_PAGE_MONITOR=y
-CONFIG_SYSFS=y
-CONFIG_TMPFS=y
-# CONFIG_TMPFS_POSIX_ACL is not set
-# CONFIG_HUGETLB_PAGE is not set
-# CONFIG_CONFIGFS_FS is not set
-
-#
-# Miscellaneous filesystems
-#
-# CONFIG_ADFS_FS is not set
-# CONFIG_AFFS_FS is not set
-# CONFIG_HFS_FS is not set
-# CONFIG_HFSPLUS_FS is not set
-# CONFIG_BEFS_FS is not set
-# CONFIG_BFS_FS is not set
-# CONFIG_EFS_FS is not set
-# CONFIG_JFFS2_FS is not set
-# CONFIG_CRAMFS is not set
-# CONFIG_VXFS_FS is not set
-# CONFIG_MINIX_FS is not set
-CONFIG_OMFS_FS=m
-# CONFIG_HPFS_FS is not set
-# CONFIG_QNX4FS_FS is not set
-# CONFIG_ROMFS_FS is not set
-# CONFIG_SYSV_FS is not set
-# CONFIG_UFS_FS is not set
-CONFIG_NETWORK_FILESYSTEMS=y
-CONFIG_NFS_FS=m
-CONFIG_NFS_V3=y
-CONFIG_NFS_V3_ACL=y
-CONFIG_NFS_V4=y
-CONFIG_NFSD=m
-CONFIG_NFSD_V2_ACL=y
-CONFIG_NFSD_V3=y
-CONFIG_NFSD_V3_ACL=y
-CONFIG_NFSD_V4=y
-CONFIG_LOCKD=m
-CONFIG_LOCKD_V4=y
-CONFIG_EXPORTFS=m
-CONFIG_NFS_ACL_SUPPORT=m
-CONFIG_NFS_COMMON=y
-CONFIG_SUNRPC=m
-CONFIG_SUNRPC_GSS=m
-# CONFIG_SUNRPC_REGISTER_V4 is not set
-CONFIG_RPCSEC_GSS_KRB5=m
-# CONFIG_RPCSEC_GSS_SPKM3 is not set
-CONFIG_SMB_FS=m
-CONFIG_SMB_NLS_DEFAULT=y
-CONFIG_SMB_NLS_REMOTE="cp936"
-CONFIG_CIFS=m
-CONFIG_CIFS_STATS=y
-CONFIG_CIFS_STATS2=y
-CONFIG_CIFS_WEAK_PW_HASH=y
-CONFIG_CIFS_XATTR=y
-CONFIG_CIFS_POSIX=y
-CONFIG_CIFS_DEBUG2=y
-CONFIG_CIFS_EXPERIMENTAL=y
-# CONFIG_NCP_FS is not set
-# CONFIG_CODA_FS is not set
-# CONFIG_AFS_FS is not set
-# CONFIG_9P_FS is not set
-
-#
-# Partition Types
-#
-CONFIG_PARTITION_ADVANCED=y
-# CONFIG_ACORN_PARTITION is not set
-# CONFIG_OSF_PARTITION is not set
-# CONFIG_AMIGA_PARTITION is not set
-# CONFIG_ATARI_PARTITION is not set
-# CONFIG_MAC_PARTITION is not set
-CONFIG_MSDOS_PARTITION=y
-# CONFIG_BSD_DISKLABEL is not set
-# CONFIG_MINIX_SUBPARTITION is not set
-# CONFIG_SOLARIS_X86_PARTITION is not set
-# CONFIG_UNIXWARE_DISKLABEL is not set
-# CONFIG_LDM_PARTITION is not set
-# CONFIG_SGI_PARTITION is not set
-# CONFIG_ULTRIX_PARTITION is not set
-# CONFIG_SUN_PARTITION is not set
-# CONFIG_KARMA_PARTITION is not set
-# CONFIG_EFI_PARTITION is not set
-# CONFIG_SYSV68_PARTITION is not set
-CONFIG_NLS=y
-CONFIG_NLS_DEFAULT="utf8"
-# CONFIG_NLS_CODEPAGE_437 is not set
-# CONFIG_NLS_CODEPAGE_737 is not set
-# CONFIG_NLS_CODEPAGE_775 is not set
-# CONFIG_NLS_CODEPAGE_850 is not set
-# CONFIG_NLS_CODEPAGE_852 is not set
-# CONFIG_NLS_CODEPAGE_855 is not set
-# CONFIG_NLS_CODEPAGE_857 is not set
-# CONFIG_NLS_CODEPAGE_860 is not set
-# CONFIG_NLS_CODEPAGE_861 is not set
-# CONFIG_NLS_CODEPAGE_862 is not set
-# CONFIG_NLS_CODEPAGE_863 is not set
-# CONFIG_NLS_CODEPAGE_864 is not set
-# CONFIG_NLS_CODEPAGE_865 is not set
-# CONFIG_NLS_CODEPAGE_866 is not set
-# CONFIG_NLS_CODEPAGE_869 is not set
-CONFIG_NLS_CODEPAGE_936=y
-# CONFIG_NLS_CODEPAGE_950 is not set
-# CONFIG_NLS_CODEPAGE_932 is not set
-# CONFIG_NLS_CODEPAGE_949 is not set
-# CONFIG_NLS_CODEPAGE_874 is not set
-# CONFIG_NLS_ISO8859_8 is not set
-# CONFIG_NLS_CODEPAGE_1250 is not set
-# CONFIG_NLS_CODEPAGE_1251 is not set
-# CONFIG_NLS_ASCII is not set
-CONFIG_NLS_ISO8859_1=y
-# CONFIG_NLS_ISO8859_2 is not set
-# CONFIG_NLS_ISO8859_3 is not set
-# CONFIG_NLS_ISO8859_4 is not set
-# CONFIG_NLS_ISO8859_5 is not set
-# CONFIG_NLS_ISO8859_6 is not set
-# CONFIG_NLS_ISO8859_7 is not set
-# CONFIG_NLS_ISO8859_9 is not set
-# CONFIG_NLS_ISO8859_13 is not set
-# CONFIG_NLS_ISO8859_14 is not set
-# CONFIG_NLS_ISO8859_15 is not set
-# CONFIG_NLS_KOI8_R is not set
-# CONFIG_NLS_KOI8_U is not set
-CONFIG_NLS_UTF8=y
-# CONFIG_DLM is not set
-
-#
-# Kernel hacking
-#
-CONFIG_TRACE_IRQFLAGS_SUPPORT=y
-# CONFIG_PRINTK_TIME is not set
-CONFIG_ENABLE_WARN_DEPRECATED=y
-# CONFIG_ENABLE_MUST_CHECK is not set
-CONFIG_FRAME_WARN=2048
-# CONFIG_MAGIC_SYSRQ is not set
-# CONFIG_UNUSED_SYMBOLS is not set
-# CONFIG_DEBUG_FS is not set
-# CONFIG_HEADERS_CHECK is not set
-# CONFIG_DEBUG_KERNEL is not set
-# CONFIG_DEBUG_MEMORY_INIT is not set
-# CONFIG_RCU_CPU_STALL_DETECTOR is not set
-CONFIG_SYSCTL_SYSCALL_CHECK=y
-
-#
-# Tracers
-#
-CONFIG_DYNAMIC_PRINTK_DEBUG=y
-# CONFIG_SAMPLES is not set
-CONFIG_HAVE_ARCH_KGDB=y
-CONFIG_CMDLINE=""
-
-#
-# Security options
-#
-# CONFIG_KEYS is not set
-# CONFIG_SECURITY is not set
-# CONFIG_SECURITYFS is not set
-CONFIG_SECURITY_FILE_CAPABILITIES=y
-CONFIG_CRYPTO=y
-
-#
-# Crypto core or helper
-#
-CONFIG_CRYPTO_FIPS=y
-CONFIG_CRYPTO_ALGAPI=y
-CONFIG_CRYPTO_AEAD=y
-CONFIG_CRYPTO_BLKCIPHER=y
-CONFIG_CRYPTO_HASH=y
-CONFIG_CRYPTO_RNG=y
-CONFIG_CRYPTO_MANAGER=y
-CONFIG_CRYPTO_GF128MUL=m
-# CONFIG_CRYPTO_NULL is not set
-# CONFIG_CRYPTO_CRYPTD is not set
-CONFIG_CRYPTO_AUTHENC=m
-# CONFIG_CRYPTO_TEST is not set
-
-#
-# Authenticated Encryption with Associated Data
-#
-CONFIG_CRYPTO_CCM=m
-CONFIG_CRYPTO_GCM=m
-CONFIG_CRYPTO_SEQIV=m
-
-#
-# Block modes
-#
-CONFIG_CRYPTO_CBC=m
-CONFIG_CRYPTO_CTR=m
-CONFIG_CRYPTO_CTS=m
-CONFIG_CRYPTO_ECB=m
-# CONFIG_CRYPTO_LRW is not set
-CONFIG_CRYPTO_PCBC=m
-CONFIG_CRYPTO_XTS=m
-
-#
-# Hash modes
-#
-CONFIG_CRYPTO_HMAC=y
-# CONFIG_CRYPTO_XCBC is not set
-
-#
-# Digest
-#
-# CONFIG_CRYPTO_CRC32C is not set
-# CONFIG_CRYPTO_MD4 is not set
-CONFIG_CRYPTO_MD5=m
-# CONFIG_CRYPTO_MICHAEL_MIC is not set
-CONFIG_CRYPTO_RMD128=m
-CONFIG_CRYPTO_RMD160=m
-CONFIG_CRYPTO_RMD256=m
-CONFIG_CRYPTO_RMD320=m
-CONFIG_CRYPTO_SHA1=m
-# CONFIG_CRYPTO_SHA256 is not set
-# CONFIG_CRYPTO_SHA512 is not set
-# CONFIG_CRYPTO_TGR192 is not set
-# CONFIG_CRYPTO_WP512 is not set
-
-#
-# Ciphers
-#
-CONFIG_CRYPTO_AES=m
-# CONFIG_CRYPTO_ANUBIS is not set
-CONFIG_CRYPTO_ARC4=m
-# CONFIG_CRYPTO_BLOWFISH is not set
-# CONFIG_CRYPTO_CAMELLIA is not set
-# CONFIG_CRYPTO_CAST5 is not set
-# CONFIG_CRYPTO_CAST6 is not set
-CONFIG_CRYPTO_DES=m
-# CONFIG_CRYPTO_FCRYPT is not set
-# CONFIG_CRYPTO_KHAZAD is not set
-CONFIG_CRYPTO_SALSA20=m
-CONFIG_CRYPTO_SEED=m
-# CONFIG_CRYPTO_SERPENT is not set
-# CONFIG_CRYPTO_TEA is not set
-# CONFIG_CRYPTO_TWOFISH is not set
-
-#
-# Compression
-#
-CONFIG_CRYPTO_DEFLATE=m
-CONFIG_CRYPTO_LZO=m
-
-#
-# Random Number Generation
-#
-CONFIG_CRYPTO_ANSI_CPRNG=m
-# CONFIG_CRYPTO_HW is not set
-
-#
-# Library routines
-#
-CONFIG_BITREVERSE=y
-CONFIG_CRC_CCITT=y
-CONFIG_CRC16=m
-# CONFIG_CRC_T10DIF is not set
-CONFIG_CRC_ITU_T=m
-CONFIG_CRC32=y
-CONFIG_CRC7=m
-# CONFIG_LIBCRC32C is not set
-CONFIG_ZLIB_INFLATE=m
-CONFIG_ZLIB_DEFLATE=m
-CONFIG_LZO_COMPRESS=m
-CONFIG_LZO_DECOMPRESS=m
-CONFIG_TEXTSEARCH=y
-CONFIG_TEXTSEARCH_KMP=m
-CONFIG_TEXTSEARCH_BM=m
-CONFIG_TEXTSEARCH_FSM=m
-CONFIG_PLIST=y
-CONFIG_HAS_IOMEM=y
-CONFIG_HAS_IOPORT=y
-CONFIG_HAS_DMA=y
arch/mips/configs/fuloong2e_defconfig new file +1977 -0

1,088 lines not on this page · raw message

arch/mips/configs/fuloong2f_defconfig new file +2630 -0

2,630 lines not on this page · raw message

arch/mips/configs/yeeloong2f-7inch_defconfig new file +1720 -0

1,720 lines not on this page · raw message

arch/mips/configs/yeeloong2f_defconfig new file +2641 -0

2,641 lines not on this page · raw message

The rest of this diff is not shown. View the raw message.

Signature · 1 line
1.6.0.4

Part of the diff is not shown here. View the raw message.