Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5e983ff6 authored by Wu Zhangjin's avatar Wu Zhangjin Committed by Ralf Baechle
Browse files

MIPS: Loongson: clean up the coding style



With the help of script/checkpatch.pl, i have cleaned up the coding
style.

1. remove un-needed header files and tune some comments.
2. remove some un-needed { }

add a new header file loongson.h:

3. move some common header files to loongson.h
4. move some common extern declartions to loongson.h

and this new header file is needed for future loongson2f support.

Signed-off-by: default avatarWu Zhangjin <wuzj@lemote.com>
Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
parent bd92aa01
Loading
Loading
Loading
Loading
+36 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2009 Lemote, Inc. & Institute of Computing Technology
 * Author: Wu Zhangjin <wuzj@lemote.com>
 *
 * This program is free software; you can redistribute  it and/or modify it
 * under  the terms of  the GNU General  Public License as published by the
 * Free Software Foundation;  either version 2 of the  License, or (at your
 * option) any later version.
 *
 * Copyright (C) 2007 Lemote, Inc. & Institute of Computing Technology
 * Author: Fuxin Zhang, zhangfx@lemote.com
 * Copyright (C) 2009 Lemote, Inc. & Institute of Computing Technology
 * Author: Zhangjin Wu, wuzj@lemote.com
 */
#include <linux/init.h>
#include <linux/pm.h>

#ifndef __ASM_MACH_LOONGSON_LOONGSON_H
#define __ASM_MACH_LOONGSON_LOONGSON_H

#include <linux/io.h>
#include <linux/init.h>

#include <asm/reboot.h>
/* there is an internal bonito64-compatiable northbridge in loongson2e/2f */
#include <asm/mips-boards/bonito64.h>

static void loongson2e_restart(char *command)
{
	/* do preparation for reboot */
	BONITO_BONGENCFG &= ~(1 << 2);
	BONITO_BONGENCFG |= (1 << 2);

	/* reboot via jumping to boot base address */
	((void (*)(void))ioremap_nocache(BONITO_BOOT_BASE, 4)) ();
}
/* loongson internal northbridge initialization */
extern void bonito_irq_init(void);

static void loongson2e_halt(void)
{
	while (1) ;
}
/* loongson-based machines specific reboot setup */
extern void mips_reboot_setup(void);

static int __init mips_reboot_setup(void)
{
	_machine_restart = loongson2e_restart;
	_machine_halt = loongson2e_halt;
	pm_power_off = loongson2e_halt;
/* environment arguments from bootloader */
extern unsigned long bus_clock, cpu_clock_freq;
extern unsigned long memsize, highmemsize;

	return 0;
}
/* 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);

arch_initcall(mips_reboot_setup);
#endif /* __ASM_MACH_LOONGSON_LOONGSON_H */
+5 −3
Original line number Diff line number Diff line
@@ -19,11 +19,13 @@
 * 02139, USA.
 */

#ifndef _LEMOTE_PCI_H_
#define _LEMOTE_PCI_H_
#ifndef __ASM_MACH_LEMOTE_PCI_H_
#define __ASM_MACH_LEMOTE_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

#endif /* !_LEMOTE_PCI_H_ */
#endif /* !__ASM_MACH_LEMOTE_PCI_H_ */
+2 −25
Original line number Diff line number Diff line
@@ -10,32 +10,10 @@
 *  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  SOFTWARE  IS PROVIDED   ``AS  IS'' AND   ANY  EXPRESS OR IMPLIED
 *  WARRANTIES,   INCLUDING, BUT NOT  LIMITED  TO, THE IMPLIED WARRANTIES OF
 *  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN
 *  NO  EVENT  SHALL   THE AUTHOR  BE    LIABLE FOR ANY   DIRECT, INDIRECT,
 *  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
 *  NOT LIMITED   TO, PROCUREMENT OF  SUBSTITUTE GOODS  OR SERVICES; LOSS OF
 *  USE, DATA,  OR PROFITS; OR  BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
 *  ANY THEORY OF LIABILITY, WHETHER IN  CONTRACT, STRICT LIABILITY, OR TORT
 *  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
 *  THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 *
 *  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.
 *
 */
#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 <asm/mips-boards/bonito64.h>

#include <loongson.h>

static inline void bonito_irq_enable(unsigned int irq)
{
@@ -66,9 +44,8 @@ void bonito_irq_init(void)
{
	u32 i;

	for (i = BONITO_IRQ_BASE; i < BONITO_IRQ_BASE + 32; i++) {
	for (i = BONITO_IRQ_BASE; i < BONITO_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);
}
+2 −3
Original line number Diff line number Diff line
@@ -17,11 +17,10 @@
 * Free Software Foundation;  either version 2 of the  License, or (at your
 * option) any later version.
 */
#include <linux/io.h>
#include <linux/init.h>

#include <asm/bootinfo.h>

#include <loongson.h>

int prom_argc;
/* pmon passes arguments in 32bit pointers */
int *_prom_argv;
+1 −3
Original line number Diff line number Diff line
@@ -9,11 +9,9 @@
 *  Free Software Foundation;  either version 2 of the  License, or (at your
 *  option) any later version.
 */
#include <linux/io.h>
#include <linux/init.h>
#include <linux/serial_reg.h>

#include <asm/mips-boards/bonito64.h>
#include <loongson.h>

#define UART_BASE (BONITO_PCIIO_BASE + 0x3f8)

Loading