Skip to contentSkip to conversation

Malta: massive code cleanup

PATCH In review Dmitri Vorobiev 2 participants 20 messages Jan 24, 2008 – Jan 28, 2008

Subsystems (2)
lore
Share & tools
lore
#1 lore raw

PATCH 1/17 Malta: use Linux kernel style for structure initialization

In reply to Dmitri Vorobiev

This patch reformats the structure initialization code thus making the latter look idiomatic.

No functional changes introduced.

---
 arch/mips/mips-boards/malta/malta_setup.c |   56 +++++++++++++++++++++-------
 1 files changed, 42 insertions(+), 14 deletions(-)
arch/mips/mips-boards/malta/malta_setup.c +42 -14
index bc43a5c..d051405 100644
@@ -43,11 +43,36 @@ extern void kgdb_config(void);
 #endif
 
 struct resource standard_io_resources[] = {
-	{ .name = "dma1", .start = 0x00, .end = 0x1f, .flags = IORESOURCE_BUSY },
-	{ .name = "timer", .start = 0x40, .end = 0x5f, .flags = IORESOURCE_BUSY },
-	{ .name = "keyboard", .start = 0x60, .end = 0x6f, .flags = IORESOURCE_BUSY },
-	{ .name = "dma page reg", .start = 0x80, .end = 0x8f, .flags = IORESOURCE_BUSY },
-	{ .name = "dma2", .start = 0xc0, .end = 0xdf, .flags = IORESOURCE_BUSY },
+	{
+		.name = "dma1",
+		.start = 0x00,
+		.end = 0x1f,
+		.flags = IORESOURCE_BUSY
+	},
+	{
+		.name = "timer",
+		.start = 0x40,
+		.end = 0x5f,
+		.flags = IORESOURCE_BUSY
+	},
+	{
+		.name = "keyboard",
+		.start = 0x60,
+		.end = 0x6f,
+		.flags = IORESOURCE_BUSY
+	},
+	{
+		.name = "dma page reg",
+		.start = 0x80,
+		.end = 0x8f,
+		.flags = IORESOURCE_BUSY
+	},
+	{
+		.name = "dma2",
+		.start = 0xc0,
+		.end = 0xdf,
+		.flags = IORESOURCE_BUSY
+	},
 };
 
 const char *get_system_type(void)
@@ -171,15 +196,18 @@ void __init plat_mem_setup(void)
 #ifdef CONFIG_VT
 #if defined(CONFIG_VGA_CONSOLE)
 	screen_info = (struct screen_info) {
-		0, 25,			/* orig-x, orig-y */
-		0,			/* unused */
-		0,			/* orig-video-page */
-		0,			/* orig-video-mode */
-		80,			/* orig-video-cols */
-		0, 0, 0,		/* ega_ax, ega_bx, ega_cx */
-		25,			/* orig-video-lines */
-		VIDEO_TYPE_VGAC,	/* orig-video-isVGA */
-		16			/* orig-video-points */
+		.orig_x = 0,
+		.orig_y = 25,
+		.ext_mem_k = 0,
+		.orig_video_page = 0,
+		.orig_video_mode = 0,
+		.orig_video_cols = 80,
+		.unused2 = 0,
+		.orig_video_ega_bx = 0,
+		.unused3 = 0,
+		.orig_video_lines = 25,
+		.orig_video_isVGA = VIDEO_TYPE_VGAC,
+		.orig_video_points = 16
 	};
 #endif
 #endif
Signature · 1 line
1.5.3
#3 lore raw

PATCH 3/17 Malta: check the PCI clock frequency in a separate function

In reply to Dmitri Vorobiev

This patch adds a separate short and sweet function to check the PCI clock frequency. This is to improve readability of the Malta setup code.

Along the way, a couple of coding style violations are fixed.

No functional changes introduced.

---
 arch/mips/mips-boards/malta/malta_setup.c |   43 +++++++++++++++++------------
 1 files changed, 25 insertions(+), 18 deletions(-)
arch/mips/mips-boards/malta/malta_setup.c +25 -18
index d051405..79d74ea 100644
@@ -108,6 +108,30 @@ void __init fd_activate(void)
 }
 #endif
 
