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

Commit 2091a17f authored by Sergei Shtylyov's avatar Sergei Shtylyov Committed by Ralf Baechle
Browse files

[MIPS] Pb1500 code style cleanup



Fix several errors and warnings given by checkpatch.pl:

- use of C99 // comments;

- printk() without KERN_* facility level;

- unnecessary braces for single-statement block;

- using simple_strtol() where strict_strtol() could be used.

In addition to these changes, also do the following:

- replace numeric literals/expressions with the matching macros;

- insert spaces between operator and its operands;

- properly indent the code and the array initializers;

- remove useless #if dirctive from board_setup();

- remove needless parentheses;

- remove unneeded type casts;

- remove excess new lines;

- make hexadecimal literals all lower case;

- remove space after the type cast's closing parenthesis;

- insert missing space before closing brace in the array initializers;

- replace spaces after the macro name with tabs in the #define directives,
  also sometimes insert space there for better looks;

- fix typos/errors, capitalize acronyms, etc. in the comments;

- update MontaVista copyright;

- remove Pete Popov's old email address...

Signed-off-by: default avatarSergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
parent be1c3c1e
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
#
#  Copyright 2000,2001 MontaVista Software Inc.
#  Author: MontaVista Software, Inc.
#     	ppopov@mvista.com or source@mvista.com
#  Copyright 2000, 2001, 2008 MontaVista Software Inc.
#  Author: MontaVista Software, Inc. <source@mvista.com>
#
# Makefile for the Alchemy Semiconductor Pb1500 board.
#

lib-y := init.o board_setup.o irqmap.o
+21 −25
Original line number Diff line number Diff line
/*
 * Copyright 2000 MontaVista Software Inc.
 * Author: MontaVista Software, Inc.
 *         	ppopov@mvista.com or source@mvista.com
 * Copyright 2000, 2008 MontaVista Software Inc.
 * Author: MontaVista Software, Inc. <source@mvista.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
@@ -32,8 +31,8 @@

void board_reset(void)
{
    /* Hit BCSR.SYSTEM_CONTROL[SW_RST] */
    au_writel(0x00000000, 0xAE00001C);
	/* Hit BCSR.RST_VDDI[SOFT_RESET] */
	au_writel(0x00000000, PB1500_RST_VDDI);
}

void __init board_setup(void)
@@ -42,7 +41,7 @@ void __init board_setup(void)
	u32 sys_freqctrl, sys_clksrc;

	sys_clksrc = sys_freqctrl = pin_func = 0;
	// set AUX clock to 12MHz * 8 = 96 MHz
	/* Set AUX clock to 12 MHz * 8 = 96 MHz */
	au_writel(8, SYS_AUXPLL);
	au_writel(0, SYS_PINSTATERD);
	udelay(100);
@@ -51,47 +50,44 @@ void __init board_setup(void)

	/* GPIO201 is input for PCMCIA card detect */
	/* GPIO203 is input for PCMCIA interrupt request */
	au_writel(au_readl(GPIO2_DIR) & (u32)(~((1<<1)|(1<<3))), GPIO2_DIR);
	au_writel(au_readl(GPIO2_DIR) & ~((1 << 1) | (1 << 3)), GPIO2_DIR);

	/* zero and disable FREQ2 */
	/* Zero and disable FREQ2 */
	sys_freqctrl = au_readl(SYS_FREQCTRL0);
	sys_freqctrl &= ~0xFFF00000;
	au_writel(sys_freqctrl, SYS_FREQCTRL0);

	/* zero and disable USBH/USBD clocks */
	sys_clksrc = au_readl(SYS_CLKSRC);
	sys_clksrc &= ~0x00007FE0;
	sys_clksrc &= ~(SYS_CS_CUD | SYS_CS_DUD | SYS_CS_MUD_MASK |
			SYS_CS_CUH | SYS_CS_DUH | SYS_CS_MUH_MASK);
	au_writel(sys_clksrc, SYS_CLKSRC);

	sys_freqctrl = au_readl(SYS_FREQCTRL0);
	sys_freqctrl &= ~0xFFF00000;

	sys_clksrc = au_readl(SYS_CLKSRC);
	sys_clksrc &= ~0x00007FE0;
	sys_clksrc &= ~(SYS_CS_CUD | SYS_CS_DUD | SYS_CS_MUD_MASK |
			SYS_CS_CUH | SYS_CS_DUH | SYS_CS_MUH_MASK);

	// FREQ2 = aux/2 = 48 MHz
	sys_freqctrl |= ((0<<22) | (1<<21) | (1<<20));
	/* FREQ2 = aux/2 = 48 MHz */
	sys_freqctrl |= (0 << SYS_FC_FRDIV2_BIT) | SYS_FC_FE2 | SYS_FC_FS2;
	au_writel(sys_freqctrl, SYS_FREQCTRL0);

	/*
	 * Route 48MHz FREQ2 into USB Host and/or Device
	 */
