Skip to contentSkip to conversation

OMAP1: AMS_DELTA: add modem support

PATCH In review Janusz Krzysztofik 3 participants 5 messages Jul 6, 2009 – Aug 10, 2009

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH v3 1/1 OMAP1: AMS_DELTA: add modem support

This patch adds support for modem device found on Amstrad E3 (Delta) board.

Based on earlier patch by Jonathan McDowell, available at
http://the.earth.li/pub/e3/2.6.19/ams-delta-modem.patch.
Modified after Ladislav Michl's arch/arm/mach-omap1/board-voiceblue.c.

This version, unlike v2, is dependent on 8250 driver changes getting accepted upstream:
Refer: http://patchwork.kernel.org/patch/31884/

---
Registering the modem platform device from a separate arch_initcall (and not from init_machine() callback) preserves serial console port at ttyS0.

OMAP mux pin set up just for case if Amstrad bootloader is ever replaced.

Warning:
could cause compilation break if 8250 patch is not integrated first

arch/arm/mach-omap1/board-ams-delta.c renamed from arch/arm/mach-omap1/board-ams-delta.c.orig +38 -0
@@ -15,8 +15,11 @@
 #include <linux/kernel.h>
 #include <linux/init.h>
 #include <linux/input.h>
+#include <linux/interrupt.h>
 #include <linux/platform_device.h>
+#include <linux/serial_8250.h>
 
+#include <asm/serial.h>
 #include <mach/hardware.h>
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
@@ -235,6 +238,41 @@ static void __init ams_delta_init(void)
 	platform_add_devices(ams_delta_devices, ARRAY_SIZE(ams_delta_devices));
 }
 
+static struct plat_serial8250_port ams_delta_modem_ports[] = {
+	{
+		.membase	= (void *) AMS_DELTA_MODEM_VIRT,
+		.mapbase	= AMS_DELTA_MODEM_PHYS,
+		.irq		= -EINVAL, /* changed later */
+		.flags		= UPF_BOOT_AUTOCONF,
+		.irqflags	= IRQF_TRIGGER_RISING,
+		.iotype		= UPIO_MEM,
+		.regshift	= 1,
+		.uartclk	= BASE_BAUD * 16,
+	},
+	{ },
+};
+
+static struct platform_device ams_delta_modem_device = {
+	.name	= "serial8250",
+	.id	= PLAT8250_DEV_PLATFORM1,
+	.dev		= {
+		.platform_data = ams_delta_modem_ports,
+	},
+};
+
+static int __init ams_delta_modem_init(void)
+{
+	omap_cfg_reg(M14_1510_GPIO2);
+	ams_delta_modem_ports[0].irq = gpio_to_irq(2);
+
+	ams_delta_latch2_write(
+		AMS_DELTA_LATCH2_MODEM_NRESET | AMS_DELTA_LATCH2_MODEM_CODEC,
+		AMS_DELTA_LATCH2_MODEM_NRESET | AMS_DELTA_LATCH2_MODEM_CODEC);
+
+	return platform_device_register(&ams_delta_modem_device);
+}
+arch_initcall(ams_delta_modem_init);
+
 static void __init ams_delta_map_io(void)
 {
 	omap1_map_common_io();
#1 lore raw

Jonathan, Tony,

Any chance for this patch ready for 2.6.32 inclusion? Or maybe v2, that has no external dependencies and can be updated later to v3 when Vikram's changes get accepted upstream?

Thanks,
Janusz

Quoted 77 lines · Monday 06 July 2009 12:24:27 Janusz Krzysztofik wrote:

This patch adds support for modem device found on Amstrad E3 (Delta) board.

Based on earlier patch by Jonathan McDowell, available at
http://the.earth.li/pub/e3/2.6.19/ams-delta-modem.patch.
Modified after Ladislav Michl's arch/arm/mach-omap1/board-voiceblue.c.

This version, unlike v2, is dependent on 8250 driver changes getting accepted upstream:
Refer: http://patchwork.kernel.org/patch/31884/

---
Registering the modem platform device from a separate arch_initcall (and not from init_machine() callback) preserves serial console port at ttyS0.

OMAP mux pin set up just for case if Amstrad bootloader is ever replaced.

Warning:
could cause compilation break if 8250 patch is not integrated first

--- linux-2.6.31-rc1/arch/arm/mach-omap1/board-ams-delta.c.orig 2009-07-04
16:39:37.000000000 +0200 +++
linux-2.6.31-rc1/arch/arm/mach-omap1/board-ams-delta.c 2009-07-05
13:41:08.000000000 +0200 @@ -15,8 +15,11 @@
#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/input.h>

arch/arm/mach-omap1/board-ams-delta.c renamed from arch/arm/mach-omap1/board-ams-delta.c.orig +38 -0
+#include <linux/interrupt.h>
 #include <linux/platform_device.h>
+#include <linux/serial_8250.h>
 
+#include <asm/serial.h>
 #include <mach/hardware.h>
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
@@ -235,6 +238,41 @@ static void __init ams_delta_init(void)
 	platform_add_devices(ams_delta_devices, ARRAY_SIZE(ams_delta_devices));
 }
 
+static struct plat_serial8250_port ams_delta_modem_ports[] = {
+	{
+		.membase	= (void *) AMS_DELTA_MODEM_VIRT,
+		.mapbase	= AMS_DELTA_MODEM_PHYS,
+		.irq		= -EINVAL, /* changed later */
+		.flags		= UPF_BOOT_AUTOCONF,
+		.irqflags	= IRQF_TRIGGER_RISING,
+		.iotype		= UPIO_MEM,
+		.regshift	= 1,
+		.uartclk	= BASE_BAUD * 16,
+	},
+	{ },
+};
+
+static struct platform_device ams_delta_modem_device = {
+	.name	= "serial8250",
+	.id	= PLAT8250_DEV_PLATFORM1,
+	.dev		= {
+		.platform_data = ams_delta_modem_ports,
+	},
+};
+
+static int __init ams_delta_modem_init(void)
+{
+	omap_cfg_reg(M14_1510_GPIO2);
+	ams_delta_modem_ports[0].irq = gpio_to_irq(2);
+
+	ams_delta_latch2_write(
+		AMS_DELTA_LATCH2_MODEM_NRESET | AMS_DELTA_LATCH2_MODEM_CODEC,
+		AMS_DELTA_LATCH2_MODEM_NRESET | AMS_DELTA_LATCH2_MODEM_CODEC);
+
+	return platform_device_register(&ams_delta_modem_device);
+}
+arch_initcall(ams_delta_modem_init);
+
 static void __init ams_delta_map_io(void)
 {
 	omap1_map_common_io();
#2 lore raw
Quoted 5 lines · Janusz Krzysztofik

Jonathan, Tony,

Any chance for this patch ready for 2.6.32 inclusion? Or maybe v2, that has no external dependencies and can be updated later to v3 when Vikram's changes get accepted upstream?

Vikram's patch is in linux-next, so there shouldn't be a problem with this version of your patch for 2.6.32. I haven't been able to test it myself (though I hope to next week), but it looks ok from a brief inspection, so:

Quoted 70 lines
Quoted 69 lines · Monday 06 July 2009 12:24:27 Janusz Krzysztofik wrote:

This patch adds support for modem device found on Amstrad E3 (Delta) board.

Based on earlier patch by Jonathan McDowell, available at
http://the.earth.li/pub/e3/2.6.19/ams-delta-modem.patch.
Modified after Ladislav Michl's arch/arm/mach-omap1/board-voiceblue.c.

This version, unlike v2, is dependent on 8250 driver changes getting accepted upstream:
Refer: http://patchwork.kernel.org/patch/31884/

---
Registering the modem platform device from a separate arch_initcall (and not from init_machine() callback) preserves serial console port at ttyS0.

OMAP mux pin set up just for case if Amstrad bootloader is ever replaced.

Warning:
could cause compilation break if 8250 patch is not integrated first

--- linux-2.6.31-rc1/arch/arm/mach-omap1/board-ams-delta.c.orig 2009-07-04
16:39:37.000000000 +0200 +++
linux-2.6.31-rc1/arch/arm/mach-omap1/board-ams-delta.c 2009-07-05
13:41:08.000000000 +0200 @@ -15,8 +15,11 @@
#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/input.h>

arch/arm/mach-omap1/board-ams-delta.c renamed from arch/arm/mach-omap1/board-ams-delta.c.orig +33 -0
+#include <linux/interrupt.h>
 #include <linux/platform_device.h>
+#include <linux/serial_8250.h>
 
+#include <asm/serial.h>
 #include <mach/hardware.h>
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
@@ -235,6 +238,41 @@ static void __init ams_delta_init(void)
 	platform_add_devices(ams_delta_devices, ARRAY_SIZE(ams_delta_devices));
 }
 