+#ifdef CONFIG_BLK_DEV_IDE
+static void __init pci_clock_check(void)
+{
+	unsigned int __iomem *jmpr_p =
+		(unsigned int *) ioremap(MALTA_JMPRS_REG, sizeof(unsigned int));
+	int jmpr = (__raw_readl(jmpr_p) >> 2) & 0x07;
+	static const int pciclocks[] __initdata = {
+		33, 20, 25, 30, 12, 16, 37, 10
+	};
+	int pciclock = pciclocks[jmpr];
+	char *argptr = prom_getcmdline();
+
+	if (pciclock != 33 && !strstr(argptr, "idebus=")) {
+		printk(KERN_WARNING "WARNING: PCI clock is %dMHz, "
+				"setting idebus\n", pciclock);
+		argptr += strlen(argptr);
+		sprintf(argptr, " idebus=%d", pciclock);
+		if (pciclock < 20 || pciclock > 66)
+			printk(KERN_WARNING "WARNING: IDE timing "
+					"calculations will be incorrect\n");
+	}
+}
+#endif
+
 void __init plat_mem_setup(void)
 {
 	unsigned int i;
@@ -171,24 +195,7 @@ void __init plat_mem_setup(void)
 #endif
 
 #ifdef CONFIG_BLK_DEV_IDE
-	/* Check PCI clock */
-	{
-		unsigned int __iomem *jmpr_p = (unsigned int *) ioremap(MALTA_JMPRS_REG, sizeof(unsigned int));
-		int jmpr = (__raw_readl(jmpr_p) >> 2) & 0x07;
-		static const int pciclocks[] __initdata = {
-			33, 20, 25, 30, 12, 16, 37, 10
-		};
-		int pciclock = pciclocks[jmpr];
-		char *argptr = prom_getcmdline();
-
-		if (pciclock != 33 && !strstr (argptr, "idebus=")) {
-			printk("WARNING: PCI clock is %dMHz, setting idebus\n", pciclock);
-			argptr += strlen(argptr);
-			sprintf(argptr, " idebus=%d", pciclock);
-			if (pciclock < 20 || pciclock > 66)
-				printk("WARNING: IDE timing calculations will be incorrect\n");
-		}
-	}
+	pci_clock_check();
 #endif
 #ifdef CONFIG_BLK_DEV_FD
 	fd_activate();
Signature · 1 line
1.5.3
#0 lore raw

cover Malta: massive code cleanup

Ralf,

This is the Malta cleanup, which I was talking about some time ago.

The patches should be fairly obvious. They make no functional changes.

Build tests passed successfully when I used the default configs for Atlas, Malta and SEAD.

Just in case, I also ran boot tests, which passed successfully with the default Malta config and a Qemu-emulated Malta board in both BE and LE modes.

The net effect is that the number of errors, warnings, and checks reported by checkpatch.pl changes as follows:

Before:

--------------------------------------------
| errors | warnings | checks
--------------------------------------------
malta_int.c | 47 | 20 | 1
--------------------------------------------
malta_setup.c | 3 | 21 | 3
--------------------------------------------
malta_smtc.c | 2 | 0 | 0
--------------------------------------------

After:

--------------------------------------------
| errors | warnings | checks
--------------------------------------------
malta_int.c | 0 | 0 | 0
--------------------------------------------
malta_setup.c | 0 | 0 | 0
--------------------------------------------
malta_smtc.c | 0 | 0 | 0
--------------------------------------------

The last patch in the series removes a very obsolete and misleading document from Documentation/mips.

Please consider.

Thanks,

Dmitri

#4 lore raw

PATCH 4/17 Malta: set up the screen info in a separate function

This patch adds a separate short and sweet function to initialize the screen_info global variable.

This improves readability of the Malta board setup code.

No functional changes introduced.

---
 arch/mips/mips-boards/malta/malta_setup.c |   39 ++++++++++++++++------------
 1 files changed, 22 insertions(+), 17 deletions(-)
arch/mips/mips-boards/malta/malta_setup.c +22 -17
index 79d74ea..8b391ee 100644
@@ -132,6 +132,26 @@ static void __init pci_clock_check(void)
 }
 #endif
 
+#if defined(CONFIG_VT) && defined(CONFIG_VGA_CONSOLE)
+static void __init screen_info_setup(void)
+{
+	screen_info = (struct screen_info) {
+		.orig_x = 0,
+		.orig_y = 25,
+		.ext_mem_k = 0,
+		.orig_video_page = 0,
+		.orig_video_mode = 0,
+		.orig_video_cols = 80,
+		.unused2 = 0,
+		.orig_video_ega_bx = 0,
+		.unused3 = 0,
+		.orig_video_lines = 25,
+		.orig_video_isVGA = VIDEO_TYPE_VGAC,
+		.orig_video_points = 16
+	};
+}
+#endif
+
 void __init plat_mem_setup(void)
 {
 	unsigned int i;
@@ -200,23 +220,8 @@ void __init plat_mem_setup(void)
 #ifdef CONFIG_BLK_DEV_FD
 	fd_activate();
 #endif
-#ifdef CONFIG_VT
-#if defined(CONFIG_VGA_CONSOLE)
-	screen_info = (struct screen_info) {
-		.orig_x = 0,
-		.orig_y = 25,
-		.ext_mem_k = 0,
-		.orig_video_page = 0,
-		.orig_video_mode = 0,
-		.orig_video_cols = 80,
-		.unused2 = 0,
-		.orig_video_ega_bx = 0,
-		.unused3 = 0,
-		.orig_video_lines = 25,
-		.orig_video_isVGA = VIDEO_TYPE_VGAC,
-		.orig_video_points = 16
-	};
-#endif
+#if defined(CONFIG_VT) && defined(CONFIG_VGA_CONSOLE)
+	screen_info_setup();
 #endif
 	mips_reboot_setup();
 }
Signature · 1 line
1.5.3
#2 lore raw

PATCH 2/17 Malta: use the KERN_ facility level in printk()

In reply to Dmitri Vorobiev

This patch adds the KERN_ macros to printk() calls. Where applicable, spaces are replaced by tabs.

These changes noticeably reduce the number of errors and warnings reported by the checkpatch.pl script for the malta_int.c file.

Before the patch: total: 47 errors, 20 warnings, 354 lines checked

After the patch: total: 34 errors, 7 warnings, 355 lines checked

No functional changes introduced.

---
 arch/mips/mips-boards/malta/malta_int.c |   27 ++++++++++++++-------------
 1 files changed, 14 insertions(+), 13 deletions(-)
arch/mips/mips-boards/malta/malta_int.c +14 -13
index f010261..2483b40 100644
@@ -83,7 +83,7 @@ static inline int mips_pcibios_iack(void)
 		BONITO_PCIMAP_CFG = 0;
 		break;
 	default:
-	        printk("Unknown system controller.\n");
+		printk(KERN_WARNING "Unknown system controller.\n");
 		return -1;
 	}
 	return irq;
@@ -127,8 +127,8 @@ static void corehi_irqdispatch(void)
 	unsigned int intrcause, datalo, datahi;
 	struct pt_regs *regs = get_irq_regs();
 
