Skip to contentSkip to conversation

Enabling patches of 2 early consoles for Intel MID platforms

PATCH In review Feng Tang 6 participants 17 messages Sep 13, 2010 – Oct 8, 2010 x86

lore
Share & tools
lore

Feng Tang

author
#0 lore raw

v3 cover Enabling patches of 2 early consoles for Intel MID platforms

Hi all,

This serie mainly enables 2 early consoles named mrst and hsu for Intel MID platforms. please help to review, thanks,

- Feng

Changelog:
v3:
* Fix a warning for mrst.h
* Add 2 helper funcs for fixed address mapping as suggested by Ingo
* Rename the mrst_earlyprintk.c to early_printk_mrst.c
* Clean the code and fix typoes upon Ingo's comments
v2:
* Code clean as suggested by Ingo
----------------------------------------------------------------

Feng Tang (4):
x86, mrst: make mrst_identify_cpu() inlne inside mrst.h
x86: add two helper macros for fixed address mapping x86, earlyprintk: add earlyprintk for Intel Moorestown platform x86, earlyprintk: add hsu early console for Intel Medfield platform

 arch/x86/Kconfig.debug              |    4 +
 arch/x86/include/asm/fixmap.h       |   15 ++
 arch/x86/include/asm/mrst.h         |   10 +-
 arch/x86/kernel/Makefile            |    1 +
 arch/x86/kernel/early_printk.c      |   13 ++
 arch/x86/kernel/early_printk_mrst.c |  319 +++++++++++++++++++++++++++++++++++
 6 files changed, 361 insertions(+), 1 deletions(-)
 mode change 100644 => 100755 arch/x86/include/asm/fixmap.h
 create mode 100644 arch/x86/kernel/early_printk_mrst.c
author
#1 lore raw

PATCH v3 1/4 x86, mrst: make mrst_identify_cpu() inlne inside mrst.h

Otherwise there will be some compilation warning for those .c files which include mrst.h

---
 arch/x86/include/asm/mrst.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
arch/x86/include/asm/mrst.h +1 -1
index 1635074..33fc296 100644
@@ -26,7 +26,7 @@ enum mrst_cpu_type {
 };
 
 extern enum mrst_cpu_type __mrst_cpu_chip;
-static enum mrst_cpu_type mrst_identify_cpu(void)
+static inline enum mrst_cpu_type mrst_identify_cpu(void)
 {
 	return __mrst_cpu_chip;
 }
Signature · 1 line
1.7.0.4
#2 lore raw

Re: [PATCH v3 1/4] x86, mrst: make mrst_identify_cpu() inlne inside mrst.h

Quoted 2 lines · On Mon, 13 Sep 2010 15:08:53 +0800 Feng Tang <[email protected]> wrote:

Otherwise there will be some compilation warning for those .c files which include mrst.h

I've sent this to Ingo four or five times already and been ignored.

#3 lore raw

Re: [PATCH v3 1/4] x86, mrst: make mrst_identify_cpu() inlne inside mrst.h

Quoted 7 lines · Alan Cox
Quoted 2 lines · On Mon, 13 Sep 2010 15:08:53 +0800 Feng Tang <[email protected]> wrote:

Otherwise there will be some compilation warning for those .c files which include mrst.h

I've sent this to Ingo four or five times already and been ignored.

I did a search of my mbox for all mails containing 'mrst_identify_cpu', and the one by Feng Tang sent yesterday is the only one - none from you. Searched the spam folder and the separate lkml folder too.

So where are those 4-5 emails, got any link perhaps?

Thanks,

Ingo

#4 lore raw

Re: [PATCH v3 1/4] x86, mrst: make mrst_identify_cpu() inlne inside mrst.h

Quoted 9 lines · On Tue, 14 Sep 2010 19:57:26 +0200 Ingo Molnar <[email protected]> wrote:
Quoted 6 lines · Alan Cox
Quoted 2 lines · On Mon, 13 Sep 2010 15:08:53 +0800 Feng Tang <[email protected]> wrote:

Otherwise there will be some compilation warning for those .c files which include mrst.h

Quoted 7 lines
Quoted 1 line

I've sent this to Ingo four or five times already and been ignored.

I did a search of my mbox for all mails containing 'mrst_identify_cpu', and the one by Feng Tang sent yesterday is the only one - none from you. Searched the spam folder and the separate lkml folder too.

So where are those 4-5 emails, got any link perhaps?

