Linux MIPS Architecture development
 help / color / mirror / Atom feed
* [PATCH 1/4] MIPS: lantiq: move IRQ_RES macro to a headerfile
       [not found] <1304959750-8557-1-git-send-email-blogic@openwrt.org>
@ 2011-05-09 16:49 ` John Crispin
  2011-05-10 14:23   ` Ralf Baechle
  2011-05-09 16:49 ` [PATCH 2/4] MIPS: lantiq: adds Amazon SE serial port platform device John Crispin
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 8+ messages in thread
From: John Crispin @ 2011-05-09 16:49 UTC (permalink / raw)
  To: Ralf Baechle; +Cc: John Crispin, linux-mips

The IRQ_RES macro should be located at a place where other *.c files can easily
reuse it.

Signed-off-by: John Crispin <blogic@openwrt.org>
Cc: linux-mips@linux-mips.org
---
 arch/mips/lantiq/devices.c |    3 ---
 arch/mips/lantiq/devices.h |    3 +++
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/mips/lantiq/devices.c b/arch/mips/lantiq/devices.c
index e758863..7b82c34 100644
--- a/arch/mips/lantiq/devices.c
+++ b/arch/mips/lantiq/devices.c
@@ -28,9 +28,6 @@
 
 #include "devices.h"
 
-#define IRQ_RES(resname, irq) \
-	{.name = #resname, .start = (irq), .flags = IORESOURCE_IRQ}
-
 /* nor flash */
 static struct resource ltq_nor_resource = {
 	.name	= "nor",
diff --git a/arch/mips/lantiq/devices.h b/arch/mips/lantiq/devices.h
index 069006c..2947bb1 100644
--- a/arch/mips/lantiq/devices.h
+++ b/arch/mips/lantiq/devices.h
@@ -12,6 +12,9 @@
 #include <lantiq_platform.h>
 #include <linux/mtd/physmap.h>
 
+#define IRQ_RES(resname, irq) \
+	{.name = #resname, .start = (irq), .flags = IORESOURCE_IRQ}
+
 extern void ltq_register_nor(struct physmap_flash_data *data);
 extern void ltq_register_wdt(void);
 extern void ltq_register_asc(int port);
-- 
1.7.2.3

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 2/4] MIPS: lantiq: adds Amazon SE serial port platform device
       [not found] <1304959750-8557-1-git-send-email-blogic@openwrt.org>
  2011-05-09 16:49 ` [PATCH 1/4] MIPS: lantiq: move IRQ_RES macro to a headerfile John Crispin
@ 2011-05-09 16:49 ` John Crispin
  2011-05-10 14:24   ` Ralf Baechle
  2011-05-09 16:49 ` [PATCH 3/4] MIPS: lantiq: cleanup machine specific files John Crispin
  2011-05-09 16:49 ` [PATCH 4/4] MIPS: lantiq: add a soc specific setup function John Crispin
  3 siblings, 1 reply; 8+ messages in thread
From: John Crispin @ 2011-05-09 16:49 UTC (permalink / raw)
  To: Ralf Baechle; +Cc: John Crispin, linux-mips

Amazon SE only has 1 serial port. We use a seperate function to register the
platform device as the IRQ mappings also differ.

Signed-off-by: John Crispin <blogic@openwrt.org>
Cc: linux-mips@linux-mips.org
---
 .../mips/include/asm/mach-lantiq/xway/lantiq_irq.h |    4 +++
 arch/mips/lantiq/xway/devices.c                    |   21 ++++++++++++++++++++
 arch/mips/lantiq/xway/devices.h                    |    1 +
 3 files changed, 26 insertions(+), 0 deletions(-)

diff --git a/arch/mips/include/asm/mach-lantiq/xway/lantiq_irq.h b/arch/mips/include/asm/mach-lantiq/xway/lantiq_irq.h
index 5c81c98..b4465a8 100644
--- a/arch/mips/include/asm/mach-lantiq/xway/lantiq_irq.h
+++ b/arch/mips/include/asm/mach-lantiq/xway/lantiq_irq.h
@@ -21,6 +21,10 @@
 #define LTQ_ASC_RIR(x)		(INT_NUM_IM3_IRL0 + (x * 8) + 1)
 #define LTQ_ASC_EIR(x)		(INT_NUM_IM3_IRL0 + (x * 8) + 2)
 
+#define LTQ_ASC_ASE_TIR		INT_NUM_IM2_IRL0
+#define LTQ_ASC_ASE_RIR		(INT_NUM_IM2_IRL0 + 2)
+#define LTQ_ASC_ASE_EIR		(INT_NUM_IM2_IRL0 + 3)
+
 #define LTQ_SSC_TIR		(INT_NUM_IM0_IRL0 + 15)
 #define LTQ_SSC_RIR		(INT_NUM_IM0_IRL0 + 14)
 #define LTQ_SSC_EIR		(INT_NUM_IM0_IRL0 + 16)