-        printk("CoreHI interrupt, shouldn't happen, so we die here!!!\n");
-        printk("epc   : %08lx\nStatus: %08lx\n"
+	printk(KERN_EMERG "CoreHI interrupt, shouldn't happen, we die here!\n");
+	printk(KERN_EMERG "epc   : %08lx\nStatus: %08lx\n"
 	       "Cause : %08lx\nbadVaddr : %08lx\n",
 	       regs->cp0_epc, regs->cp0_status,
 	       regs->cp0_cause, regs->cp0_badvaddr);
@@ -149,8 +149,9 @@ static void corehi_irqdispatch(void)
                 intrcause = GT_READ(GT_INTRCAUSE_OFS);
                 datalo = GT_READ(GT_CPUERR_ADDRLO_OFS);
                 datahi = GT_READ(GT_CPUERR_ADDRHI_OFS);
-                printk("GT_INTRCAUSE = %08x\n", intrcause);
-                printk("GT_CPUERR_ADDR = %02x%08x\n", datahi, datalo);
+		printk(KERN_EMERG "GT_INTRCAUSE = %08x\n", intrcause);
+		printk(KERN_EMERG "GT_CPUERR_ADDR = %02x%08x\n",
+				datahi, datalo);
                 break;
         case MIPS_REVISION_SCON_BONITO:
                 pcibadaddr = BONITO_PCIBADADDR;
@@ -161,14 +162,14 @@ static void corehi_irqdispatch(void)
                 intedge = BONITO_INTEDGE;
                 intsteer = BONITO_INTSTEER;
                 pcicmd = BONITO_PCICMD;
-                printk("BONITO_INTISR = %08x\n", intisr);
-                printk("BONITO_INTEN = %08x\n", inten);
-                printk("BONITO_INTPOL = %08x\n", intpol);
-                printk("BONITO_INTEDGE = %08x\n", intedge);
-                printk("BONITO_INTSTEER = %08x\n", intsteer);
-                printk("BONITO_PCICMD = %08x\n", pcicmd);
-                printk("BONITO_PCIBADADDR = %08x\n", pcibadaddr);
-                printk("BONITO_PCIMSTAT = %08x\n", pcimstat);
+		printk(KERN_EMERG "BONITO_INTISR = %08x\n", intisr);
+		printk(KERN_EMERG "BONITO_INTEN = %08x\n", inten);
+		printk(KERN_EMERG "BONITO_INTPOL = %08x\n", intpol);
+		printk(KERN_EMERG "BONITO_INTEDGE = %08x\n", intedge);
+		printk(KERN_EMERG "BONITO_INTSTEER = %08x\n", intsteer);
+		printk(KERN_EMERG "BONITO_PCICMD = %08x\n", pcicmd);
+		printk(KERN_EMERG "BONITO_PCIBADADDR = %08x\n", pcibadaddr);
+		printk(KERN_EMERG "BONITO_PCIMSTAT = %08x\n", pcimstat);
                 break;
         }
 
Signature · 1 line
1.5.3
#6 lore raw

PATCH 6/17 Malta: remove a dead function declaration

In reply to Dmitri Vorobiev

Neither is the mips_rtc_get_time() routine defined anywhere in the MIPS architecture-specific code, nor does anyone call it any more. This patch removes the extern declaration of this fossil.

This patch does not introduce any functional changes.

---
 arch/mips/mips-boards/malta/malta_setup.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)
arch/mips/mips-boards/malta/malta_setup.c +0 -1
index 8b391ee..480521f 100644
@@ -36,7 +36,6 @@
 #endif
 
 extern void mips_reboot_setup(void);
-extern unsigned long mips_rtc_get_time(void);
 
 #ifdef CONFIG_KGDB
 extern void kgdb_config(void);
Signature · 1 line
1.5.3
#5 lore raw

PATCH 5/17 Malta: use tabs not spaces

In reply to Dmitri Vorobiev

This patch fixes all "use tabs not spaces" warnings reported by the checkpatch.pl script on the board-specific files.

No functional changes introduced.

---
 arch/mips/mips-boards/malta/malta_int.c  |   64 +++++++++++++++---------------
 arch/mips/mips-boards/malta/malta_smtc.c |    4 +-
 2 files changed, 34 insertions(+), 34 deletions(-)
arch/mips/mips-boards/malta/malta_int.c +32 -32
index 2483b40..6d371f4 100644
@@ -47,7 +47,7 @@ static DEFINE_SPINLOCK(mips_irq_lock);
 static inline int mips_pcibios_iack(void)
 {
 	int irq;
-        u32 dummy;
+	u32 dummy;
 
 	/*
 	 * Determine highest priority pending interrupt by performing
@@ -58,7 +58,7 @@ static inline int mips_pcibios_iack(void)
 	case MIPS_REVISION_SCON_ROCIT:
 	case MIPS_REVISION_SCON_SOCITSC:
 	case MIPS_REVISION_SCON_SOCITSCP:
-	        MSC_READ(MSC01_PCI_IACK, irq);
+		MSC_READ(MSC01_PCI_IACK, irq);
 		irq &= 0xff;
 		break;
 	case MIPS_REVISION_SCON_GT64120:
@@ -123,15 +123,15 @@ static void malta_hw0_irqdispatch(void)
 static void corehi_irqdispatch(void)
 {
 	unsigned int intedge, intsteer, pcicmd, pcibadaddr;
-        unsigned int pcimstat, intisr, inten, intpol;
+	unsigned int pcimstat, intisr, inten, intpol;
 	unsigned int intrcause, datalo, datahi;
 	struct pt_regs *regs = get_irq_regs();
 
 	printk(KERN_EMERG "CoreHI interrupt, shouldn't happen, we die here!\n");
 	printk(KERN_EMERG "epc   : %08lx\nStatus: %08lx\n"
-	       "Cause : %08lx\nbadVaddr : %08lx\n",
-	       regs->cp0_epc, regs->cp0_status,
-	       regs->cp0_cause, regs->cp0_badvaddr);
+			"Cause : %08lx\nbadVaddr : %08lx\n",
+			regs->cp0_epc, regs->cp0_status,
+			regs->cp0_cause, regs->cp0_badvaddr);
 
 	/* Read all the registers and then print them as there is a
 	   problem with interspersed printk's upsetting the Bonito controller.
@@ -139,29 +139,29 @@ static void corehi_irqdispatch(void)
 	*/
 
 	switch (mips_revision_sconid) {
-        case MIPS_REVISION_SCON_SOCIT:
+	case MIPS_REVISION_SCON_SOCIT:
 	case MIPS_REVISION_SCON_ROCIT:
 	case MIPS_REVISION_SCON_SOCITSC:
 	case MIPS_REVISION_SCON_SOCITSCP:
-                ll_msc_irq();
-                break;
-        case MIPS_REVISION_SCON_GT64120:
-                intrcause = GT_READ(GT_INTRCAUSE_OFS);
-                datalo = GT_READ(GT_CPUERR_ADDRLO_OFS);
-                datahi = GT_READ(GT_CPUERR_ADDRHI_OFS);
+		ll_msc_irq();
+		break;
+	case MIPS_REVISION_SCON_GT64120:
+		intrcause = GT_READ(GT_INTRCAUSE_OFS);
+		datalo = GT_READ(GT_CPUERR_ADDRLO_OFS);
+		datahi = GT_READ(GT_CPUERR_ADDRHI_OFS);
 		printk(KERN_EMERG "GT_INTRCAUSE = %08x\n", intrcause);
 		printk(KERN_EMERG "GT_CPUERR_ADDR = %02x%08x\n",
 				datahi, datalo);
-                break;
-        case MIPS_REVISION_SCON_BONITO:
-                pcibadaddr = BONITO_PCIBADADDR;
-                pcimstat = BONITO_PCIMSTAT;
-                intisr = BONITO_INTISR;
-                inten = BONITO_INTEN;
-                intpol = BONITO_INTPOL;
-                intedge = BONITO_INTEDGE;
-                intsteer = BONITO_INTSTEER;
-                pcicmd = BONITO_PCICMD;
+		break;
+	case MIPS_REVISION_SCON_BONITO:
+		pcibadaddr = BONITO_PCIBADADDR;
+		pcimstat = BONITO_PCIMSTAT;
+		intisr = BONITO_INTISR;
+		inten = BONITO_INTEN;
+		intpol = BONITO_INTPOL;
+		intedge = BONITO_INTEDGE;
+		intsteer = BONITO_INTSTEER;
+		pcicmd = BONITO_PCICMD;
 		printk(KERN_EMERG "BONITO_INTISR = %08x\n", intisr);
 		printk(KERN_EMERG "BONITO_INTEN = %08x\n", inten);
 		printk(KERN_EMERG "BONITO_INTPOL = %08x\n", intpol);
@@ -170,11 +170,11 @@ static void corehi_irqdispatch(void)
 		printk(KERN_EMERG "BONITO_PCICMD = %08x\n", pcicmd);
 		printk(KERN_EMERG "BONITO_PCIBADADDR = %08x\n", pcibadaddr);
 		printk(KERN_EMERG "BONITO_PCIMSTAT = %08x\n", pcimstat);
-                break;
-        }
+		break;
+	}
 
-        /* We die here*/
-        die("CoreHi interrupt", regs);
+	/* We die here*/
+	die("CoreHi interrupt", regs);
 }
 
 static inline int clz(unsigned long x)
@@ -300,17 +300,17 @@ void __init arch_init_irq(void)
 	if (!cpu_has_veic)
 		mips_cpu_irq_init();
 