They went to your address and my logs show they hit Intel internally but I can't really see beyond that - I've mailed you directly a different email to try and work out where they vanished so if you see this and no direct mail then that would explain much. If you see both but didn't see the mail recently about SFI device creation from me then it's specific to the stgit setup sent emails.

Alan

#5 lore raw

Re: [PATCH v3 1/4] x86, mrst: make mrst_identify_cpu() inlne inside mrst.h

Quoted 19 lines · Alan Cox
Quoted 16 lines · On Tue, 14 Sep 2010 19:57:26 +0200 Ingo Molnar <[email protected]> wrote:
Quoted 7 lines · Alan Cox
Quoted 2 lines · On Mon, 13 Sep 2010 15:08:53 +0800 Feng Tang <[email protected]> wrote:

Otherwise there will be some compilation warning for those .c files which include mrst.h

I've sent this to Ingo four or five times already and been ignored.

I did a search of my mbox for all mails containing 'mrst_identify_cpu', and the one by Feng Tang sent yesterday is the only one - none from you. Searched the spam folder and the separate lkml folder too.

Quoted 8 lines
Quoted 1 line

So where are those 4-5 emails, got any link perhaps?

They went to your address and my logs show they hit Intel internally but I can't really see beyond that - I've mailed you directly a different email to try and work out where they vanished so if you see this and no direct mail then that would explain much. If you see both but didn't see the mail recently about SFI device creation from me then it's specific to the stgit setup sent emails.

I think there must be an email problem somewhere. I did get the:

[RFC PATCH] x86/mrst: add SFI platform device parsing code

mail and the earlyprintk mails - but before that the only patch i got from you was:

[PATCH] IPC driver for Intel Mobile Internet Device (MID) platforms

back in April ... i.e. nothing for many months.

Thanks,

Ingo

author
#6 lore raw

PATCH v3 2/4 x86: add two helper macros for fixed address mapping

In reply to Feng Tang

Sometimes fixmap will be used to map an physical address which is not PAGE align, so to use it we need first map it and then add the address offset to the mapped fixed address. These 2 new helpers are suggested by Ingo Molnar to make the process simpler.

For a physicall address like "phys", a directly usable virtual address can be get by

	virt = (void *)set_fixmap_offset(fixed_idx, phys);
or
	virt = (void *)set_fixmap_offset_nocache(fixed_idx, phys);

(depends on whether the physical address is cachable or not).

---
 arch/x86/include/asm/fixmap.h |   15 +++++++++++++++
 1 files changed, 15 insertions(+), 0 deletions(-)
 mode change 100644 => 100755 arch/x86/include/asm/fixmap.h
arch/x86/include/asm/fixmap.h +15 -0
old mode 100644
new mode 100755
index d07b44f..4d293dc
@@ -214,5 +214,20 @@ static inline unsigned long virt_to_fix(const unsigned long vaddr)
 	BUG_ON(vaddr >= FIXADDR_TOP || vaddr < FIXADDR_START);
 	return __virt_to_fix(vaddr);
 }
+
+/* Return an pointer with offset calculated */
+static inline unsigned long __set_fixmap_offset(enum fixed_addresses idx,
+				phys_addr_t phys, pgprot_t flags)
+{
+	__set_fixmap(idx, phys, flags);
+	return fix_to_virt(idx) + (phys & (PAGE_SIZE - 1));
+}
+
+#define set_fixmap_offset(idx, phys)			\
+	__set_fixmap_offset(idx, phys, PAGE_KERNEL)
+
+#define set_fixmap_offset_nocache(idx, phys)			\
+	__set_fixmap_offset(idx, phys, PAGE_KERNEL_NOCACHE)
+
 #endif /* !__ASSEMBLY__ */
 #endif /* _ASM_X86_FIXMAP_H */
Signature · 1 line
1.7.0.4
#7 lore raw

[tip:x86/mrst] x86: Add two helper macros for fixed address mapping

Commit-ID:  5a47c7dae861c3ca3edf178546641909851bf715
Gitweb:     http://git.kernel.org/tip/5a47c7dae861c3ca3edf178546641909851bf715
Author:     Feng Tang <[email protected]>
AuthorDate: Mon, 13 Sep 2010 15:08:54 +0800
Committer:  Ingo Molnar <[email protected]>
CommitDate: Fri, 8 Oct 2010 10:01:46 +0200

x86: Add two helper macros for fixed address mapping

Sometimes fixmap will be used to map an physical address which is not PAGE align, so to use it we need first map it and then add the address offset to the mapped fixed address. These 2 new helpers are suggested by Ingo Molnar to make the process simpler.