diff --git a/arch/mips/lantiq/xway/devices.c b/arch/mips/lantiq/xway/devices.c
index c257026..2fd1733 100644
--- a/arch/mips/lantiq/xway/devices.c
+++ b/arch/mips/lantiq/xway/devices.c
@@ -29,6 +29,8 @@
 #include <lantiq_irq.h>
 #include <lantiq_platform.h>
 
+#include "devices.h"
+
 /* gpio */
 static struct resource ltq_gpio_resource[] = {
 	{
@@ -98,3 +100,22 @@ ltq_register_etop(struct ltq_eth_data *eth)
 		platform_device_register(&ltq_etop);
 	}
 }
+
+/* asc ports - amazon se has its own serial mapping */
+static struct resource ltq_ase_asc_resources[] = {
+	{
+		.name	= "asc0",
+		.start  = LTQ_ASC1_BASE_ADDR,
+		.end    = LTQ_ASC1_BASE_ADDR + LTQ_ASC_SIZE - 1,
+		.flags  = IORESOURCE_MEM,
+	},
+	IRQ_RES(tx, LTQ_ASC_ASE_TIR),
+	IRQ_RES(rx, LTQ_ASC_ASE_RIR),
+	IRQ_RES(err, LTQ_ASC_ASE_EIR),
+};
+
+void __init ltq_register_ase_asc(void)
+{
+	platform_device_register_simple("ltq_asc", 0,
+		ltq_ase_asc_resources, ARRAY_SIZE(ltq_ase_asc_resources));
+}
diff --git a/arch/mips/lantiq/xway/devices.h b/arch/mips/lantiq/xway/devices.h
index 2deb68e..e904934 100644
--- a/arch/mips/lantiq/xway/devices.h
+++ b/arch/mips/lantiq/xway/devices.h
@@ -14,6 +14,7 @@
 
 extern void ltq_register_gpio(void);
 extern void ltq_register_gpio_stp(void);
+extern void ltq_register_ase_asc(void);
 extern void ltq_register_etop(struct ltq_eth_data *eth);
 
 #endif
-- 
1.7.2.3

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 3/4] MIPS: lantiq: cleanup machine specific files
       [not found] <1304959750-8557-1-git-send-email-blogic@openwrt.org>
  2011-05-09 16:49 ` [PATCH 1/4] MIPS: lantiq: move IRQ_RES macro to a headerfile John Crispin
  2011-05-09 16:49 ` [PATCH 2/4] MIPS: lantiq: adds Amazon SE serial port platform device John Crispin