-        switch(mips_revision_sconid) {
-        case MIPS_REVISION_SCON_SOCIT:
-        case MIPS_REVISION_SCON_ROCIT:
+	switch (mips_revision_sconid) {
+	case MIPS_REVISION_SCON_SOCIT:
+	case MIPS_REVISION_SCON_ROCIT:
 		if (cpu_has_veic)
 			init_msc_irqs(MIPS_MSC01_IC_REG_BASE, MSC01E_INT_BASE, msc_eicirqmap, msc_nr_eicirqs);
 		else
 			init_msc_irqs(MIPS_MSC01_IC_REG_BASE, MSC01C_INT_BASE, msc_irqmap, msc_nr_irqs);
 		break;
 
-        case MIPS_REVISION_SCON_SOCITSC:
-        case MIPS_REVISION_SCON_SOCITSCP:
+	case MIPS_REVISION_SCON_SOCITSC:
+	case MIPS_REVISION_SCON_SOCITSCP:
 		if (cpu_has_veic)
 			init_msc_irqs(MIPS_SOCITSC_IC_REG_BASE, MSC01E_INT_BASE, msc_eicirqmap, msc_nr_eicirqs);
 		else
arch/mips/mips-boards/malta/malta_smtc.c +2 -2
index 5c980f4..0a1a40a 100644
@@ -36,7 +36,7 @@ void __cpuinit prom_boot_secondary(int cpu, struct task_struct *idle)
 
 void __cpuinit prom_init_secondary(void)
 {
-        void smtc_init_secondary(void);
+	void smtc_init_secondary(void);
 	int myvpe;
 
 	/* Don't enable Malta I/O interrupts (IP2) for secondary VPEs */
@@ -50,7 +50,7 @@ void __cpuinit prom_init_secondary(void)
 			set_c0_status(0x100 << cp0_perfcount_irq);
 	}
 
-        smtc_init_secondary();
+	smtc_init_secondary();
 }
 
 /*
Signature · 1 line
1.5.3
#8 lore raw

PATCH 8/17 Malta, Atlas, Sead: remove an extern from .c files

In reply to Dmitri Vorobiev

This patch moves the "extern" declaration for the function mips_reboot_setup() from the board setup .c files to the header file include/asm-mips/mips-boards/generic.h.

This fixes a warning produced by the checkpatch.pl script.

No functional changes introduced.

This was compile-tested by building the kernel for all three boards affected by this change. All builds finished successfully.

---
 arch/mips/mips-boards/atlas/atlas_setup.c |    2 --
 arch/mips/mips-boards/malta/malta_setup.c |    2 --
 arch/mips/mips-boards/sead/sead_setup.c   |    2 --
 include/asm-mips/mips-boards/generic.h    |    2 ++
 4 files changed, 2 insertions(+), 6 deletions(-)
arch/mips/mips-boards/atlas/atlas_setup.c +0 -2
index e405d11..5ce8004 100644
@@ -34,8 +34,6 @@
 #include <asm/time.h>
 #include <asm/traps.h>
 
-extern void mips_reboot_setup(void);
-
 #ifdef CONFIG_KGDB
 extern void kgdb_config(void);
 #endif
arch/mips/mips-boards/malta/malta_setup.c +0 -2
index 480521f..e5ac079 100644
@@ -35,8 +35,6 @@
 #include <linux/console.h>
 #endif
 
-extern void mips_reboot_setup(void);
-
 #ifdef CONFIG_KGDB
 extern void kgdb_config(void);
 #endif
arch/mips/mips-boards/sead/sead_setup.c +0 -2
index 1fb61b8..8aa8e5b 100644
@@ -34,8 +34,6 @@
 #include <asm/mips-boards/seadint.h>
 #include <asm/time.h>
 
-extern void mips_reboot_setup(void);
-
 static void __init serial_init(void);
 
 const char *get_system_type(void)
include/asm-mips/mips-boards/generic.h +2 -0
index d589774..2ca6bda 100644
@@ -97,6 +97,8 @@ extern int mips_revision_corid;
 
 extern int mips_revision_sconid;
 
+extern void mips_reboot_setup(void);
+
 #ifdef CONFIG_PCI
 extern void mips_pcibios_init(void);
 #else
Signature · 1 line
1.5.3
#9 lore raw

PATCH 9/17 Malta: include <linux/cpu.h> instead of <asm/cpu.h>

In reply to Dmitri Vorobiev

The checkpatch.pl script reported a few warnings about header files. This patch fixes these warnings.

Compile-tested using the default Malta config.

No functional changes introduced.

---
 arch/mips/mips-boards/malta/malta_int.c   |    2 +-
 arch/mips/mips-boards/malta/malta_setup.c |    6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)
arch/mips/mips-boards/malta/malta_int.c +1 -1
index 1b4b9c5..41eb232 100644
@@ -26,13 +26,13 @@
 #include <linux/sched.h>
 #include <linux/slab.h>
 #include <linux/interrupt.h>
+#include <linux/io.h>
 #include <linux/kernel_stat.h>
 #include <linux/kernel.h>
 #include <linux/random.h>
 
 #include <asm/i8259.h>
 #include <asm/irq_cpu.h>
-#include <asm/io.h>
 #include <asm/irq_regs.h>
 #include <asm/mips-boards/malta.h>
 #include <asm/mips-boards/maltaint.h>
arch/mips/mips-boards/malta/malta_setup.c +3 -3
index e5ac079..3e2de0b 100644
@@ -15,21 +15,21 @@
  *  with this program; if not, write to the Free Software Foundation, Inc.,
  *  59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
  */
+#include <linux/cpu.h>
 #include <linux/init.h>
 #include <linux/sched.h>
 #include <linux/ioport.h>
+#include <linux/irq.h>
 #include <linux/pci.h>
 #include <linux/screen_info.h>
+#include <linux/time.h>
 
-#include <asm/cpu.h>
 #include <asm/bootinfo.h>
-#include <asm/irq.h>
 #include <asm/mips-boards/generic.h>
 #include <asm/mips-boards/prom.h>
 #include <asm/mips-boards/malta.h>
 #include <asm/mips-boards/maltaint.h>
 #include <asm/dma.h>
-#include <asm/time.h>
 #include <asm/traps.h>
 #ifdef CONFIG_VT
 #include <linux/console.h>
Signature · 1 line
1.5.3
#12 lore raw

PATCH 12/17 Malta: Use C89 style for comments

In reply to Dmitri Vorobiev

Remove comments in C99 style and make checkpatch.pl happy.

No functional changes introduced.

---
 arch/mips/mips-boards/malta/malta_int.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
arch/mips/mips-boards/malta/malta_int.c +2 -2
index 2473a77..92e6e2d 100644
@@ -214,9 +214,9 @@ static inline unsigned int irq_ffs(unsigned int pending)
 
 	t0 = pending & 0x8000;
 	t0 = t0 < 1;
-	//t0 = t0 << 2;
+	/* t0 = t0 << 2; */
 	a0 = a0 - t0;
-	//pending = pending << t0;
+	/* pending = pending << t0; */
 
 	return a0;
 #endif
Signature · 1 line
1.5.3
#7 lore raw

PATCH 7/17 Malta: fix oversized lines in malta_int.c

In reply to Dmitri Vorobiev

This patch fixes all "line over 80 characters" warnings found in arch/mips/mips-boards/malta/malta_int.c by the checkpatch.pl script.

No functional changes introduced.

---
 arch/mips/mips-boards/malta/malta_int.c |   22 ++++++++++++++++------
 1 files changed, 16 insertions(+), 6 deletions(-)
arch/mips/mips-boards/malta/malta_int.c +16 -6
index 6d371f4..1b4b9c5 100644
@@ -304,17 +304,25 @@ void __init arch_init_irq(void)
 	case MIPS_REVISION_SCON_SOCIT:
 	case MIPS_REVISION_SCON_ROCIT:
 		if (cpu_has_veic)
-			init_msc_irqs(MIPS_MSC01_IC_REG_BASE, MSC01E_INT_BASE, msc_eicirqmap, msc_nr_eicirqs);
+			init_msc_irqs(MIPS_MSC01_IC_REG_BASE,
+					MSC01E_INT_BASE, msc_eicirqmap,
+					msc_nr_eicirqs);
 		else
-			init_msc_irqs(MIPS_MSC01_IC_REG_BASE, MSC01C_INT_BASE, msc_irqmap, msc_nr_irqs);
+			init_msc_irqs(MIPS_MSC01_IC_REG_BASE,
+					MSC01C_INT_BASE, msc_irqmap,
+					msc_nr_irqs);
 		break;
 
 	case MIPS_REVISION_SCON_SOCITSC:
 	case MIPS_REVISION_SCON_SOCITSCP:
 		if (cpu_has_veic)
-			init_msc_irqs(MIPS_SOCITSC_IC_REG_BASE, MSC01E_INT_BASE, msc_eicirqmap, msc_nr_eicirqs);
+			init_msc_irqs(MIPS_SOCITSC_IC_REG_BASE,
+					MSC01E_INT_BASE, msc_eicirqmap,
+					msc_nr_eicirqs);
 		else
-			init_msc_irqs(MIPS_SOCITSC_IC_REG_BASE, MSC01C_INT_BASE, msc_irqmap, msc_nr_irqs);
+			init_msc_irqs(MIPS_SOCITSC_IC_REG_BASE,
+					MSC01C_INT_BASE, msc_irqmap,
+					msc_nr_irqs);
 	}
 
 	if (cpu_has_veic) {
@@ -345,11 +353,13 @@ void __init arch_init_irq(void)
 		}
 #else /* Not SMTC */
 		setup_irq(MIPS_CPU_IRQ_BASE+MIPSCPU_INT_I8259A, &i8259irq);
-		setup_irq(MIPS_CPU_IRQ_BASE+MIPSCPU_INT_COREHI, &corehi_irqaction);
+		setup_irq(MIPS_CPU_IRQ_BASE+MIPSCPU_INT_COREHI,
+						&corehi_irqaction);
 #endif /* CONFIG_MIPS_MT_SMTC */
 	}
 	else {
 		setup_irq(MIPS_CPU_IRQ_BASE+MIPSCPU_INT_I8259A, &i8259irq);
-		setup_irq(MIPS_CPU_IRQ_BASE+MIPSCPU_INT_COREHI, &corehi_irqaction);
+		setup_irq(MIPS_CPU_IRQ_BASE+MIPSCPU_INT_COREHI,
+						&corehi_irqaction);
 	}
 }
Signature · 1 line
1.5.3
#13 lore raw

PATCH 13/17 Malta, Atlas: move an extern function declaration to the header file

In reply to Dmitri Vorobiev

This was compile-tested using default configs for the boards affected by this change.

This patch does not introduce any functional changes.

---
 arch/mips/mips-boards/atlas/atlas_setup.c |    4 ----
 arch/mips/mips-boards/malta/malta_setup.c |    4 ----
 include/asm-mips/mips-boards/generic.h    |    4 ++++
 3 files changed, 4 insertions(+), 8 deletions(-)
arch/mips/mips-boards/atlas/atlas_setup.c +0 -4
index 5ce8004..5c50080 100644
@@ -34,10 +34,6 @@
 #include <asm/time.h>
 #include <asm/traps.h>
 
-#ifdef CONFIG_KGDB
-extern void kgdb_config(void);
-#endif
-
 static void __init serial_init(void);
 
 const char *get_system_type(void)
arch/mips/mips-boards/malta/malta_setup.c +0 -4
index 3e2de0b..8dacb6a 100644
@@ -35,10 +35,6 @@
 #include <linux/console.h>
 #endif
 
-#ifdef CONFIG_KGDB
-extern void kgdb_config(void);
-#endif
-
 struct resource standard_io_resources[] = {
 	{
 		.name = "dma1",
include/asm-mips/mips-boards/generic.h +4 -0
index 2ca6bda..1c39d33 100644
@@ -105,4 +105,8 @@ extern void mips_pcibios_init(void);
 #define mips_pcibios_init() do { } while (0)
 #endif
 
+#ifdef CONFIG_KGDB
+extern void kgdb_config(void);
+#endif
+
 #endif  /* __ASM_MIPS_BOARDS_GENERIC_H */
Signature · 1 line
1.5.3
#16 lore raw

PATCH 16/17 Malta: remaining bits of the board support code cleanup

In reply to Dmitri Vorobiev

This patch factors out the code, which handles the Bonito system controller. The case of not supporting the DMA coherency is handled separately to make the logic obvious. Besides, a couple of empty lines added to beautify the code even further.

No functional changes introduced.

---
 arch/mips/mips-boards/malta/malta_setup.c |   80 +++++++++++++++--------------
 1 files changed, 42 insertions(+), 38 deletions(-)
arch/mips/mips-boards/malta/malta_setup.c +42 -38
index 541f4e7..2cd8f57 100644
@@ -1,6 +1,7 @@
 /*
  * Carsten Langgaard, [email protected]
  * Copyright (C) 2000 MIPS Technologies, Inc.  All rights reserved.
+ * Copyright (C) Dmitri Vorobiev
  *
  *  This program is free software; you can distribute it and/or modify it
  *  under the terms of the GNU General Public License (Version 2) as
@@ -145,6 +146,41 @@ static void __init screen_info_setup(void)
 }
 #endif
 
+static void __init bonito_quirks_setup(void)
+{
+	char *argptr;
+
+	argptr = prom_getcmdline();
+	if (strstr(argptr, "debug")) {
+		BONITO_BONGENCFG |= BONITO_BONGENCFG_DEBUGMODE;
+		printk(KERN_INFO "Enabled Bonito debug mode\n");
+	} else
+		BONITO_BONGENCFG &= ~BONITO_BONGENCFG_DEBUGMODE;
+
+#ifdef CONFIG_DMA_COHERENT
+	if (BONITO_PCICACHECTRL & BONITO_PCICACHECTRL_CPUCOH_PRES) {
+		BONITO_PCICACHECTRL |= BONITO_PCICACHECTRL_CPUCOH_EN;
+		printk(KERN_INFO "Enabled Bonito CPU coherency\n");
+
+		argptr = prom_getcmdline();
+		if (strstr(argptr, "iobcuncached")) {
+			BONITO_PCICACHECTRL &= ~BONITO_PCICACHECTRL_IOBCCOH_EN;
+			BONITO_PCIMEMBASECFG = BONITO_PCIMEMBASECFG &
+				~(BONITO_PCIMEMBASECFG_MEMBASE0_CACHED |
+					BONITO_PCIMEMBASECFG_MEMBASE1_CACHED);
+			printk(KERN_INFO "Disabled Bonito IOBC coherency\n");
+		} else {
+			BONITO_PCICACHECTRL |= BONITO_PCICACHECTRL_IOBCCOH_EN;
+			BONITO_PCIMEMBASECFG |=
+				(BONITO_PCIMEMBASECFG_MEMBASE0_CACHED |
+					BONITO_PCIMEMBASECFG_MEMBASE1_CACHED);
+			printk(KERN_INFO "Enabled Bonito IOBC coherency\n");
+		}
+	} else
+		panic("Hardware DMA cache coherency not supported");
+#endif
+}
+
 void __init plat_mem_setup(void)
 {
 	unsigned int i;
@@ -164,54 +200,22 @@ void __init plat_mem_setup(void)
 	kgdb_config();
 #endif
 
-	if (mips_revision_sconid == MIPS_REVISION_SCON_BONITO) {
-		char *argptr;
-
-		argptr = prom_getcmdline();
-		if (strstr(argptr, "debug")) {
-			BONITO_BONGENCFG |= BONITO_BONGENCFG_DEBUGMODE;
-			printk("Enabled Bonito debug mode\n");
-		}
-		else
-			BONITO_BONGENCFG &= ~BONITO_BONGENCFG_DEBUGMODE;
-
 #ifdef CONFIG_DMA_COHERENT
-		if (BONITO_PCICACHECTRL & BONITO_PCICACHECTRL_CPUCOH_PRES) {
-			BONITO_PCICACHECTRL |= BONITO_PCICACHECTRL_CPUCOH_EN;
-			printk("Enabled Bonito CPU coherency\n");
-
-			argptr = prom_getcmdline();
-			if (strstr(argptr, "iobcuncached")) {
-				BONITO_PCICACHECTRL &= ~BONITO_PCICACHECTRL_IOBCCOH_EN;
-				BONITO_PCIMEMBASECFG = BONITO_PCIMEMBASECFG &
-					~(BONITO_PCIMEMBASECFG_MEMBASE0_CACHED |
-					  BONITO_PCIMEMBASECFG_MEMBASE1_CACHED);
-				printk("Disabled Bonito IOBC coherency\n");
-			}
-			else {
-				BONITO_PCICACHECTRL |= BONITO_PCICACHECTRL_IOBCCOH_EN;
-				BONITO_PCIMEMBASECFG |=
-					(BONITO_PCIMEMBASECFG_MEMBASE0_CACHED |
-					 BONITO_PCIMEMBASECFG_MEMBASE1_CACHED);
-				printk("Enabled Bonito IOBC coherency\n");
-			}
-		}
-		else
-			panic("Hardware DMA cache coherency not supported");
-
-#endif
-	}
-#ifdef CONFIG_DMA_COHERENT
-	else
+	if (mips_revision_sconid != MIPS_REVISION_SCON_BONITO)
 		panic("Hardware DMA cache coherency not supported");
 #endif
 
+	if (mips_revision_sconid == MIPS_REVISION_SCON_BONITO)
+		bonito_quirks_setup();
+
 #ifdef CONFIG_BLK_DEV_IDE
 	pci_clock_check();
 #endif
+
 #ifdef CONFIG_BLK_DEV_FD
 	fd_activate();
 #endif
+
 #if defined(CONFIG_VT) && defined(CONFIG_VGA_CONSOLE)
 	screen_info_setup();
 #endif
Signature · 1 line
1.5.3
#15 lore raw

PATCH 15/17 Malta: make the helper function static

In reply to Dmitri Vorobiev

One helper function can become static. This patch adds the needed keyword.

No functional changes introduced.

---
 arch/mips/mips-boards/malta/malta_setup.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
arch/mips/mips-boards/malta/malta_setup.c +1 -1
index 8d62966..541f4e7 100644
@@ -80,7 +80,7 @@ const char display_string[] = "        LINUX ON MALTA       ";
 #endif /* CONFIG_MIPS_MT_SMTC */
 
 #ifdef CONFIG_BLK_DEV_FD
-void __init fd_activate(void)
+static void __init fd_activate(void)
 {
 	/*
 	 * Activate Floppy Controller in the SMSC FDC37M817 Super I/O
Signature · 1 line
1.5.3
#17 lore raw

PATCH 17/17 remove Documentation/mips/GT64120.README

In reply to Dmitri Vorobiev

Based upon the 2.4 kernel, the information presented in the Documentation/mips/GT64120.README file is outdated. Worse, the document contents are plain misleading nowadays because the text mentions files and directories, which have been deleted, moved or restructured for 2.6.

This patch removes the documentation, which is no more valid.

---
 Documentation/mips/00-INDEX       |    2 -
 Documentation/mips/GT64120.README |   65 -------------------------------------
 2 files changed, 0 insertions(+), 67 deletions(-)
 delete mode 100644 Documentation/mips/GT64120.README
Documentation/mips/00-INDEX +0 -2
index 3f13bf8..8ae9cff 100644
@@ -2,5 +2,3 @@
 	- this file.
 AU1xxx_IDE.README
 	- README for MIPS AU1XXX IDE driver.
-GT64120.README
-	- README for dir with info on MIPS boards using GT-64120 or GT-64120A.
Documentation/mips/GT64120.README deleted +0 -65

65 lines not on this page · raw message

Signature · 1 line
1.5.3
#14 lore raw

PATCH 14/17 Malta: fix braces at single statement blocks

In reply to Dmitri Vorobiev

This patch fixes a couple of warnings reported by checkpatch.pl.

No functional changes introduced.

---
 arch/mips/mips-boards/malta/malta_int.c   |    3 ++-
 arch/mips/mips-boards/malta/malta_setup.c |    3 +--
 2 files changed, 3 insertions(+), 3 deletions(-)
arch/mips/mips-boards/malta/malta_int.c +2 -1
index 92e6e2d..dbe60eb 100644
@@ -114,7 +114,8 @@ static void malta_hw0_irqdispatch(void)
 
 	irq = get_int();
 	if (irq < 0) {
-		return;  /* interrupt has already been cleared */
+		/* interrupt has already been cleared */
+		return;
 	}
 
 	do_IRQ(MALTA_INT_BASE + irq);
arch/mips/mips-boards/malta/malta_setup.c +1 -2
index 8dacb6a..8d62966 100644
@@ -202,9 +202,8 @@ void __init plat_mem_setup(void)
 #endif
 	}
 #ifdef CONFIG_DMA_COHERENT
-	else {
+	else
 		panic("Hardware DMA cache coherency not supported");
-	}
 #endif
 
 #ifdef CONFIG_BLK_DEV_IDE
Signature · 1 line
1.5.3
#10 lore raw

PATCH 10/17 Malta: remove a superfluous comment

In reply to Dmitri Vorobiev

Using the "We die here" comment right before calling the die() function is an extremely vivid example of overcommenting.

Remove the redundant comment and save one line.

No functional changes introduced.

---
 arch/mips/mips-boards/malta/malta_int.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)
arch/mips/mips-boards/malta/malta_int.c +0 -1
index 41eb232..a268912 100644
@@ -173,7 +173,6 @@ static void corehi_irqdispatch(void)
 		break;
 	}
 
-	/* We die here*/
 	die("CoreHi interrupt", regs);
 }
 
Signature · 1 line
1.5.3
#11 lore raw

PATCH 11/17 Malta: else should follow close brace in malta_int.c

In reply to Dmitri Vorobiev

This patch fixes two errors reported by checkpatch.pl.

No functional changes introduced.

---
 arch/mips/mips-boards/malta/malta_int.c |    6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)
arch/mips/mips-boards/malta/malta_int.c +2 -4
index a268912..2473a77 100644
@@ -329,8 +329,7 @@ void __init arch_init_irq(void)
 		set_vi_handler(MSC01E_INT_COREHI, corehi_irqdispatch);
 		setup_irq(MSC01E_INT_BASE+MSC01E_INT_I8259A, &i8259irq);
 		setup_irq(MSC01E_INT_BASE+MSC01E_INT_COREHI, &corehi_irqaction);
-	}
-	else if (cpu_has_vint) {
+	} else if (cpu_has_vint) {
 		set_vi_handler(MIPSCPU_INT_I8259A, malta_hw0_irqdispatch);
 		set_vi_handler(MIPSCPU_INT_COREHI, corehi_irqdispatch);
 #ifdef CONFIG_MIPS_MT_SMTC
@@ -355,8 +354,7 @@ void __init arch_init_irq(void)
 		setup_irq(MIPS_CPU_IRQ_BASE+MIPSCPU_INT_COREHI,
 						&corehi_irqaction);
 #endif /* CONFIG_MIPS_MT_SMTC */
-	}
-	else {
+	} else {
 		setup_irq(MIPS_CPU_IRQ_BASE+MIPSCPU_INT_I8259A, &i8259irq);
 		setup_irq(MIPS_CPU_IRQ_BASE+MIPSCPU_INT_COREHI,
 						&corehi_irqaction);
Signature · 1 line
1.5.3
#19 lore raw

Ralf Baechle пишет:

Quoted 3 lines · Dmitri Vorobiev

Whole series queued for 2.6.25.

OK, thanks.

Dmitri

Quoted 5 lines

Thanks,

Ralf