+static struct plat_serial8250_port ams_delta_modem_ports[] = {
+	{
+		.membase	= (void *) AMS_DELTA_MODEM_VIRT,
+		.mapbase	= AMS_DELTA_MODEM_PHYS,
+		.irq		= -EINVAL, /* changed later */
+		.flags		= UPF_BOOT_AUTOCONF,
+		.irqflags	= IRQF_TRIGGER_RISING,
+		.iotype		= UPIO_MEM,
+		.regshift	= 1,
+		.uartclk	= BASE_BAUD * 16,
+	},
+	{ },
+};
+
+static struct platform_device ams_delta_modem_device = {
+	.name	= "serial8250",
+	.id	= PLAT8250_DEV_PLATFORM1,
+	.dev		= {
+		.platform_data = ams_delta_modem_ports,
+	},
+};
+
+static int __init ams_delta_modem_init(void)
+{
+	omap_cfg_reg(M14_1510_GPIO2);
+	ams_delta_modem_ports[0].irq = gpio_to_irq(2);
+
+	ams_delta_latch2_write(
+		AMS_DELTA_LATCH2_MODEM_NRESET | AMS_DELTA_LATCH2_MODEM_CODEC,
+		AMS_DELTA_LATCH2_MODEM_NRESET | AMS_DELTA_LATCH2_MODEM_CODEC);
Quoted 10 lines

arch/arm/mach-omap1/board-ams-delta.c static void __init ams_delta_init(void) · line 278

Quoted 8 lines
arch/arm/mach-omap1/board-ams-delta.c renamed from arch/arm/mach-omap1/board-ams-delta.c.orig +5 -0
+
+	return platform_device_register(&ams_delta_modem_device);
+}
+arch_initcall(ams_delta_modem_init);
+
 static void __init ams_delta_map_io(void)
 {
 	omap1_map_common_io();

J.

Signature · 6 lines
Revd. Jonathan McDowell, ULC | I am a passenger.

-------------------------------------------------------------------
List admin: http://lists.arm.linux.org.uk/mailman/listinfo/linux-arm-kernel
FAQ:        http://www.arm.linux.org.uk/mailinglists/faq.php
Etiquette:  http://www.arm.linux.org.uk/mailinglists/etiquette.php
reviewer
#3 lore raw
Quoted 7 lines · Jonathan McDowell
Quoted 5 lines · Janusz Krzysztofik

Jonathan, Tony,

Any chance for this patch ready for 2.6.32 inclusion? Or maybe v2, that has no external dependencies and can be updated later to v3 when Vikram's changes get accepted upstream?

Quoted 6 lines

Vikram's patch is in linux-next, so there shouldn't be a problem with this version of your patch for 2.6.32. I haven't been able to test it myself (though I hope to next week), but it looks ok from a brief inspection, so:

Looks good to me, will queue it to my omap1-upstream shortly.

Tony

Quoted 91 lines
Quoted 71 lines
Quoted 69 lines · Monday 06 July 2009 12:24:27 Janusz Krzysztofik wrote:

This patch adds support for modem device found on Amstrad E3 (Delta) board.

Based on earlier patch by Jonathan McDowell, available at
http://the.earth.li/pub/e3/2.6.19/ams-delta-modem.patch.
Modified after Ladislav Michl's arch/arm/mach-omap1/board-voiceblue.c.

This version, unlike v2, is dependent on 8250 driver changes getting accepted upstream:
Refer: http://patchwork.kernel.org/patch/31884/

---
Registering the modem platform device from a separate arch_initcall (and not from init_machine() callback) preserves serial console port at ttyS0.

OMAP mux pin set up just for case if Amstrad bootloader is ever replaced.

Warning:
could cause compilation break if 8250 patch is not integrated first

--- linux-2.6.31-rc1/arch/arm/mach-omap1/board-ams-delta.c.orig 2009-07-04
16:39:37.000000000 +0200 +++
linux-2.6.31-rc1/arch/arm/mach-omap1/board-ams-delta.c 2009-07-05
13:41:08.000000000 +0200 @@ -15,8 +15,11 @@
#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/input.h>

arch/arm/mach-omap1/board-ams-delta.c renamed from arch/arm/mach-omap1/board-ams-delta.c.orig +33 -0
+#include <linux/interrupt.h>
 #include <linux/platform_device.h>
+#include <linux/serial_8250.h>
 
+#include <asm/serial.h>
 #include <mach/hardware.h>
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
@@ -235,6 +238,41 @@ static void __init ams_delta_init(void)
 	platform_add_devices(ams_delta_devices, ARRAY_SIZE(ams_delta_devices));
 }
 