@ 2011-05-09 16:49 ` John Crispin
  2011-05-10 14:24   ` Ralf Baechle
  2011-05-09 16:49 ` [PATCH 4/4] MIPS: lantiq: add a soc specific setup function John Crispin
  3 siblings, 1 reply; 8+ messages in thread
From: John Crispin @ 2011-05-09 16:49 UTC (permalink / raw)
  To: Ralf Baechle; +Cc: John Crispin, linux-mips

The platform driver register functions called in every machine init function
get moved to setup-<SOC>.c. Also remove superflous pci register call from
Amazon SE machine code as the device and driver are not present on ASE.

Signed-off-by: John Crispin <blogic@openwrt.org>
Cc: linux-mips@linux-mips.org
---
 arch/mips/lantiq/xway/mach-easy50601.c |    8 --------
 arch/mips/lantiq/xway/mach-easy50712.c |    2 --
 2 files changed, 0 insertions(+), 10 deletions(-)

diff --git a/arch/mips/lantiq/xway/mach-easy50601.c b/arch/mips/lantiq/xway/mach-easy50601.c
index 34a41d9..0002128 100644
--- a/arch/mips/lantiq/xway/mach-easy50601.c
+++ b/arch/mips/lantiq/xway/mach-easy50601.c
@@ -50,17 +50,9 @@ static struct physmap_flash_data easy50601_flash_data = {
 #endif
 };
 
-static struct ltq_pci_data ltq_pci_data = {
-	.clock		= PCI_CLOCK_INT,
-	.req_mask	= 0xf,
-};
-
 static void __init easy50601_init(void)
 {
-	ltq_register_gpio();
 	ltq_register_nor(&easy50601_flash_data);
-	ltq_register_wdt();
-	ltq_register_pci(&ltq_pci_data);
 }
 
 MIPS_MACHINE(LTQ_MACH_EASY50601,
diff --git a/arch/mips/lantiq/xway/mach-easy50712.c b/arch/mips/lantiq/xway/mach-easy50712.c
index 0cbb30b..2512561 100644
--- a/arch/mips/lantiq/xway/mach-easy50712.c
+++ b/arch/mips/lantiq/xway/mach-easy50712.c
@@ -65,10 +65,8 @@ static struct ltq_eth_data ltq_eth_data = {
 
 static void __init easy50712_init(void)
 {
-	ltq_register_gpio();
 	ltq_register_gpio_stp();
 	ltq_register_nor(&easy50712_flash_data);
-	ltq_register_wdt();
 	ltq_register_pci(&ltq_pci_data);
 	ltq_register_etop(&ltq_eth_data);
 }
-- 
1.7.2.3

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 4/4] MIPS: lantiq: add a soc specific setup function
       [not found] <1304959750-8557-1-git-send-email-blogic@openwrt.org>
                   ` (2 preceding siblings ...)
  2011-05-09 16:49 ` [PATCH 3/4] MIPS: lantiq: cleanup machine specific files John Crispin
@ 2011-05-09 16:49 ` John Crispin
  2011-05-10 14:24   ` Ralf Baechle
  3 siblings, 1 reply; 8+ messages in thread
From: John Crispin @ 2011-05-09 16:49 UTC (permalink / raw)
  To: Ralf Baechle; +Cc: John Crispin, linux-mips

Add a setup-<SOC>.c file for every xway variant. This file is responsible for
registering the basic platform devices, that are always present.

Signed-off-by: John Crispin <blogic@openwrt.org>
Cc: linux-mips@linux-mips.org
---
 arch/mips/lantiq/prom.h            |    1 +
 arch/mips/lantiq/setup.c           |    4 ++--
 arch/mips/lantiq/xway/Makefile     |    4 ++--
 arch/mips/lantiq/xway/setup-ase.c  |   19 +++++++++++++++++++
 arch/mips/lantiq/xway/setup-xway.c |   20 ++++++++++++++++++++
 5 files changed, 44 insertions(+), 4 deletions(-)
 create mode 100644 arch/mips/lantiq/xway/setup-ase.c
 create mode 100644 arch/mips/lantiq/xway/setup-xway.c

diff --git a/arch/mips/lantiq/prom.h b/arch/mips/lantiq/prom.h
index 4165ad1..b4229d9 100644
--- a/arch/mips/lantiq/prom.h
+++ b/arch/mips/lantiq/prom.h
@@ -20,5 +20,6 @@ struct ltq_soc_info {
 };
 
 extern void ltq_soc_detect(struct ltq_soc_info *i);
+extern void ltq_soc_setup(void);
 
 #endif
diff --git a/arch/mips/lantiq/setup.c b/arch/mips/lantiq/setup.c
index 1d99b2b..2f27f58 100644
--- a/arch/mips/lantiq/setup.c
+++ b/arch/mips/lantiq/setup.c
@@ -16,6 +16,7 @@
 
 #include "machtypes.h"
 #include "devices.h"
+#include "prom.h"
 
 void __init plat_mem_setup(void)
 {
@@ -45,8 +46,7 @@ void __init plat_mem_setup(void)
 static int __init
 lantiq_setup(void)
 {
-	ltq_register_asc(0);
-	ltq_register_asc(1);
+	ltq_soc_setup();
 	mips_machine_setup();
 	return 0;
 }
diff --git a/arch/mips/lantiq/xway/Makefile b/arch/mips/lantiq/xway/Makefile
index d88a3e8..c517f2e 100644
--- a/arch/mips/lantiq/xway/Makefile
+++ b/arch/mips/lantiq/xway/Makefile
@@ -1,7 +1,7 @@
 obj-y := pmu.o ebu.o reset.o gpio.o gpio_stp.o gpio_ebu.o devices.o dma.o
 
-obj-$(CONFIG_SOC_XWAY) += clk-xway.o prom-xway.o
-obj-$(CONFIG_SOC_AMAZON_SE) += clk-ase.o prom-ase.o
+obj-$(CONFIG_SOC_XWAY) += clk-xway.o prom-xway.o setup-xway.o
+obj-$(CONFIG_SOC_AMAZON_SE) += clk-ase.o prom-ase.o setup-ase.o
 
 obj-$(CONFIG_LANTIQ_MACH_EASY50712) += mach-easy50712.o
 obj-$(CONFIG_LANTIQ_MACH_EASY50601) += mach-easy50601.o
diff --git a/arch/mips/lantiq/xway/setup-ase.c b/arch/mips/lantiq/xway/setup-ase.c
new file mode 100644
index 0000000..f6f3267
--- /dev/null
+++ b/arch/mips/lantiq/xway/setup-ase.c
@@ -0,0 +1,19 @@
+/*
+ *  This program is free software; you can redistribute it and/or modify it
+ *  under the terms of the GNU General Public License version 2 as published
+ *  by the Free Software Foundation.
+ *
+ *  Copyright (C) 2011 John Crispin <blogic@openwrt.org>
+ */
+
+#include <lantiq_soc.h>
+
+#include "../prom.h"
+#include "devices.h"
+
+void __init ltq_soc_setup(void)
+{
+	ltq_register_ase_asc();
+	ltq_register_gpio();
+	ltq_register_wdt();
+}
diff --git a/arch/mips/lantiq/xway/setup-xway.c b/arch/mips/lantiq/xway/setup-xway.c
new file mode 100644
index 0000000..c292f64
--- /dev/null
+++ b/arch/mips/lantiq/xway/setup-xway.c
@@ -0,0 +1,20 @@
+/*
+ *  This program is free software; you can redistribute it and/or modify it
+ *  under the terms of the GNU General Public License version 2 as published
+ *  by the Free Software Foundation.
+ *
+ *  Copyright (C) 2011 John Crispin <blogic@openwrt.org>
+ */
+
+#include <lantiq_soc.h>
+
+#include "../prom.h"
+#include "devices.h"
+
+void __init ltq_soc_setup(void)
+{
+	ltq_register_asc(0);
+	ltq_register_asc(1);
+	ltq_register_gpio();
+	ltq_register_wdt();
+}
-- 
1.7.2.3

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH 1/4] MIPS: lantiq: move IRQ_RES macro to a headerfile
  2011-05-09 16:49 ` [PATCH 1/4] MIPS: lantiq: move IRQ_RES macro to a headerfile John Crispin