#if defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE)
	sys_clksrc |= ((4<<12) | (0<<11) | (0<<10));
#endif
	sys_clksrc |= SYS_CS_MUX_FQ2 << SYS_CS_MUH_BIT;
	au_writel(sys_clksrc, SYS_CLKSRC);


	pin_func = au_readl(SYS_PINFUNC) & (u32)(~0x8000);
	// 2nd USB port is USB host
	pin_func |= 0x8000;
	pin_func = au_readl(SYS_PINFUNC) & ~SYS_PF_USB;
	/* 2nd USB port is USB host */
	pin_func |= SYS_PF_USB;
	au_writel(pin_func, SYS_PINFUNC);
#endif /* defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE) */



#ifdef CONFIG_PCI
	// Setup PCI bus controller
	/* Setup PCI bus controller */
	au_writel(0, Au1500_PCI_CMEM);
	au_writel(0x00003fff, Au1500_CFG_BASE);
#if defined(__MIPSEB__)
@@ -112,11 +108,11 @@ void __init board_setup(void)

	/* Enable the RTC if not already enabled */
	if (!(au_readl(0xac000028) & 0x20)) {
		printk("enabling clock ...\n");
		printk(KERN_INFO "enabling clock ...\n");
		au_writel((au_readl(0xac000028) | 0x20), 0xac000028);
	}
	/* Put the clock in BCD mode */
	if (au_readl(0xac00002C) & 0x4) { /* reg B */
	if (au_readl(0xac00002c) & 0x4) { /* reg B */
		au_writel(au_readl(0xac00002c) & ~0x4, 0xac00002c);
		au_sync();
	}
+9 −11
Original line number Diff line number Diff line
/*
 *
 * BRIEF MODULE DESCRIPTION
 *	PB1500 board setup
 *	Pb1500 board setup
 *
 * Copyright 2001 MontaVista Software Inc.
 * Author: MontaVista Software, Inc.
 *         	ppopov@mvista.com or source@mvista.com
 * Copyright 2001, 2008 MontaVista Software Inc.
 * Author: MontaVista Software, Inc. <source@mvista.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
@@ -51,10 +50,9 @@ void __init prom_init(void)

	prom_init_cmdline();
	memsize_str = prom_getenv("memsize");
	if (!memsize_str) {
	if (!memsize_str)
		memsize = 0x04000000;
	} else {
		memsize = simple_strtol(memsize_str, NULL, 0);
	}
	else
		memsize = strict_strtol(memsize_str, 0, NULL);
	add_memory_region(0, memsize, BOOT_MEM_RAM);
}
+18 −20
Original line number Diff line number Diff line
/*
 * Alchemy Semi PB1500 Referrence Board
 * Alchemy Semi Pb1500 Referrence Board
 *
 * Copyright 2001 MontaVista Software Inc.
 * Author: MontaVista Software, Inc.
 *         	ppopov@mvista.com or source@mvista.com
 * Copyright 2001, 2008 MontaVista Software Inc.
 * Author: MontaVista Software, Inc. <source@mvista.com>
 *
 * ########################################################################
 *
@@ -27,7 +26,6 @@
#ifndef __ASM_PB1500_H
#define __ASM_PB1500_H


#define IDENT_BOARD_REG 	0xAE000000
#define BOARD_STATUS_REG	0xAE000004
#define PCI_BOARD_REG		0xAE000010
@@ -41,7 +39,7 @@
#define PB1500_HEX_LED		0xAF000004
#define PB1500_HEX_LED_BLANK	0xAF000008

/* PCMCIA PB1500 specific defines */
/* PCMCIA Pb1500 specific defines */
#define PCMCIA_MAX_SOCK  0
#define PCMCIA_NUM_SOCKS (PCMCIA_MAX_SOCK + 1)

+3 −3

File changed.

Contains only whitespace changes.