+static struct plat_serial8250_port ams_delta_modem_ports[] = {
+	{
+		.membase	= (void *) AMS_DELTA_MODEM_VIRT,
+		.mapbase	= AMS_DELTA_MODEM_PHYS,
+		.irq		= -EINVAL, /* changed later */
+		.flags		= UPF_BOOT_AUTOCONF,
+		.irqflags	= IRQF_TRIGGER_RISING,
+		.iotype		= UPIO_MEM,
+		.regshift	= 1,
+		.uartclk	= BASE_BAUD * 16,
+	},
+	{ },
+};
+
+static struct platform_device ams_delta_modem_device = {
+	.name	= "serial8250",
+	.id	= PLAT8250_DEV_PLATFORM1,
+	.dev		= {
+		.platform_data = ams_delta_modem_ports,
+	},
+};
+
+static int __init ams_delta_modem_init(void)
+{
+	omap_cfg_reg(M14_1510_GPIO2);
+	ams_delta_modem_ports[0].irq = gpio_to_irq(2);
+
+	ams_delta_latch2_write(
+		AMS_DELTA_LATCH2_MODEM_NRESET | AMS_DELTA_LATCH2_MODEM_CODEC,
+		AMS_DELTA_LATCH2_MODEM_NRESET | AMS_DELTA_LATCH2_MODEM_CODEC);
Quoted 10 lines

arch/arm/mach-omap1/board-ams-delta.c static void __init ams_delta_init(void) · line 278

Quoted 8 lines
arch/arm/mach-omap1/board-ams-delta.c renamed from arch/arm/mach-omap1/board-ams-delta.c.orig +5 -0
+
+	return platform_device_register(&ams_delta_modem_device);
+}
+arch_initcall(ams_delta_modem_init);
+
 static void __init ams_delta_map_io(void)
 {
 	omap1_map_common_io();

J.

Signature · 6 lines
Revd. Jonathan McDowell, ULC | I am a passenger.

-------------------------------------------------------------------
List admin: http://lists.arm.linux.org.uk/mailman/listinfo/linux-arm-kernel
FAQ:        http://www.arm.linux.org.uk/mailinglists/faq.php
Etiquette:  http://www.arm.linux.org.uk/mailinglists/etiquette.php
reviewer
#4 lore raw

PATCH v3 1/1 OMAP1: AMS_DELTA: add modem support

In reply to Janusz Krzysztofik

This patch has been applied to the linux-omap
by youw fwiendly patch wobot.

Branch in linux-omap: omap1-upstream

Initial commit ID (Likely to change): 92c79d20ca55625ad36ee79ec1356558a3aeb061

PatchWorks
http://patchwork.kernel.org/patch/34220/

Git (Likely to change, and takes a while to get mirrored)
http://git.kernel.org/?p=linux/kernel/git/tmlind/linux-omap-2.6.git;a=commit;h=92c79d20ca55625ad36ee79ec1356558a3aeb061