@ 2011-05-10 14:23   ` Ralf Baechle
  0 siblings, 0 replies; 8+ messages in thread
From: Ralf Baechle @ 2011-05-10 14:23 UTC (permalink / raw)
  To: John Crispin; +Cc: linux-mips

As discussed folded into the existing series in linux-queue.  Could you
please check if the result is making sense?

Thanks,

  Ralf

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 2/4] MIPS: lantiq: adds Amazon SE serial port platform device
  2011-05-09 16:49 ` [PATCH 2/4] MIPS: lantiq: adds Amazon SE serial port platform device John Crispin
@ 2011-05-10 14:24   ` Ralf Baechle
  0 siblings, 0 replies; 8+ messages in thread
From: Ralf Baechle @ 2011-05-10 14:24 UTC (permalink / raw)
  To: John Crispin; +Cc: linux-mips

As discussed folded into the existing series in linux-queue.  Could you
please check if the result is making sense?  

Thanks,

  Ralf

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 3/4] MIPS: lantiq: cleanup machine specific files
  2011-05-09 16:49 ` [PATCH 3/4] MIPS: lantiq: cleanup machine specific files John Crispin
@ 2011-05-10 14:24   ` Ralf Baechle
  0 siblings, 0 replies; 8+ messages in thread
From: Ralf Baechle @ 2011-05-10 14:24 UTC (permalink / raw)
  To: John Crispin; +Cc: linux-mips

As discussed folded into the existing series in linux-queue.  Could you
please check if the result is making sense?  

Thanks,

  Ralf

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 4/4] MIPS: lantiq: add a soc specific setup function
  2011-05-09 16:49 ` [PATCH 4/4] MIPS: lantiq: add a soc specific setup function John Crispin
@ 2011-05-10 14:24   ` Ralf Baechle
  0 siblings, 0 replies; 8+ messages in thread
From: Ralf Baechle @ 2011-05-10 14:24 UTC (permalink / raw)
  To: John Crispin; +Cc: linux-mips

As discussed folded into the existing series in linux-queue.  Could you
please check if the result is making sense?  

Thanks,

  Ralf

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2011-05-10 14:23 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <1304959750-8557-1-git-send-email-blogic@openwrt.org>
2011-05-09 16:49 ` [PATCH 1/4] MIPS: lantiq: move IRQ_RES macro to a headerfile John Crispin
2011-05-10 14:23   ` Ralf Baechle
2011-05-09 16:49 ` [PATCH 2/4] MIPS: lantiq: adds Amazon SE serial port platform device John Crispin
2011-05-10 14:24   ` Ralf Baechle
2011-05-09 16:49 ` [PATCH 3/4] MIPS: lantiq: cleanup machine specific files John Crispin
2011-05-10 14:24   ` Ralf Baechle
2011-05-09 16:49 ` [PATCH 4/4] MIPS: lantiq: add a soc specific setup function John Crispin
2011-05-10 14:24   ` Ralf Baechle

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox