Blackfin: bf537-stamp: add CAN resources
authorBarry Song <barry.song@analog.com>
Mon, 2 Nov 2009 07:29:07 +0000 (07:29 +0000)
committerMike Frysinger <vapier@gentoo.org>
Tue, 15 Dec 2009 05:16:38 +0000 (00:16 -0500)
Signed-off-by: Barry Song <barry.song@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
arch/blackfin/mach-bf537/boards/stamp.c
arch/blackfin/mach-bf538/boards/ezkit.c
arch/blackfin/mach-bf548/boards/ezkit.c

index 187e6fd7696838748d0b49c501a1bd72032f16cb..70349d3817e0ebe5f151b1a4e9233b3cbe54d946 100644 (file)
@@ -302,6 +302,44 @@ static struct platform_device isp1362_hcd_device = {
 };
 #endif
 
+#if defined(CONFIG_CAN_BFIN) || defined(CONFIG_CAN_BFIN_MODULE)
+unsigned short bfin_can_peripherals[] = {
+       P_CAN0_RX, P_CAN0_TX, 0
+};
+
+static struct resource bfin_can_resources[] = {
+       {
+               .start = 0xFFC02A00,
+               .end = 0xFFC02FFF,
+               .flags = IORESOURCE_MEM,
+       },
+       {
+               .start = IRQ_CAN_RX,
+               .end = IRQ_CAN_RX,
+               .flags = IORESOURCE_IRQ,
+       },
+       {
+               .start = IRQ_CAN_TX,
+               .end = IRQ_CAN_TX,
+               .flags = IORESOURCE_IRQ,
+       },
+       {
+               .start = IRQ_CAN_ERROR,
+               .end = IRQ_CAN_ERROR,
+               .flags = IORESOURCE_IRQ,
+       },
+};
+
+static struct platform_device bfin_can_device = {
+       .name = "bfin_can",
+       .num_resources = ARRAY_SIZE(bfin_can_resources),
+       .resource = bfin_can_resources,
+       .dev = {
+               .platform_data = &bfin_can_peripherals, /* Passed to driver */
+       },
+};
+#endif
+
 #if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE)
 static struct platform_device bfin_mii_bus = {
        .name = "bfin_mii_bus",
@@ -1675,6 +1713,10 @@ static struct platform_device *stamp_devices[] __initdata = {
        &ax88180_device,
 #endif
 
+#if defined(CONFIG_CAN_BFIN) || defined(CONFIG_CAN_BFIN_MODULE)
+       &bfin_can_device,
+#endif
+
 #if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE)
        &bfin_mii_bus,
        &bfin_mac_device,
index 14af5c2088d44192f70b383e6ea9eb3ae2ec18e6..c296bb1ed50370230b756fff443479c980de01ac 100644 (file)
@@ -151,6 +151,44 @@ static struct platform_device bfin_sir2_device = {
 #endif
 #endif
 
+#if defined(CONFIG_CAN_BFIN) || defined(CONFIG_CAN_BFIN_MODULE)
+unsigned short bfin_can_peripherals[] = {
+       P_CAN0_RX, P_CAN0_TX, 0
+};
+
+static struct resource bfin_can_resources[] = {
+       {
+               .start = 0xFFC02A00,
+               .end = 0xFFC02FFF,
+               .flags = IORESOURCE_MEM,
+       },
+       {
+               .start = IRQ_CAN_RX,
+               .end = IRQ_CAN_RX,
+               .flags = IORESOURCE_IRQ,
+       },
+       {
+               .start = IRQ_CAN_TX,
+               .end = IRQ_CAN_TX,
+               .flags = IORESOURCE_IRQ,
+       },
+       {
+               .start = IRQ_CAN_ERROR,
+               .end = IRQ_CAN_ERROR,
+               .flags = IORESOURCE_IRQ,
+       },
+};
+
+static struct platform_device bfin_can_device = {
+       .name = "bfin_can",
+       .num_resources = ARRAY_SIZE(bfin_can_resources),
+       .resource = bfin_can_resources,
+       .dev = {
+               .platform_data = &bfin_can_peripherals, /* Passed to driver */
+       },
+};
+#endif
+
 /*
  *  USB-LAN EzExtender board
  *  Driver needs to know address, irq and flag pin.
@@ -610,6 +648,10 @@ static struct platform_device *cm_bf538_devices[] __initdata = {
 #endif
 #endif
 
+#if defined(CONFIG_CAN_BFIN) || defined(CONFIG_CAN_BFIN_MODULE)
+       &bfin_can_device,
+#endif
+
 #if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
        &smc91x_device,
 #endif
index fa44ea2a52014c138f16c21317348f35bc921048..60193f72777c5d07f7bec6f46f16bfd46ce98a0c 100644 (file)
@@ -464,6 +464,44 @@ static struct platform_device musb_device = {
 };
 #endif
 
+#if defined(CONFIG_CAN_BFIN) || defined(CONFIG_CAN_BFIN_MODULE)
+unsigned short bfin_can_peripherals[] = {
+       P_CAN0_RX, P_CAN0_TX, 0
+};
+
+static struct resource bfin_can_resources[] = {
+       {
+               .start = 0xFFC02A00,
+               .end = 0xFFC02FFF,
+               .flags = IORESOURCE_MEM,
+       },
+       {
+               .start = IRQ_CAN0_RX,
+               .end = IRQ_CAN0_RX,
+               .flags = IORESOURCE_IRQ,
+       },
+       {
+               .start = IRQ_CAN0_TX,
+               .end = IRQ_CAN0_TX,
+               .flags = IORESOURCE_IRQ,
+       },
+       {
+               .start = IRQ_CAN0_ERROR,
+               .end = IRQ_CAN0_ERROR,
+               .flags = IORESOURCE_IRQ,
+       },
+};
+
+static struct platform_device bfin_can_device = {
+       .name = "bfin_can",
+       .num_resources = ARRAY_SIZE(bfin_can_resources),
+       .resource = bfin_can_resources,
+       .dev = {
+               .platform_data = &bfin_can_peripherals, /* Passed to driver */
+       },
+};
+#endif
+
 #if defined(CONFIG_PATA_BF54X) || defined(CONFIG_PATA_BF54X_MODULE)
 static struct resource bfin_atapi_resources[] = {
        {
@@ -956,6 +994,10 @@ static struct platform_device *ezkit_devices[] __initdata = {
        &bfin_isp1760_device,
 #endif
 
+#if defined(CONFIG_CAN_BFIN) || defined(CONFIG_CAN_BFIN_MODULE)
+       &bfin_can_device,
+#endif
+
 #if defined(CONFIG_PATA_BF54X) || defined(CONFIG_PATA_BF54X_MODULE)
        &bfin_atapi_device,
 #endif