* [PATCH 1/8] ARM i.MX: add helper for usb device registration
2011-07-28 8:00 switch more devices to use resources Sascha Hauer
@ 2011-07-28 8:00 ` Sascha Hauer
2011-07-28 8:00 ` [PATCH 2/8] ARM i.MX cupid: use device registration helpers Sascha Hauer
` (6 subsequent siblings)
7 siblings, 0 replies; 10+ messages in thread
From: Sascha Hauer @ 2011-07-28 8:00 UTC (permalink / raw)
To: barebox
And also, switch to resources along the way.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
arch/arm/boards/eukrea_cpuimx25/eukrea_cpuimx25.c | 9 +--------
arch/arm/boards/eukrea_cpuimx35/eukrea_cpuimx35.c | 9 +--------
arch/arm/boards/freescale-mx25-3-stack/3stack.c | 9 +--------
arch/arm/boards/guf-neso/board.c | 10 +---------
arch/arm/boards/pcm037/pcm037.c | 18 ++----------------
arch/arm/boards/pcm038/pcm038.c | 9 +--------
arch/arm/boards/phycard-i.MX27/pca100.c | 18 ++----------------
arch/arm/mach-imx/devices.c | 5 +++++
arch/arm/mach-imx/include/mach/devices-imx25.h | 9 +++++++++
arch/arm/mach-imx/include/mach/devices-imx27.h | 13 +++++++++++++
arch/arm/mach-imx/include/mach/devices-imx31.h | 15 +++++++++++++++
arch/arm/mach-imx/include/mach/devices-imx35.h | 10 ++++++++++
arch/arm/mach-imx/include/mach/devices.h | 2 +-
13 files changed, 62 insertions(+), 74 deletions(-)
diff --git a/arch/arm/boards/eukrea_cpuimx25/eukrea_cpuimx25.c b/arch/arm/boards/eukrea_cpuimx25/eukrea_cpuimx25.c
index 6ea4a6e..57cc1e8 100644
--- a/arch/arm/boards/eukrea_cpuimx25/eukrea_cpuimx25.c
+++ b/arch/arm/boards/eukrea_cpuimx25/eukrea_cpuimx25.c
@@ -147,13 +147,6 @@ static void imx25_usb_init(void)
tmp = readl(IMX_OTG_BASE + 0x5a8);
writel(tmp | 0x3, IMX_OTG_BASE + 0x5a8);
}
-
-static struct device_d usbh2_dev = {
- .id = -1,
- .name = "ehci",
- .map_base = IMX_OTG_BASE + 0x400,
- .size = 0x200,
-};
#endif
static struct fsl_usb2_platform_data usb_pdata = {
@@ -282,7 +275,7 @@ static int eukrea_cpuimx25_devices_init(void)
#ifdef CONFIG_USB
imx25_usb_init();
- register_device(&usbh2_dev);
+ imx25_add_ehci1(NULL);
#endif
register_device(&usbotg_dev);
diff --git a/arch/arm/boards/eukrea_cpuimx35/eukrea_cpuimx35.c b/arch/arm/boards/eukrea_cpuimx35/eukrea_cpuimx35.c
index d1de495..d43d3af 100644
--- a/arch/arm/boards/eukrea_cpuimx35/eukrea_cpuimx35.c
+++ b/arch/arm/boards/eukrea_cpuimx35/eukrea_cpuimx35.c
@@ -117,13 +117,6 @@ static void imx35_usb_init(void)
tmp = readl(IMX_OTG_BASE + 0x5a8);
writel(tmp | 0x3, IMX_OTG_BASE + 0x5a8);
}
-
-static struct device_d usbh2_dev = {
- .id = -1,
- .name = "ehci",
- .map_base = IMX_OTG_BASE + 0x400,
- .size = 0x200,
-};
#endif
static struct fsl_usb2_platform_data usb_pdata = {
@@ -181,7 +174,7 @@ static int eukrea_cpuimx35_devices_init(void)
#ifdef CONFIG_USB
imx35_usb_init();
- register_device(&usbh2_dev);
+ imx35_add_ehci1(NULL);
#endif
#ifdef CONFIG_USB_GADGET
/* Workaround ENGcm09152 */
diff --git a/arch/arm/boards/freescale-mx25-3-stack/3stack.c b/arch/arm/boards/freescale-mx25-3-stack/3stack.c
index 6d4bde5..522cf70 100644
--- a/arch/arm/boards/freescale-mx25-3-stack/3stack.c
+++ b/arch/arm/boards/freescale-mx25-3-stack/3stack.c
@@ -137,13 +137,6 @@ static void imx25_usb_init(void)
tmp = readl(IMX_OTG_BASE + 0x5a8);
writel(tmp | 0x3, IMX_OTG_BASE + 0x5a8);
}
-
-static struct device_d usbh2_dev = {
- .id = -1,
- .name = "ehci",
- .map_base = IMX_OTG_BASE + 0x400,
- .size = 0x200,
-};
#endif
static struct i2c_board_info i2c_devices[] = {
@@ -207,7 +200,7 @@ static int imx25_devices_init(void)
* the CPLD has to be initialized.
*/
imx25_usb_init();
- register_device(&usbh2_dev);
+ imx25_add_ehci1(NULL);
#endif
imx25_add_fec(&fec_info);
diff --git a/arch/arm/boards/guf-neso/board.c b/arch/arm/boards/guf-neso/board.c
index 4e0ac90..e36e804 100644
--- a/arch/arm/boards/guf-neso/board.c
+++ b/arch/arm/boards/guf-neso/board.c
@@ -114,14 +114,6 @@ static struct imx_fb_platform_data neso_fb_data = {
};
#ifdef CONFIG_USB
-
-static struct device_d usbh2_dev = {
- .id = -1,
- .name = "ehci",
- .map_base = IMX_OTG_BASE + 0x400,
- .size = 0x200,
-};
-
static void neso_usbh_init(void)
{
uint32_t temp;
@@ -304,7 +296,7 @@ static int neso_devices_init(void)
#ifdef CONFIG_USB
neso_usbh_init();
- register_device(&usbh2_dev);
+ imx27_add_ehci2(NULL);
#endif
imx27_add_fec(&fec_info);
diff --git a/arch/arm/boards/pcm037/pcm037.c b/arch/arm/boards/pcm037/pcm037.c
index 6e20d1d..af4ad8b 100644
--- a/arch/arm/boards/pcm037/pcm037.c
+++ b/arch/arm/boards/pcm037/pcm037.c
@@ -70,20 +70,6 @@ struct imx_nand_platform_data nand_info = {
};
#ifdef CONFIG_USB
-static struct device_d usbotg_dev = {
- .id = -1,
- .name = "ehci",
- .map_base = IMX_OTG_BASE,
- .size = 0x200,
-};
-
-static struct device_d usbh2_dev = {
- .id = -1,
- .name = "ehci",
- .map_base = IMX_OTG_BASE + 0x400,
- .size = 0x200,
-};
-
static void pcm037_usb_init(void)
{
u32 tmp;
@@ -250,8 +236,8 @@ static int imx31_devices_init(void)
#endif
#ifdef CONFIG_USB
pcm037_usb_init();
- register_device(&usbotg_dev);
- register_device(&usbh2_dev);
+ imx31_add_ehci0(NULL);
+ imx31_add_ehci2(NULL);
#endif
armlinux_set_bootparams((void *)0x80000100);
diff --git a/arch/arm/boards/pcm038/pcm038.c b/arch/arm/boards/pcm038/pcm038.c
index 2f87b12..74c8b34 100644
--- a/arch/arm/boards/pcm038/pcm038.c
+++ b/arch/arm/boards/pcm038/pcm038.c
@@ -109,13 +109,6 @@ static struct imx_fb_platform_data pcm038_fb_data = {
};
#ifdef CONFIG_USB
-static struct device_d usbh2_dev = {
- .id = -1,
- .name = "ehci",
- .map_base = IMX_OTG_BASE + 0x400,
- .size = 0x200,
-};
-
static void pcm038_usbh_init(void)
{
uint32_t temp;
@@ -271,7 +264,7 @@ static int pcm038_devices_init(void)
#ifdef CONFIG_USB
pcm038_usbh_init();
- register_device(&usbh2_dev);
+ imx27_add_ehci2(NULL);
#endif
/* Register the fec device after the PLL re-initialisation
diff --git a/arch/arm/boards/phycard-i.MX27/pca100.c b/arch/arm/boards/phycard-i.MX27/pca100.c
index 63216f5..8c36a3f 100644
--- a/arch/arm/boards/phycard-i.MX27/pca100.c
+++ b/arch/arm/boards/phycard-i.MX27/pca100.c
@@ -53,20 +53,6 @@ struct imx_nand_platform_data nand_info = {
};
#ifdef CONFIG_USB
-static struct device_d usbotg_dev = {
- .id = -1,
- .name = "ehci",
- .map_base = IMX_OTG_BASE,
- .size = 0x200,
-};
-
-static struct device_d usbh2_dev = {
- .id = -1,
- .name = "ehci",
- .map_base = IMX_OTG_BASE + 0x400,
- .size = 0x200,
-};
-
static void pca100_usb_register(void)
{
mdelay(10);
@@ -77,9 +63,9 @@ static void pca100_usb_register(void)
mdelay(10);
isp1504_set_vbus_power((void *)(IMX_OTG_BASE + 0x170), 1);
- register_device(&usbotg_dev);
+ imx27_add_ehci0(NULL);
isp1504_set_vbus_power((void *)(IMX_OTG_BASE + 0x570), 1);
- register_device(&usbh2_dev);
+ imx27_add_ehci2(NULL);
}
#endif
diff --git a/arch/arm/mach-imx/devices.c b/arch/arm/mach-imx/devices.c
index 5b062f5..eb070c6 100644
--- a/arch/arm/mach-imx/devices.c
+++ b/arch/arm/mach-imx/devices.c
@@ -52,3 +52,8 @@ struct device_d *imx_add_esdhc(void *base, int id, void *pdata)
{
return imx_add_device("imx-esdhc", id, base, 0x1000, pdata);
}
+
+struct device_d *imx_add_ehci(void *base, int id, void *pdata)
+{
+ return imx_add_device("ehci", id, base, 0x200, pdata);
+}
diff --git a/arch/arm/mach-imx/include/mach/devices-imx25.h b/arch/arm/mach-imx/include/mach/devices-imx25.h
index 87f5ba0..cf4c61d 100644
--- a/arch/arm/mach-imx/include/mach/devices-imx25.h
+++ b/arch/arm/mach-imx/include/mach/devices-imx25.h
@@ -36,3 +36,12 @@ static inline struct device_d *imx25_add_mmc0(void *pdata)
return imx_add_esdhc((void *)0x53fb4000, 0, pdata);
}
+static inline struct device_d *imx25_add_ehci0(void *pdata)
+{
+ return imx_add_ehci((void *)IMX_OTG_BASE, 0, pdata);
+}
+
+static inline struct device_d *imx25_add_ehci1(void *pdata)
+{
+ return imx_add_ehci((void *)IMX_OTG_BASE + 0x400, 1, pdata);
+}
diff --git a/arch/arm/mach-imx/include/mach/devices-imx27.h b/arch/arm/mach-imx/include/mach/devices-imx27.h
index 0511eb5..04d1474 100644
--- a/arch/arm/mach-imx/include/mach/devices-imx27.h
+++ b/arch/arm/mach-imx/include/mach/devices-imx27.h
@@ -51,4 +51,17 @@ static inline struct device_d *imx27_add_mmc0(void *pdata)
return imx_add_mmc((void *)0x10014000, 0, pdata);
}
+static inline struct device_d *imx27_add_ehci0(void *pdata)
+{
+ return imx_add_ehci((void *)IMX_OTG_BASE, 0, pdata);
+}
+static inline struct device_d *imx27_add_ehci1(void *pdata)
+{
+ return imx_add_ehci((void *)IMX_OTG_BASE + 0x200, 1, pdata);
+}
+
+static inline struct device_d *imx27_add_ehci2(void *pdata)
+{
+ return imx_add_ehci((void *)IMX_OTG_BASE + 0x400, 2, pdata);
+}
diff --git a/arch/arm/mach-imx/include/mach/devices-imx31.h b/arch/arm/mach-imx/include/mach/devices-imx31.h
index 5dcea82..aa7cb60 100644
--- a/arch/arm/mach-imx/include/mach/devices-imx31.h
+++ b/arch/arm/mach-imx/include/mach/devices-imx31.h
@@ -33,3 +33,18 @@ static inline struct device_d *imx31_add_fb(struct imx_ipu_fb_platform_data *pda
{
return imx_add_ipufb((void *)IPU_BASE, pdata);
}
+
+static inline struct device_d *imx31_add_ehci0(void *pdata)
+{
+ return imx_add_ehci((void *)IMX_OTG_BASE, 0, pdata);
+}
+
+static inline struct device_d *imx31_add_ehci1(void *pdata)
+{
+ return imx_add_ehci((void *)IMX_OTG_BASE + 0x200, 1, pdata);
+}
+
+static inline struct device_d *imx31_add_ehci2(void *pdata)
+{
+ return imx_add_ehci((void *)IMX_OTG_BASE + 0x400, 2, pdata);
+}
diff --git a/arch/arm/mach-imx/include/mach/devices-imx35.h b/arch/arm/mach-imx/include/mach/devices-imx35.h
index 69f4b36..701ba7a 100644
--- a/arch/arm/mach-imx/include/mach/devices-imx35.h
+++ b/arch/arm/mach-imx/include/mach/devices-imx35.h
@@ -55,3 +55,13 @@ static inline struct device_d *imx35_add_mmc2(void *pdata)
{
return imx_add_esdhc((void *)IMX_SDHC3_BASE, 2, pdata);
}
+
+static inline struct device_d *imx35_add_ehci0(void *pdata)
+{
+ return imx_add_ehci((void *)IMX_OTG_BASE, 0, pdata);
+}
+
+static inline struct device_d *imx35_add_ehci1(void *pdata)
+{
+ return imx_add_ehci((void *)IMX_OTG_BASE + 0x400, 1, pdata);
+}
diff --git a/arch/arm/mach-imx/include/mach/devices.h b/arch/arm/mach-imx/include/mach/devices.h
index 7338ac5..7402616 100644
--- a/arch/arm/mach-imx/include/mach/devices.h
+++ b/arch/arm/mach-imx/include/mach/devices.h
@@ -15,4 +15,4 @@ struct device_d *imx_add_fb(void *base, struct imx_fb_platform_data *pdata);
struct device_d *imx_add_ipufb(void *base, struct imx_ipu_fb_platform_data *pdata);
struct device_d *imx_add_mmc(void *base, int id, void *pdata);
struct device_d *imx_add_esdhc(void *base, int id, void *pdata);
-
+struct device_d *imx_add_ehci(void *base, int id, void *pdata);
--
1.7.5.4
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH 2/8] ARM i.MX cupid: use device registration helpers
2011-07-28 8:00 switch more devices to use resources Sascha Hauer
2011-07-28 8:00 ` [PATCH 1/8] ARM i.MX: add helper for usb device registration Sascha Hauer
@ 2011-07-28 8:00 ` Sascha Hauer
2011-07-28 8:00 ` [PATCH 3/8] ARM i.MX pca100: " Sascha Hauer
` (5 subsequent siblings)
7 siblings, 0 replies; 10+ messages in thread
From: Sascha Hauer @ 2011-07-28 8:00 UTC (permalink / raw)
To: barebox
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
arch/arm/boards/guf-cupid/board.c | 46 +++++-------------------------------
1 files changed, 7 insertions(+), 39 deletions(-)
diff --git a/arch/arm/boards/guf-cupid/board.c b/arch/arm/boards/guf-cupid/board.c
index 313e280..6906f0a 100644
--- a/arch/arm/boards/guf-cupid/board.c
+++ b/arch/arm/boards/guf-cupid/board.c
@@ -43,31 +43,18 @@
#include <mach/imx-ipu-fb.h>
#include <mach/imx-pll.h>
#include <mach/iomux-mx35.h>
+#include <mach/devices-imx35.h>
static struct fec_platform_data fec_info = {
.xcv_type = MII100,
};
-static struct device_d fec_dev = {
- .id = -1,
- .name = "fec_imx",
- .map_base = IMX_FEC_BASE,
- .platform_data = &fec_info,
-};
-
struct imx_nand_platform_data nand_info = {
.width = 1,
.hw_ecc = 1,
.flash_bbt = 1,
};
-static struct device_d nand_dev = {
- .id = -1,
- .name = "imx_nand",
- .map_base = IMX_NFC_BASE,
- .platform_data = &nand_info,
-};
-
static struct fb_videomode guf_cupid_fb_mode = {
/* 800x480 @ 70 Hz */
.name = "CPT CLAA070LC0JCT",
@@ -109,19 +96,6 @@ static struct imx_ipu_fb_platform_data ipu_fb_data = {
.enable = cupid_fb_enable,
};
-static struct device_d imx_ipu_fb_dev = {
- .id = -1,
- .name = "imx-ipu-fb",
- .map_base = 0x53fc0000,
- .size = 0x1000,
- .platform_data = &ipu_fb_data,
-};
-
-static struct device_d esdhc_dev = {
- .name = "imx-esdhc",
- .map_base = IMX_SDHC1_BASE,
-};
-
#ifdef CONFIG_MMU
static int cupid_mmu_init(void)
{
@@ -157,8 +131,8 @@ static int cupid_devices_init(void)
else
nand_info.width = 1; /* 8 bit */
- register_device(&fec_dev);
- register_device(&nand_dev);
+ imx35_add_fec(&fec_info);
+ imx35_add_nand(&nand_info);
devfs_add_partition("nand0", 0x00000, 0x40000, PARTITION_FIXED, "self_raw");
dev_add_bb_dev("self_raw", "self0");
@@ -168,8 +142,8 @@ static int cupid_devices_init(void)
sdram_dev = add_mem_device("ram0", IMX_SDRAM_CS0, 128 * 1024 * 1024,
IORESOURCE_MEM_WRITEABLE);
armlinux_add_dram(sdram_dev);
- register_device(&imx_ipu_fb_dev);
- register_device(&esdhc_dev);
+ imx35_add_fb(&ipu_fb_data);
+ imx35_add_mmc0(NULL);
armlinux_set_bootparams((void *)0x80000100);
armlinux_set_architecture(MACH_TYPE_GUF_CUPID);
@@ -179,13 +153,6 @@ static int cupid_devices_init(void)
device_initcall(cupid_devices_init);
-static struct device_d cupid_serial_device = {
- .id = -1,
- .name = "imx_serial",
- .map_base = IMX_UART1_BASE,
- .size = 16 * 1024,
-};
-
static struct pad_desc cupid_pads[] = {
/* UART1 */
MX35_PAD_CTS1__UART1_CTS,
@@ -278,7 +245,8 @@ static int cupid_console_init(void)
{
mxc_iomux_v3_setup_multiple_pads(cupid_pads, ARRAY_SIZE(cupid_pads));
- register_device(&cupid_serial_device);
+ imx35_add_uart0();
+
return 0;
}
--
1.7.5.4
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH 3/8] ARM i.MX pca100: use device registration helpers
2011-07-28 8:00 switch more devices to use resources Sascha Hauer
2011-07-28 8:00 ` [PATCH 1/8] ARM i.MX: add helper for usb device registration Sascha Hauer
2011-07-28 8:00 ` [PATCH 2/8] ARM i.MX cupid: use device registration helpers Sascha Hauer
@ 2011-07-28 8:00 ` Sascha Hauer
2011-07-28 8:00 ` [PATCH 4/8] ARM i.MX scb9328: create uart registration helpers and use them Sascha Hauer
` (4 subsequent siblings)
7 siblings, 0 replies; 10+ messages in thread
From: Sascha Hauer @ 2011-07-28 8:00 UTC (permalink / raw)
To: barebox
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
arch/arm/boards/phycard-i.MX27/pca100.c | 9 +--------
1 files changed, 1 insertions(+), 8 deletions(-)
diff --git a/arch/arm/boards/phycard-i.MX27/pca100.c b/arch/arm/boards/phycard-i.MX27/pca100.c
index 8c36a3f..d196e55 100644
--- a/arch/arm/boards/phycard-i.MX27/pca100.c
+++ b/arch/arm/boards/phycard-i.MX27/pca100.c
@@ -225,17 +225,10 @@ static int pca100_devices_init(void)
device_initcall(pca100_devices_init);
-static struct device_d pca100_serial_device = {
- .id = -1,
- .name = "imx_serial",
- .map_base = IMX_UART1_BASE,
- .size = 4096,
-};
-
static int pca100_console_init(void)
{
pca100_mmu_init();
- register_device(&pca100_serial_device);
+ imx27_add_uart0();
return 0;
}
--
1.7.5.4
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH 4/8] ARM i.MX scb9328: create uart registration helpers and use them
2011-07-28 8:00 switch more devices to use resources Sascha Hauer
` (2 preceding siblings ...)
2011-07-28 8:00 ` [PATCH 3/8] ARM i.MX pca100: " Sascha Hauer
@ 2011-07-28 8:00 ` Sascha Hauer
2011-07-28 8:00 ` [PATCH 5/8] ARM i.MX35 3stack: use device registration helpers Sascha Hauer
` (3 subsequent siblings)
7 siblings, 0 replies; 10+ messages in thread
From: Sascha Hauer @ 2011-07-28 8:00 UTC (permalink / raw)
To: barebox
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
arch/arm/boards/scb9328/scb9328.c | 11 +++--------
arch/arm/mach-imx/include/mach/devices-imx1.h | 11 +++++++++++
2 files changed, 14 insertions(+), 8 deletions(-)
create mode 100644 arch/arm/mach-imx/include/mach/devices-imx1.h
diff --git a/arch/arm/boards/scb9328/scb9328.c b/arch/arm/boards/scb9328/scb9328.c
index d49eaff..cf72ef4 100644
--- a/arch/arm/boards/scb9328/scb9328.c
+++ b/arch/arm/boards/scb9328/scb9328.c
@@ -32,6 +32,7 @@
#include <fcntl.h>
#include <dm9000.h>
#include <led.h>
+#include <mach/devices-imx1.h>
static struct dm9000_platform_data dm9000_data = {
.buswidth = DM9000_WIDTH_16,
@@ -120,20 +121,14 @@ static int scb9328_devices_init(void)
device_initcall(scb9328_devices_init);
-static struct device_d scb9328_serial_device = {
- .id = -1,
- .name = "imx_serial",
- .map_base = IMX_UART1_BASE,
- .size = 4096,
-};
-
static int scb9328_console_init(void)
{
/* init gpios for serial port */
imx_gpio_mode(PC11_PF_UART1_TXD);
imx_gpio_mode(PC12_PF_UART1_RXD);
- register_device(&scb9328_serial_device);
+ imx1_add_uart0();
+
return 0;
}
diff --git a/arch/arm/mach-imx/include/mach/devices-imx1.h b/arch/arm/mach-imx/include/mach/devices-imx1.h
new file mode 100644
index 0000000..a45363f
--- /dev/null
+++ b/arch/arm/mach-imx/include/mach/devices-imx1.h
@@ -0,0 +1,11 @@
+#include <mach/devices.h>
+
+static inline struct device_d *imx1_add_uart0(void)
+{
+ return imx_add_uart((void *)IMX_UART1_BASE, 0);
+}
+
+static inline struct device_d *imx1_add_uart1(void)
+{
+ return imx_add_uart((void *)IMX_UART2_BASE, 1);
+}
--
1.7.5.4
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH 5/8] ARM i.MX35 3stack: use device registration helpers
2011-07-28 8:00 switch more devices to use resources Sascha Hauer
` (3 preceding siblings ...)
2011-07-28 8:00 ` [PATCH 4/8] ARM i.MX scb9328: create uart registration helpers and use them Sascha Hauer
@ 2011-07-28 8:00 ` Sascha Hauer
2011-07-28 8:01 ` [PATCH 6/8] ARM i.MX21ads : " Sascha Hauer
` (2 subsequent siblings)
7 siblings, 0 replies; 10+ messages in thread
From: Sascha Hauer @ 2011-07-28 8:00 UTC (permalink / raw)
To: barebox
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
arch/arm/boards/freescale-mx35-3-stack/3stack.c | 18 +++---------------
1 files changed, 3 insertions(+), 15 deletions(-)
diff --git a/arch/arm/boards/freescale-mx35-3-stack/3stack.c b/arch/arm/boards/freescale-mx35-3-stack/3stack.c
index 9113650..e513439 100644
--- a/arch/arm/boards/freescale-mx35-3-stack/3stack.c
+++ b/arch/arm/boards/freescale-mx35-3-stack/3stack.c
@@ -69,13 +69,6 @@ struct imx_nand_platform_data nand_info = {
.flash_bbt = 1,
};
-static struct device_d smc911x_dev = {
- .id = -1,
- .name = "smc911x",
- .map_base = IMX_CS5_BASE,
- .size = IMX_CS5_RANGE,
-};
-
static struct i2c_board_info i2c_devices[] = {
{
I2C_BOARD_INFO("mc13892-i2c", 0x08),
@@ -84,12 +77,6 @@ static struct i2c_board_info i2c_devices[] = {
},
};
-static struct device_d i2c_dev = {
- .id = -1,
- .name = "i2c-imx",
- .map_base = IMX_I2C1_BASE,
-};
-
/*
* Generic display, shipped with the PDK
*/
@@ -183,10 +170,11 @@ static int f3s_devices_init(void)
set_silicon_rev(imx_silicon_revision());
i2c_register_board_info(0, i2c_devices, ARRAY_SIZE(i2c_devices));
- register_device(&i2c_dev);
+ imx35_add_i2c0(NULL);
imx35_add_fec(&fec_info);
- register_device(&smc911x_dev);
+ add_generic_device("smc911x", -1, NULL, IMX_CS5_BASE, IMX_CS5_RANGE,
+ IORESOURCE_MEM, NULL);
imx35_add_mmc0(NULL);
--
1.7.5.4
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH 6/8] ARM i.MX21ads : use device registration helpers
2011-07-28 8:00 switch more devices to use resources Sascha Hauer
` (4 preceding siblings ...)
2011-07-28 8:00 ` [PATCH 5/8] ARM i.MX35 3stack: use device registration helpers Sascha Hauer
@ 2011-07-28 8:01 ` Sascha Hauer
2011-07-28 8:01 ` [PATCH 7/8] ARM i.MX pcm037: " Sascha Hauer
2011-07-28 8:01 ` [PATCH 8/8] add a ns16550 registration helper and use it Sascha Hauer
7 siblings, 0 replies; 10+ messages in thread
From: Sascha Hauer @ 2011-07-28 8:01 UTC (permalink / raw)
To: barebox
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
arch/arm/boards/imx21ads/imx21ads.c | 10 ++--------
1 files changed, 2 insertions(+), 8 deletions(-)
diff --git a/arch/arm/boards/imx21ads/imx21ads.c b/arch/arm/boards/imx21ads/imx21ads.c
index 854f7ab..2661064 100644
--- a/arch/arm/boards/imx21ads/imx21ads.c
+++ b/arch/arm/boards/imx21ads/imx21ads.c
@@ -46,13 +46,6 @@ struct imx_nand_platform_data nand_info = {
.hw_ecc = 1,
};
-static struct device_d cs8900_dev = {
- .id = -1,
- .name = "cs8900",
- .map_base = IMX_CS1_BASE,
- // IRQ is connected to UART3_RTS
-};
-
/* Sharp LQ035Q7DB02 QVGA display */
static struct imx_fb_videomode imx_fb_modedata = {
.mode = {
@@ -169,7 +162,8 @@ static int mx21ads_devices_init(void)
IORESOURCE_MEM_WRITEABLE);
armlinux_add_dram(sdram_dev);
imx21_add_nand(&nand_info);
- register_device(&cs8900_dev);
+ add_generic_device("cs8900", -1, NULL, IMX_CS1_BASE, 0x1000,
+ IORESOURCE_MEM, NULL);
imx21_add_fb(&imx_fb_data);
armlinux_set_bootparams((void *)0xc0000100);
--
1.7.5.4
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH 7/8] ARM i.MX pcm037: use device registration helpers
2011-07-28 8:00 switch more devices to use resources Sascha Hauer
` (5 preceding siblings ...)
2011-07-28 8:01 ` [PATCH 6/8] ARM i.MX21ads : " Sascha Hauer
@ 2011-07-28 8:01 ` Sascha Hauer
2011-07-28 8:01 ` [PATCH 8/8] add a ns16550 registration helper and use it Sascha Hauer
7 siblings, 0 replies; 10+ messages in thread
From: Sascha Hauer @ 2011-07-28 8:01 UTC (permalink / raw)
To: barebox
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
arch/arm/boards/pcm037/pcm037.c | 21 ++++++++-------------
1 files changed, 8 insertions(+), 13 deletions(-)
diff --git a/arch/arm/boards/pcm037/pcm037.c b/arch/arm/boards/pcm037/pcm037.c
index af4ad8b..839138d 100644
--- a/arch/arm/boards/pcm037/pcm037.c
+++ b/arch/arm/boards/pcm037/pcm037.c
@@ -39,18 +39,6 @@
#include <mach/imx-nand.h>
#include <mach/devices-imx31.h>
-/*
- * SMSC 9217 network controller
- * connected to CS line 1 and interrupt line
- * GPIO3, data width is 16 bit
- */
-static struct device_d network_dev = {
- .id = -1,
- .name = "smc911x",
- .map_base = IMX_CS1_BASE,
- .size = IMX_CS1_RANGE, /* area size */
-};
-
#if defined CONFIG_PCM037_SDRAM_BANK0_128MB
#define SDRAM0 128
#elif defined CONFIG_PCM037_SDRAM_BANK0_256MB
@@ -224,7 +212,14 @@ static int imx31_devices_init(void)
add_mem_device("sram0", IMX_CS4_BASE, IMX_CS4_RANGE, /* area size */
IORESOURCE_MEM_WRITEABLE);
imx31_add_nand(&nand_info);
- register_device(&network_dev);
+
+ /*
+ * SMSC 9217 network controller
+ * connected to CS line 1 and interrupt line
+ * GPIO3, data width is 16 bit
+ */
+ add_generic_device("smc911x", -1, NULL, IMX_CS1_BASE, IMX_CS1_RANGE,
+ IORESOURCE_MEM, NULL);
sdram_dev = add_mem_device("ram0", IMX_SDRAM_CS1, SDRAM0 * 1024 * 1024,
IORESOURCE_MEM_WRITEABLE);
--
1.7.5.4
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH 8/8] add a ns16550 registration helper and use it
2011-07-28 8:00 switch more devices to use resources Sascha Hauer
` (6 preceding siblings ...)
2011-07-28 8:01 ` [PATCH 7/8] ARM i.MX pcm037: " Sascha Hauer
@ 2011-07-28 8:01 ` Sascha Hauer
2011-07-28 8:28 ` Sascha Hauer
7 siblings, 1 reply; 10+ messages in thread
From: Sascha Hauer @ 2011-07-28 8:01 UTC (permalink / raw)
To: barebox
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
arch/arm/boards/eukrea_cpuimx27/eukrea_cpuimx27.c | 10 +-------
arch/arm/boards/omap/board-beagle.c | 12 ++--------
arch/arm/boards/omap/board-omap3evm.c | 22 ++++++++------------
arch/arm/boards/omap/board-sdp343x.c | 12 ++--------
arch/arm/boards/panda/board.c | 12 ++--------
arch/arm/boards/pcm049/board.c | 12 ++--------
arch/x86/boards/x86_generic/generic_pc.c | 15 +++----------
include/driver.h | 7 ++++++
8 files changed, 34 insertions(+), 68 deletions(-)
diff --git a/arch/arm/boards/eukrea_cpuimx27/eukrea_cpuimx27.c b/arch/arm/boards/eukrea_cpuimx27/eukrea_cpuimx27.c
index 4e69bbc..fa910b9 100644
--- a/arch/arm/boards/eukrea_cpuimx27/eukrea_cpuimx27.c
+++ b/arch/arm/boards/eukrea_cpuimx27/eukrea_cpuimx27.c
@@ -100,13 +100,6 @@ static struct NS16550_plat quad_uart_serial_plat = {
#define QUART_OFFSET 0x1000000
#endif
-static struct device_d quad_uart_serial_device = {
- .id = -1,
- .name = "serial_ns16550",
- .map_base = IMX_CS3_BASE + QUART_OFFSET,
- .size = 0xF,
- .platform_data = (void *)&quad_uart_serial_plat,
-};
#endif
static struct i2c_board_info i2c_devices[] = {
@@ -295,7 +288,8 @@ static int eukrea_cpuimx27_console_init(void)
CS3L = 0x0D1D0D01;
CS3A = 0x00D20000;
#ifdef CONFIG_DRIVER_SERIAL_NS16550
- register_device(&quad_uart_serial_device);
+ add_ns16550_device(-1, IMX_CS3_BASE + QUART_OFFSET, 0xf,
+ &quad_uart_serial_plat);
#endif
return 0;
}
diff --git a/arch/arm/boards/omap/board-beagle.c b/arch/arm/boards/omap/board-beagle.c
index 107a009..191496a 100644
--- a/arch/arm/boards/omap/board-beagle.c
+++ b/arch/arm/boards/omap/board-beagle.c
@@ -242,14 +242,6 @@ static struct NS16550_plat serial_plat = {
.reg_write = omap_uart_write,
};
-static struct device_d beagle_serial_device = {
- .id = -1,
- .name = "serial_ns16550",
- .map_base = OMAP_UART3_BASE,
- .size = 1024,
- .platform_data = (void *)&serial_plat,
-};
-
/**
* @brief UART serial port initialization - remember to enable COM clocks in
* arch
@@ -259,7 +251,9 @@ static struct device_d beagle_serial_device = {
static int beagle_console_init(void)
{
/* Register the serial port */
- return register_device(&beagle_serial_device);
+ add_ns16550_device(-1, OMAP_UART3_BASE, 1024, &serial_plat);
+
+ return 0;
}
console_initcall(beagle_console_init);
#endif /* CONFIG_DRIVER_SERIAL_NS16550 */
diff --git a/arch/arm/boards/omap/board-omap3evm.c b/arch/arm/boards/omap/board-omap3evm.c
index d555da4..071e374 100644
--- a/arch/arm/boards/omap/board-omap3evm.c
+++ b/arch/arm/boards/omap/board-omap3evm.c
@@ -218,18 +218,6 @@ static struct NS16550_plat serial_plat = {
.reg_write = omap_uart_write,
};
-static struct device_d omap3evm_serial_device = {
- .id = -1,
- .name = "serial_ns16550",
-#if defined(CONFIG_OMAP3EVM_UART1)
- .map_base = OMAP_UART1_BASE,
-#elif defined(CONFIG_OMAP3EVM_UART3)
- .map_base = OMAP_UART3_BASE,
-#endif
- .size = 1024,
- .platform_data = (void *)&serial_plat,
-};
-
/**
* @brief Initialize the serial port to be used as console.
*
@@ -237,7 +225,15 @@ static struct device_d omap3evm_serial_device = {
*/
static int omap3evm_init_console(void)
{
- return register_device(&omap3evm_serial_device);
+ add_ns16550_device(-1,
+#if defined(CONFIG_OMAP3EVM_UART1)
+ OMAP_UART1_BASE,
+#elif defined(CONFIG_OMAP3EVM_UART3)
+ OMAP_UART3_BASE,
+#endif
+ 1024, &serial_plat);
+
+ return 0;
}
console_initcall(omap3evm_init_console);
#endif /* CONFIG_DRIVER_SERIAL_NS16550 */
diff --git a/arch/arm/boards/omap/board-sdp343x.c b/arch/arm/boards/omap/board-sdp343x.c
index 04aa302..8e8d952 100644
--- a/arch/arm/boards/omap/board-sdp343x.c
+++ b/arch/arm/boards/omap/board-sdp343x.c
@@ -610,14 +610,6 @@ static struct NS16550_plat serial_plat = {
.reg_write = omap_uart_write,
};
-static struct device_d sdp3430_serial_device = {
- .id = -1,
- .name = "serial_ns16550",
- .map_base = OMAP_UART3_BASE,
- .size = 1024,
- .platform_data = (void *)&serial_plat,
-};
-
/**
* @brief UART serial port initialization - remember to enable COM clocks in arch
*
@@ -626,7 +618,9 @@ static struct device_d sdp3430_serial_device = {
static int sdp3430_console_init(void)
{
/* Register the serial port */
- return register_device(&sdp3430_serial_device);
+ add_ns16550_device(-1, OMAP_UART3_BASE, 1024, &serial_plat);
+
+ return 0;
}
console_initcall(sdp3430_console_init);
diff --git a/arch/arm/boards/panda/board.c b/arch/arm/boards/panda/board.c
index c5b1e5c..1c6cf58 100644
--- a/arch/arm/boards/panda/board.c
+++ b/arch/arm/boards/panda/board.c
@@ -37,18 +37,12 @@ static struct NS16550_plat serial_plat = {
.reg_write = omap_uart_write,
};
-static struct device_d panda_serial_device = {
- .id = -1,
- .name = "serial_ns16550",
- .map_base = OMAP44XX_UART3_BASE,
- .size = 1024,
- .platform_data = (void *)&serial_plat,
-};
-
static int panda_console_init(void)
{
/* Register the serial port */
- return register_device(&panda_serial_device);
+ add_ns16550_device(-1, OMAP44XX_UART3_BASE, 1024, &serial_plat);
+
+ return 0;
}
console_initcall(panda_console_init);
diff --git a/arch/arm/boards/pcm049/board.c b/arch/arm/boards/pcm049/board.c
index 1b7923f..7eae2cf 100644
--- a/arch/arm/boards/pcm049/board.c
+++ b/arch/arm/boards/pcm049/board.c
@@ -48,18 +48,12 @@ static struct NS16550_plat serial_plat = {
.reg_write = omap_uart_write,
};
-static struct device_d pcm049_serial_device = {
- .id = -1,
- .name = "serial_ns16550",
- .map_base = OMAP44XX_UART3_BASE,
- .size = 1024,
- .platform_data = (void *)&serial_plat,
-};
-
static int pcm049_console_init(void)
{
/* Register the serial port */
- return register_device(&pcm049_serial_device);
+ add_ns16550_device(-1, OMAP44XX_UART3_BASE, 1024, &serial_plat);
+
+ return 0;
}
console_initcall(pcm049_console_init);
diff --git a/arch/x86/boards/x86_generic/generic_pc.c b/arch/x86/boards/x86_generic/generic_pc.c
index fa2975f..d031c52 100644
--- a/arch/x86/boards/x86_generic/generic_pc.c
+++ b/arch/x86/boards/x86_generic/generic_pc.c
@@ -83,19 +83,12 @@ static struct NS16550_plat serial_plat = {
.reg_write = x86_uart_write,
};
-/* we are expecting always one serial interface */
-static struct device_d generic_pc_serial_device = {
- .id = -1,
- .name = "serial_ns16550",
- .map_base = 0x3f8,
- .size = 8,
- .platform_data = (void *)&serial_plat,
-};
-
static int pc_console_init(void)
{
- /* Register the serial port */
- return register_device(&generic_pc_serial_device);
+ /* Register the serial port */
+ add_ns16550_device(-1, 0x3f8, 8, &serial_plat);
+
+ return 0;
}
console_initcall(pc_console_init);
diff --git a/include/driver.h b/include/driver.h
index af34803..ab2a074 100644
--- a/include/driver.h
+++ b/include/driver.h
@@ -227,6 +227,13 @@ static inline struct device_d *add_cfi_flash_device(int id, resource_size_t star
IORESOURCE_MEM | flags, NULL);
}
+static inline struct device_d *add_ns16550_device(int id, resource_size_t start,
+ resource_size_t size, struct NS16550_plat *pdata)
+{
+ return add_generic_device("serial_ns16550", id, NULL, start, size,
+ IORESOURCE_MEM, pdata);
+}
+
/* linear list over all available devices
*/
extern struct list_head device_list;
--
1.7.5.4
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 8/8] add a ns16550 registration helper and use it
2011-07-28 8:01 ` [PATCH 8/8] add a ns16550 registration helper and use it Sascha Hauer
@ 2011-07-28 8:28 ` Sascha Hauer
0 siblings, 0 replies; 10+ messages in thread
From: Sascha Hauer @ 2011-07-28 8:28 UTC (permalink / raw)
To: barebox
On Thu, Jul 28, 2011 at 10:01:02AM +0200, Sascha Hauer wrote:
> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
> ---
> arch/arm/boards/eukrea_cpuimx27/eukrea_cpuimx27.c | 10 +-------
> arch/arm/boards/omap/board-beagle.c | 12 ++--------
> arch/arm/boards/omap/board-omap3evm.c | 22 ++++++++------------
> arch/arm/boards/omap/board-sdp343x.c | 12 ++--------
> arch/arm/boards/panda/board.c | 12 ++--------
> arch/arm/boards/pcm049/board.c | 12 ++--------
> arch/x86/boards/x86_generic/generic_pc.c | 15 +++----------
> include/driver.h | 7 ++++++
> 8 files changed, 34 insertions(+), 68 deletions(-)
>
> diff --git a/include/driver.h b/include/driver.h
> index af34803..ab2a074 100644
> --- a/include/driver.h
> +++ b/include/driver.h
> @@ -227,6 +227,13 @@ static inline struct device_d *add_cfi_flash_device(int id, resource_size_t star
> IORESOURCE_MEM | flags, NULL);
> }
>
We need
struct NS16550_plat;
here to not break compilation. Fixed.
Sascha
> +static inline struct device_d *add_ns16550_device(int id, resource_size_t start,
> + resource_size_t size, struct NS16550_plat *pdata)
> +{
> + return add_generic_device("serial_ns16550", id, NULL, start, size,
> + IORESOURCE_MEM, pdata);
> +}
> +
> /* linear list over all available devices
> */
> extern struct list_head device_list;
> --
> 1.7.5.4
>
>
--
Pengutronix e.K. | |
Industrial Linux Solutions | http://www.pengutronix.de/ |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 10+ messages in thread