For a physicall address like "phys", a directly usable virtual address can be get by

	virt = (void *)set_fixmap_offset(fixed_idx, phys);
or
	virt = (void *)set_fixmap_offset_nocache(fixed_idx, phys);

(depends on whether the physical address is cachable or not).

LKML-Reference: <[email protected]>

---
 arch/x86/include/asm/fixmap.h |   15 +++++++++++++++
 1 files changed, 15 insertions(+), 0 deletions(-)
arch/x86/include/asm/fixmap.h +15 -0
index d07b44f..4d293dc 100644
@@ -214,5 +214,20 @@ static inline unsigned long virt_to_fix(const unsigned long vaddr)
 	BUG_ON(vaddr >= FIXADDR_TOP || vaddr < FIXADDR_START);
 	return __virt_to_fix(vaddr);
 }
+
+/* Return an pointer with offset calculated */
+static inline unsigned long __set_fixmap_offset(enum fixed_addresses idx,
+				phys_addr_t phys, pgprot_t flags)
+{
+	__set_fixmap(idx, phys, flags);
+	return fix_to_virt(idx) + (phys & (PAGE_SIZE - 1));
+}
+
+#define set_fixmap_offset(idx, phys)			\
+	__set_fixmap_offset(idx, phys, PAGE_KERNEL)
+
+#define set_fixmap_offset_nocache(idx, phys)			\
+	__set_fixmap_offset(idx, phys, PAGE_KERNEL_NOCACHE)
+
 #endif /* !__ASSEMBLY__ */
 #endif /* _ASM_X86_FIXMAP_H */
author
#8 lore raw

PATCH v3 3/4 x86, earlyprintk: add earlyprintk for Intel Moorestown platform

In reply to Feng Tang

Intel Moorestown platform has a spi-uart device(Maxim3110), which connects to a Designware spi core controller. This patch will add early console function based on it.

As it will be used long before Linux spi subsystem get initialised, we simply directly manipulate the spi controller's register to acheive the early console func. This is safe as it will be disabled when devices subsytem get initialised.

To use it, user need enable CONFIG_X86_MRST_EARLY_PRINTK in kenrel config and add "earlyprintk=mrst" in kernel command line.

---
 arch/x86/Kconfig.debug              |    4 +
 arch/x86/include/asm/mrst.h         |    5 +
 arch/x86/kernel/Makefile            |    1 +
 arch/x86/kernel/early_printk.c      |    7 +
 arch/x86/kernel/early_printk_mrst.c |  232 +++++++++++++++++++++++++++++++++++
 5 files changed, 249 insertions(+), 0 deletions(-)
 create mode 100644 arch/x86/kernel/early_printk_mrst.c
arch/x86/Kconfig.debug +4 -0
index 7508508..e5bb96b 100644
@@ -43,6 +43,10 @@ config EARLY_PRINTK
 	  with klogd/syslogd or the X server. You should normally N here,
 	  unless you want to debug such a crash.
 
+config EARLY_PRINTK_MRST
+	bool "Early printk for MRST platform support"
+	depends on EARLY_PRINTK && X86_MRST
+
 config EARLY_PRINTK_DBGP
 	bool "Early printk via EHCI debug port"
 	depends on EARLY_PRINTK && PCI
arch/x86/include/asm/mrst.h +5 -0
index 33fc296..d0ea5bc 100644
@@ -10,6 +10,9 @@
  */
 #ifndef _ASM_X86_MRST_H
 #define _ASM_X86_MRST_H
+
+#include <linux/sfi.h>
+
 extern int pci_mrst_init(void);
 int __init sfi_parse_mrtc(struct sfi_table_header *table);
 
@@ -42,4 +45,6 @@ extern enum mrst_timer_options mrst_timer_options;
 #define SFI_MTMR_MAX_NUM 8
 #define SFI_MRTC_MAX	8
 
+extern struct console early_mrst_console;
+extern void mrst_early_console_init(void);
 #endif /* _ASM_X86_MRST_H */
arch/x86/kernel/Makefile +1 -0
index 0925676..4024754 100644
@@ -83,6 +83,7 @@ obj-$(CONFIG_DOUBLEFAULT) 	+= doublefault_32.o
 obj-$(CONFIG_KGDB)		+= kgdb.o
 obj-$(CONFIG_VM86)		+= vm86_32.o
 obj-$(CONFIG_EARLY_PRINTK)	+= early_printk.o
+obj-$(CONFIG_EARLY_PRINTK_MRST)	+= early_printk_mrst.o
 
 obj-$(CONFIG_HPET_TIMER) 	+= hpet.o
 obj-$(CONFIG_APB_TIMER)		+= apb_timer.o
arch/x86/kernel/early_printk.c +7 -0
index fa99bae..6082463 100644
@@ -14,6 +14,7 @@
 #include <xen/hvc-console.h>
 #include <asm/pci-direct.h>
 #include <asm/fixmap.h>
+#include <asm/mrst.h>
 #include <asm/pgtable.h>
 #include <linux/usb/ehci_def.h>
 
@@ -239,6 +240,12 @@ static int __init setup_early_printk(char *buf)
 		if (!strncmp(buf, "xen", 3))
 			early_console_register(&xenboot_console, keep);
 #endif
+#ifdef CONFIG_X86_MRST_EARLY_PRINTK
+		if (!strncmp(buf, "mrst", 4)) {
+			mrst_early_console_init();
+			early_console_register(&early_mrst_console, keep);
+		}
+#endif
 		buf++;
 	}
 	return 0;
arch/x86/kernel/early_printk_mrst.c new file +232 -0

232 lines not on this page · raw message

Signature · 1 line
1.7.0.4
#9 lore raw

[tip:x86/mrst] x86, earlyprintk: Add earlyprintk for Intel Moorestown platform

Commit-ID:  c20b5c3318fe45e4f33f01a91ccead645dfdf619
Gitweb:     http://git.kernel.org/tip/c20b5c3318fe45e4f33f01a91ccead645dfdf619
Author:     Feng Tang <[email protected]>
AuthorDate: Mon, 13 Sep 2010 15:08:55 +0800
Committer:  Ingo Molnar <[email protected]>
CommitDate: Fri, 8 Oct 2010 10:01:47 +0200

x86, earlyprintk: Add earlyprintk for Intel Moorestown platform

Intel Moorestown platform has a spi-uart device(Maxim3110), which connects to a Designware spi core controller. This patch will add early console function based on it.

As it will be used long before Linux spi subsystem get initialised, we simply directly manipulate the spi controller's register to acheive the early console func. This is safe as it will be disabled when devices subsytem get initialised.

To use it, user need enable CONFIG_X86_MRST_EARLY_PRINTK in kenrel config and add "earlyprintk=mrst" in kernel command line.

LKML-Reference: <[email protected]>

---
 arch/x86/Kconfig.debug              |    4 +
 arch/x86/include/asm/mrst.h         |    5 +
 arch/x86/kernel/Makefile            |    1 +
 arch/x86/kernel/early_printk.c      |    7 +
 arch/x86/kernel/early_printk_mrst.c |  232 +++++++++++++++++++++++++++++++++++
 5 files changed, 249 insertions(+), 0 deletions(-)
arch/x86/Kconfig.debug +4 -0
index 7508508..e5bb96b 100644
@@ -43,6 +43,10 @@ config EARLY_PRINTK
 	  with klogd/syslogd or the X server. You should normally N here,
 	  unless you want to debug such a crash.
 
+config EARLY_PRINTK_MRST
+	bool "Early printk for MRST platform support"
+	depends on EARLY_PRINTK && X86_MRST
+
 config EARLY_PRINTK_DBGP
 	bool "Early printk via EHCI debug port"
 	depends on EARLY_PRINTK && PCI
arch/x86/include/asm/mrst.h +5 -0
index 33fc296..d0ea5bc 100644
@@ -10,6 +10,9 @@
  */
 #ifndef _ASM_X86_MRST_H
 #define _ASM_X86_MRST_H
+
+#include <linux/sfi.h>
+
 extern int pci_mrst_init(void);
 int __init sfi_parse_mrtc(struct sfi_table_header *table);
 
@@ -42,4 +45,6 @@ extern enum mrst_timer_options mrst_timer_options;
 #define SFI_MTMR_MAX_NUM 8
 #define SFI_MRTC_MAX	8
 
+extern struct console early_mrst_console;
+extern void mrst_early_console_init(void);
 #endif /* _ASM_X86_MRST_H */
arch/x86/kernel/Makefile +1 -0
index fedf32a..3cd01d0 100644
@@ -85,6 +85,7 @@ obj-$(CONFIG_DOUBLEFAULT) 	+= doublefault_32.o
 obj-$(CONFIG_KGDB)		+= kgdb.o
 obj-$(CONFIG_VM86)		+= vm86_32.o
 obj-$(CONFIG_EARLY_PRINTK)	+= early_printk.o
+obj-$(CONFIG_EARLY_PRINTK_MRST)	+= early_printk_mrst.o
 
 obj-$(CONFIG_HPET_TIMER) 	+= hpet.o
 obj-$(CONFIG_APB_TIMER)		+= apb_timer.o
arch/x86/kernel/early_printk.c +7 -0
index fa99bae..6082463 100644
@@ -14,6 +14,7 @@
 #include <xen/hvc-console.h>
 #include <asm/pci-direct.h>
 #include <asm/fixmap.h>
+#include <asm/mrst.h>
 #include <asm/pgtable.h>
 #include <linux/usb/ehci_def.h>
 
@@ -239,6 +240,12 @@ static int __init setup_early_printk(char *buf)
 		if (!strncmp(buf, "xen", 3))
 			early_console_register(&xenboot_console, keep);
 #endif
+#ifdef CONFIG_X86_MRST_EARLY_PRINTK
+		if (!strncmp(buf, "mrst", 4)) {
+			mrst_early_console_init();
+			early_console_register(&early_mrst_console, keep);
+		}
+#endif
 		buf++;
 	}
 	return 0;
arch/x86/kernel/early_printk_mrst.c new file +232 -0

232 lines not on this page · raw message

author
#10 lore raw

PATCH v3 4/4 x86, earlyprintk: add hsu early console for Intel Medfield platform

In reply to Feng Tang

Intel Medfield platform has a high speed UART device, which could act as a early console. To enable early printk of HSU console, simply add "earlyprintk=hsu" in kernel command line.

Currently we put the code in the early_printk_mrst.c as it is also for Intel MID platforms like the mrst early console

---
 arch/x86/include/asm/mrst.h         |    3 +
 arch/x86/kernel/early_printk.c      |    6 ++
 arch/x86/kernel/early_printk_mrst.c |   89 ++++++++++++++++++++++++++++++++++-
 3 files changed, 97 insertions(+), 1 deletions(-)
arch/x86/include/asm/mrst.h +3 -0
index d0ea5bc..4a711a6 100644
@@ -47,4 +47,7 @@ extern enum mrst_timer_options mrst_timer_options;
 
 extern struct console early_mrst_console;
 extern void mrst_early_console_init(void);
+
+extern struct console early_hsu_console;
+extern void hsu_early_console_init(void);
 #endif /* _ASM_X86_MRST_H */
arch/x86/kernel/early_printk.c +6 -0
index 6082463..4572f25 100644
@@ -245,6 +245,12 @@ static int __init setup_early_printk(char *buf)
 			mrst_early_console_init();
 			early_console_register(&early_mrst_console, keep);
 		}
+
+		if (!strncmp(buf, "hsu", 3)) {
+			hsu_early_console_init();
+			early_console_register(&early_hsu_console, keep);
+		}
+
 #endif
 		buf++;
 	}
arch/x86/kernel/early_printk_mrst.c +88 -1

105 lines not on this page · raw message

Signature · 1 line
1.7.0.4
#11 lore raw

Re: [PATCH v3 4/4] x86, earlyprintk: add hsu early console for Intel Medfield platform

Quoted 77 lines · Feng Tang

Intel Medfield platform has a high speed UART device, which could act as a early console. To enable early printk of HSU console, simply add "earlyprintk=hsu" in kernel command line.

Currently we put the code in the early_printk_mrst.c as it is also for Intel MID platforms like the mrst early console

---
 arch/x86/include/asm/mrst.h         |    3 +
 arch/x86/kernel/early_printk.c      |    6 ++
 arch/x86/kernel/early_printk_mrst.c |   89 ++++++++++++++++++++++++++++++++++-
 3 files changed, 97 insertions(+), 1 deletions(-)
arch/x86/include/asm/mrst.h +3 -0
index d0ea5bc..4a711a6 100644
@@ -47,4 +47,7 @@ extern enum mrst_timer_options mrst_timer_options;
 
 extern struct console early_mrst_console;
 extern void mrst_early_console_init(void);
+
+extern struct console early_hsu_console;
+extern void hsu_early_console_init(void);
 #endif /* _ASM_X86_MRST_H */
arch/x86/kernel/early_printk.c +6 -0
index 6082463..4572f25 100644
@@ -245,6 +245,12 @@ static int __init setup_early_printk(char *buf)
 			mrst_early_console_init();
 			early_console_register(&early_mrst_console, keep);
 		}
+
+		if (!strncmp(buf, "hsu", 3)) {
+			hsu_early_console_init();
+			early_console_register(&early_hsu_console, keep);
+		}
+
 #endif
 		buf++;
 	}
arch/x86/kernel/early_printk_mrst.c +11 -1
index 05d27e1..65df603 100644
@@ -1,5 +1,5 @@
 /*
- * early_printk_mrst.c - spi-uart early printk for Intel Moorestown platform
+ * early_printk_mrst.c - early consoles for Intel MID platforms
  *
  * Copyright (c) 2008-2010, Intel Corporation
  *
@@ -9,9 +9,19 @@
  * of the License.
  */
 
+/*
+ * This file implements two early consoles named mrst and hsu.
+ * mrst is based on Maxim3110 spi-uart device, it exists in both
+ * Moorestown and Medfield platforms, while hsu is based on a High
+ * Speed UART device which only exists in the Medfield platform
+ */
+
+#include <linux/serial_reg.h>
+#include <linux/serial_mfd.h>
 #include <linux/kmsg_dump.h>
 #include <linux/console.h>
 #include <linux/kernel.h>
+#include <linux/delay.h>
 #include <linux/init.h>
 #include <linux/io.h>
 

arch/x86/kernel/early_printk_mrst.c struct console early_mrst_console = { · line 246

Quoted 7 lines
arch/x86/kernel/early_printk_mrst.c +4 -0
@@ -230,3 +240,80 @@ struct console early_mrst_console = {
 	.flags =	CON_PRINTBUFFER,
 	.index =	-1,
 };
+
+/*
+ * Following is the early console based on Medfield HSU (High
+ * Speed UART) device.

Is there a link to a PDF of the device in question?

arch/x86/kernel/early_printk_mrst.c struct console early_mrst_console = { · line 248

Quoted 2 lines
arch/x86/kernel/early_printk_mrst.c +2 -0
+ */
+#define HSU_PORT2_PADDR		0xffa28180

Is it _always_ that address?

arch/x86/kernel/early_printk_mrst.c struct console early_mrst_console = { · line 260

Quoted 12 lines
arch/x86/kernel/early_printk_mrst.c +12 -0
+
+static void __iomem *phsu;
+
+void hsu_early_console_init(void)
+{
+	u8 lcr;
+
+	phsu = (void *)set_fixmap_offset_nocache(FIX_EARLYCON_MEM_BASE,
+							HSU_PORT2_PADDR);
+
+	/* Disable FIFO */
+	writeb(0x0, phsu + UART_FCR);

No detection? What happens if you don't have the device (say in production it gets removed) and we try to use earlyprintk=hsu? Won't we have some trouble?

arch/x86/kernel/early_printk_mrst.c struct console early_mrst_console = { · line 262

Quoted 2 lines
arch/x86/kernel/early_printk_mrst.c +2 -0
+
+	/* Set to default 115200 bps, 8n1 */

Is that OK? Should there be some parsing of the baudrate data?

Quoted 5 lines
arch/x86/kernel/early_printk_mrst.c +5 -0
+	lcr = readb(phsu + UART_LCR);
+	writeb((0x80 | lcr), phsu + UART_LCR);
+	writeb(0x18, phsu + UART_DLL);
+	writeb(lcr,  phsu + UART_LCR);
+	writel(0x3600, phsu + UART_MUL*4);
#12 lore raw

Re: [PATCH v3 4/4] x86, earlyprintk: add hsu early console for Intel Medfield platform

Quoted 1 line

Is there a link to a PDF of the device in question?

Not that I know of at least so far.

Quoted 4 lines
Quoted 2 lines

+ */
+#define HSU_PORT2_PADDR 0xffa28180

Is it _always_ that address?

Yes.

Quoted 9 lines
Quoted 9 lines
arch/x86/kernel/early_printk_mrst.c +8 -0
+
+static void __iomem *phsu;
+
+void hsu_early_console_init(void)
+{
+	u8 lcr;
+
+	phsu = (void

*)set_fixmap_offset_nocache(FIX_EARLYCON_MEM_BASE,

Quoted 8 lines

arch/x86/kernel/early_printk_mrst.c struct console early_mrst_console = { · line 260

Quoted 4 lines

+
HSU_PORT2_PADDR); +

arch/x86/kernel/early_printk_mrst.c +2 -0
+	/* Disable FIFO */
+	writeb(0x0, phsu + UART_FCR);

No detection? What happens if you don't have the device (say in production it gets removed) and we try to use earlyprintk=hsu? Won't we have some trouble?

Same as if you try and use the other serial console drivers that way. It's a bit tricky to do much about because to be sure you've got this stuff you need to have done a whole ton of work which then makes the early console pointless.

Quoted 5 lines

Review

Quoted 3 lines
(quoted diff) +2 -0
+
+	/* Set to default 115200 bps, 8n1 */

Is that OK? Should there be some parsing of the baudrate data?

For a serial console yes - for an early console robustness is everything, and its an embedded development environment so fixed configuration really isn't a problem.

#13 lore raw

[tip:x86/mrst] x86, earlyprintk: Add hsu early console for Intel Medfield platform

In reply to Feng Tang
Commit-ID:  4d033556f1bfaa7604b951bfadd17aaf1b74e4c5
Gitweb:     http://git.kernel.org/tip/4d033556f1bfaa7604b951bfadd17aaf1b74e4c5
Author:     Feng Tang <[email protected]>
AuthorDate: Mon, 13 Sep 2010 15:08:56 +0800
Committer:  Ingo Molnar <[email protected]>
CommitDate: Fri, 8 Oct 2010 10:01:47 +0200

x86, earlyprintk: Add hsu early console for Intel Medfield platform

Intel Medfield platform has a high speed UART device, which could act as a early console. To enable early printk of HSU console, simply add "earlyprintk=hsu" in kernel command line.

Currently we put the code in the early_printk_mrst.c as it is also for Intel MID platforms like the mrst early console

LKML-Reference: <[email protected]>

---
 arch/x86/include/asm/mrst.h         |    3 +
 arch/x86/kernel/early_printk.c      |    6 ++
 arch/x86/kernel/early_printk_mrst.c |   89 ++++++++++++++++++++++++++++++++++-
 3 files changed, 97 insertions(+), 1 deletions(-)
arch/x86/include/asm/mrst.h +3 -0
index d0ea5bc..4a711a6 100644
@@ -47,4 +47,7 @@ extern enum mrst_timer_options mrst_timer_options;
 
 extern struct console early_mrst_console;
 extern void mrst_early_console_init(void);
+
+extern struct console early_hsu_console;
+extern void hsu_early_console_init(void);
 #endif /* _ASM_X86_MRST_H */
arch/x86/kernel/early_printk.c +6 -0
index 6082463..4572f25 100644
@@ -245,6 +245,12 @@ static int __init setup_early_printk(char *buf)
 			mrst_early_console_init();
 			early_console_register(&early_mrst_console, keep);
 		}
+
+		if (!strncmp(buf, "hsu", 3)) {
+			hsu_early_console_init();
+			early_console_register(&early_hsu_console, keep);
+		}
+
 #endif
 		buf++;
 	}
arch/x86/kernel/early_printk_mrst.c +88 -1

105 lines not on this page · raw message

#14 lore raw
In reply to Feng Tang
Quoted 7 lines · Feng Tang

Hi all,

This serie mainly enables 2 early consoles named mrst and hsu for Intel MID platforms. please help to review, thanks,

- Feng

Quoted 9 lines

Changelog:
v3:
* Fix a warning for mrst.h
* Add 2 helper funcs for fixed address mapping as suggested by Ingo
* Rename the mrst_earlyprintk.c to early_printk_mrst.c
* Clean the code and fix typoes upon Ingo's comments
v2:
* Code clean as suggested by Ingo

Thanks, this series looks really good!

Quoted 6 lines

Feng Tang (4):
x86, mrst: make mrst_identify_cpu() inlne inside mrst.h
x86: add two helper macros for fixed address mapping x86, earlyprintk: add earlyprintk for Intel Moorestown platform x86, earlyprintk: add hsu early console for Intel Medfield platform

Quoted 9 lines
 arch/x86/Kconfig.debug              |    4 +
 arch/x86/include/asm/fixmap.h       |   15 ++
 arch/x86/include/asm/mrst.h         |   10 +-
 arch/x86/kernel/Makefile            |    1 +
 arch/x86/kernel/early_printk.c      |   13 ++
 arch/x86/kernel/early_printk_mrst.c |  319 +++++++++++++++++++++++++++++++++++
 6 files changed, 361 insertions(+), 1 deletions(-)
 mode change 100644 => 100755 arch/x86/include/asm/fixmap.h
 create mode 100644 arch/x86/kernel/early_printk_mrst.c

Wrt. integration: i'd prefer to carry these four patches in the tip:x86/early-printk tree (to be merged into v2.6.37), because there's some interaction with other x86 bits.

AFAICS the two serial patches:

[PATCH 1/2] serial: mrst_max3110: some code cleanup [PATCH 2/2] mrst_max3110: Make the IRQ option runtime

Are structurally independent from the earlyprintk patches and could be carried separately in the serial tree.

Alan, Greg, what's your preference?

Thanks,

Ingo

#15 lore raw
Quoted 38 lines · Ingo Molnar
Quoted 7 lines · Feng Tang

Hi all,

This serie mainly enables 2 early consoles named mrst and hsu for Intel MID platforms. please help to review, thanks,

- Feng

Quoted 9 lines

Changelog:
v3:
* Fix a warning for mrst.h
* Add 2 helper funcs for fixed address mapping as suggested by Ingo
* Rename the mrst_earlyprintk.c to early_printk_mrst.c
* Clean the code and fix typoes upon Ingo's comments
v2:
* Code clean as suggested by Ingo

Thanks, this series looks really good!

Quoted 6 lines

Feng Tang (4):
x86, mrst: make mrst_identify_cpu() inlne inside mrst.h
x86: add two helper macros for fixed address mapping x86, earlyprintk: add earlyprintk for Intel Moorestown platform x86, earlyprintk: add hsu early console for Intel Medfield platform

Quoted 9 lines
 arch/x86/Kconfig.debug              |    4 +
 arch/x86/include/asm/fixmap.h       |   15 ++
 arch/x86/include/asm/mrst.h         |   10 +-
 arch/x86/kernel/Makefile            |    1 +
 arch/x86/kernel/early_printk.c      |   13 ++
 arch/x86/kernel/early_printk_mrst.c |  319 +++++++++++++++++++++++++++++++++++
 6 files changed, 361 insertions(+), 1 deletions(-)
 mode change 100644 => 100755 arch/x86/include/asm/fixmap.h
 create mode 100644 arch/x86/kernel/early_printk_mrst.c
Quoted 3 lines

Wrt. integration: i'd prefer to carry these four patches in the tip:x86/early-printk tree (to be merged into v2.6.37), because there's some interaction with other x86 bits.

No objection from me.

Quoted 9 lines

AFAICS the two serial patches:

[PATCH 1/2] serial: mrst_max3110: some code cleanup [PATCH 2/2] mrst_max3110: Make the IRQ option runtime

Are structurally independent from the earlyprintk patches and could be carried separately in the serial tree.

Alan, Greg, what's your preference?

I can carry these in the tty tree fine. They don't depend on the x86 patches, right?

thanks,

greg k-h

#16 lore raw
Quoted 50 lines · Greg KH
Quoted 38 lines · Ingo Molnar
Quoted 7 lines · Feng Tang

Hi all,

This serie mainly enables 2 early consoles named mrst and hsu for Intel MID platforms. please help to review, thanks,

- Feng

Quoted 9 lines

Changelog:
v3:
* Fix a warning for mrst.h
* Add 2 helper funcs for fixed address mapping as suggested by Ingo
* Rename the mrst_earlyprintk.c to early_printk_mrst.c
* Clean the code and fix typoes upon Ingo's comments
v2:
* Code clean as suggested by Ingo

Thanks, this series looks really good!

Quoted 6 lines

Feng Tang (4):
x86, mrst: make mrst_identify_cpu() inlne inside mrst.h
x86: add two helper macros for fixed address mapping x86, earlyprintk: add earlyprintk for Intel Moorestown platform x86, earlyprintk: add hsu early console for Intel Medfield platform

Quoted 9 lines
 arch/x86/Kconfig.debug              |    4 +
 arch/x86/include/asm/fixmap.h       |   15 ++
 arch/x86/include/asm/mrst.h         |   10 +-
 arch/x86/kernel/Makefile            |    1 +
 arch/x86/kernel/early_printk.c      |   13 ++
 arch/x86/kernel/early_printk_mrst.c |  319 +++++++++++++++++++++++++++++++++++
 6 files changed, 361 insertions(+), 1 deletions(-)
 mode change 100644 => 100755 arch/x86/include/asm/fixmap.h
 create mode 100644 arch/x86/kernel/early_printk_mrst.c
Quoted 3 lines

Wrt. integration: i'd prefer to carry these four patches in the tip:x86/early-printk tree (to be merged into v2.6.37), because there's some interaction with other x86 bits.

No objection from me.

Quoted 5 lines

AFAICS the two serial patches:

[PATCH 1/2] serial: mrst_max3110: some code cleanup [PATCH 2/2] mrst_max3110: Make the IRQ option runtime

Quoted 7 lines
Quoted 4 lines

Are structurally independent from the earlyprintk patches and could be carried separately in the serial tree.

Alan, Greg, what's your preference?

I can carry these in the tty tree fine. They don't depend on the x86 patches, right?

Yeah, as far as i've checked they dont. (havent actually tested that tho)

Thanks,

Ingo