diff options
author | Bryan Wu <bryan.wu@analog.com> | 2007-11-12 10:24:42 -0500 |
---|---|---|
committer | Bryan Wu <bryan.wu@analog.com> | 2007-11-12 10:24:42 -0500 |
commit | 5d448dd50712ae42f8176b5bb8db4703bef6f0f5 (patch) | |
tree | bc0912451dacdb40393516362171da19317800aa | |
parent | 4a589e1ef67fdb2d5fa783117da8dc7cba576af4 (diff) |
Blackfin arch: move hard coded pin_req to board file
Remove some sort of bloaty code, try to get these pin_req arrays built at compile-time
- move this static things to the blackfin board file
- add pin_req array to struct bfin5xx_spi_master
- tested on BF537/BF548 with SPI flash
Signed-off-by: Bryan Wu <bryan.wu@analog.com>
-rw-r--r-- | arch/blackfin/mach-bf527/boards/ezkit.c | 2 | ||||
-rw-r--r-- | arch/blackfin/mach-bf533/boards/H8606.c | 2 | ||||
-rw-r--r-- | arch/blackfin/mach-bf533/boards/cm_bf533.c | 2 | ||||
-rw-r--r-- | arch/blackfin/mach-bf533/boards/ezkit.c | 2 | ||||
-rw-r--r-- | arch/blackfin/mach-bf533/boards/stamp.c | 2 | ||||
-rw-r--r-- | arch/blackfin/mach-bf537/boards/cm_bf537.c | 2 | ||||
-rw-r--r-- | arch/blackfin/mach-bf537/boards/generic_board.c | 2 | ||||
-rw-r--r-- | arch/blackfin/mach-bf537/boards/pnav10.c | 2 | ||||
-rw-r--r-- | arch/blackfin/mach-bf537/boards/stamp.c | 2 | ||||
-rw-r--r-- | arch/blackfin/mach-bf548/boards/ezkit.c | 14 | ||||
-rw-r--r-- | arch/blackfin/mach-bf561/boards/cm_bf561.c | 2 | ||||
-rw-r--r-- | arch/blackfin/mach-bf561/boards/ezkit.c | 2 |
12 files changed, 33 insertions, 3 deletions
diff --git a/arch/blackfin/mach-bf527/boards/ezkit.c b/arch/blackfin/mach-bf527/boards/ezkit.c index bf1bedcc886..88b41b71bff 100644 --- a/arch/blackfin/mach-bf527/boards/ezkit.c +++ b/arch/blackfin/mach-bf527/boards/ezkit.c | |||
@@ -46,6 +46,7 @@ | |||
46 | #include <asm/bfin5xx_spi.h> | 46 | #include <asm/bfin5xx_spi.h> |
47 | #include <asm/reboot.h> | 47 | #include <asm/reboot.h> |
48 | #include <asm/nand.h> | 48 | #include <asm/nand.h> |
49 | #include <asm/portmux.h> | ||
49 | #include <linux/spi/ad7877.h> | 50 | #include <linux/spi/ad7877.h> |
50 | 51 | ||
51 | /* | 52 | /* |
@@ -562,6 +563,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = { | |||
562 | static struct bfin5xx_spi_master bfin_spi0_info = { | 563 | static struct bfin5xx_spi_master bfin_spi0_info = { |
563 | .num_chipselect = 8, | 564 | .num_chipselect = 8, |
564 | .enable_dma = 1, /* master has the ability to do dma transfer */ | 565 | .enable_dma = 1, /* master has the ability to do dma transfer */ |
566 | .pin_req = {P_SPI0_SCK, P_SPI0_MISO, P_SPI0_MOSI, 0}, | ||
565 | }; | 567 | }; |
566 | 568 | ||
567 | /* SPI (0) */ | 569 | /* SPI (0) */ |
diff --git a/arch/blackfin/mach-bf533/boards/H8606.c b/arch/blackfin/mach-bf533/boards/H8606.c index b941550f956..fe2634b5bca 100644 --- a/arch/blackfin/mach-bf533/boards/H8606.c +++ b/arch/blackfin/mach-bf533/boards/H8606.c | |||
@@ -43,6 +43,7 @@ | |||
43 | #include <asm/dma.h> | 43 | #include <asm/dma.h> |
44 | #include <asm/bfin5xx_spi.h> | 44 | #include <asm/bfin5xx_spi.h> |
45 | #include <asm/reboot.h> | 45 | #include <asm/reboot.h> |
46 | #include <asm/portmux.h> | ||
46 | 47 | ||
47 | /* | 48 | /* |
48 | * Name the Board for the /proc/cpuinfo | 49 | * Name the Board for the /proc/cpuinfo |
@@ -269,6 +270,7 @@ static struct resource bfin_spi0_resource[] = { | |||
269 | static struct bfin5xx_spi_master bfin_spi0_info = { | 270 | static struct bfin5xx_spi_master bfin_spi0_info = { |
270 | .num_chipselect = 8, | 271 | .num_chipselect = 8, |
271 | .enable_dma = 1, /* master has the ability to do dma transfer */ | 272 | .enable_dma = 1, /* master has the ability to do dma transfer */ |
273 | .pin_req = {P_SPI0_SCK, P_SPI0_MISO, P_SPI0_MOSI, 0}, | ||
272 | }; | 274 | }; |
273 | 275 | ||
274 | static struct platform_device bfin_spi0_device = { | 276 | static struct platform_device bfin_spi0_device = { |
diff --git a/arch/blackfin/mach-bf533/boards/cm_bf533.c b/arch/blackfin/mach-bf533/boards/cm_bf533.c index a863522a446..97e03d5d5a0 100644 --- a/arch/blackfin/mach-bf533/boards/cm_bf533.c +++ b/arch/blackfin/mach-bf533/boards/cm_bf533.c | |||
@@ -38,6 +38,7 @@ | |||
38 | #include <linux/irq.h> | 38 | #include <linux/irq.h> |
39 | #include <asm/dma.h> | 39 | #include <asm/dma.h> |
40 | #include <asm/bfin5xx_spi.h> | 40 | #include <asm/bfin5xx_spi.h> |
41 | #include <asm/portmux.h> | ||
41 | 42 | ||
42 | /* | 43 | /* |
43 | * Name the Board for the /proc/cpuinfo | 44 | * Name the Board for the /proc/cpuinfo |
@@ -175,6 +176,7 @@ static struct resource bfin_spi0_resource[] = { | |||
175 | static struct bfin5xx_spi_master bfin_spi0_info = { | 176 | static struct bfin5xx_spi_master bfin_spi0_info = { |
176 | .num_chipselect = 8, | 177 | .num_chipselect = 8, |
177 | .enable_dma = 1, /* master has the ability to do dma transfer */ | 178 | .enable_dma = 1, /* master has the ability to do dma transfer */ |
179 | .pin_req = {P_SPI0_SCK, P_SPI0_MISO, P_SPI0_MOSI, 0}, | ||
178 | }; | 180 | }; |
179 | 181 | ||
180 | static struct platform_device bfin_spi0_device = { | 182 | static struct platform_device bfin_spi0_device = { |
diff --git a/arch/blackfin/mach-bf533/boards/ezkit.c b/arch/blackfin/mach-bf533/boards/ezkit.c index 34b63920e27..b2369558d80 100644 --- a/arch/blackfin/mach-bf533/boards/ezkit.c +++ b/arch/blackfin/mach-bf533/boards/ezkit.c | |||
@@ -39,6 +39,7 @@ | |||
39 | #include <linux/irq.h> | 39 | #include <linux/irq.h> |
40 | #include <asm/dma.h> | 40 | #include <asm/dma.h> |
41 | #include <asm/bfin5xx_spi.h> | 41 | #include <asm/bfin5xx_spi.h> |
42 | #include <asm/portmux.h> | ||
42 | 43 | ||
43 | /* | 44 | /* |
44 | * Name the Board for the /proc/cpuinfo | 45 | * Name the Board for the /proc/cpuinfo |
@@ -187,6 +188,7 @@ static struct resource bfin_spi0_resource[] = { | |||
187 | static struct bfin5xx_spi_master bfin_spi0_info = { | 188 | static struct bfin5xx_spi_master bfin_spi0_info = { |
188 | .num_chipselect = 8, | 189 | .num_chipselect = 8, |
189 | .enable_dma = 1, /* master has the ability to do dma transfer */ | 190 | .enable_dma = 1, /* master has the ability to do dma transfer */ |
191 | .pin_req = {P_SPI0_SCK, P_SPI0_MISO, P_SPI0_MOSI, 0}, | ||
190 | }; | 192 | }; |
191 | 193 | ||
192 | static struct platform_device bfin_spi0_device = { | 194 | static struct platform_device bfin_spi0_device = { |
diff --git a/arch/blackfin/mach-bf533/boards/stamp.c b/arch/blackfin/mach-bf533/boards/stamp.c index 62ffa500420..60b031054f5 100644 --- a/arch/blackfin/mach-bf533/boards/stamp.c +++ b/arch/blackfin/mach-bf533/boards/stamp.c | |||
@@ -42,6 +42,7 @@ | |||
42 | #include <asm/dma.h> | 42 | #include <asm/dma.h> |
43 | #include <asm/bfin5xx_spi.h> | 43 | #include <asm/bfin5xx_spi.h> |
44 | #include <asm/reboot.h> | 44 | #include <asm/reboot.h> |
45 | #include <asm/portmux.h> | ||
45 | 46 | ||
46 | /* | 47 | /* |
47 | * Name the Board for the /proc/cpuinfo | 48 | * Name the Board for the /proc/cpuinfo |
@@ -286,6 +287,7 @@ static struct resource bfin_spi0_resource[] = { | |||
286 | static struct bfin5xx_spi_master bfin_spi0_info = { | 287 | static struct bfin5xx_spi_master bfin_spi0_info = { |
287 | .num_chipselect = 8, | 288 | .num_chipselect = 8, |
288 | .enable_dma = 1, /* master has the ability to do dma transfer */ | 289 | .enable_dma = 1, /* master has the ability to do dma transfer */ |
290 | .pin_req = {P_SPI0_SCK, P_SPI0_MISO, P_SPI0_MOSI, 0}, | ||
289 | }; | 291 | }; |
290 | 292 | ||
291 | static struct platform_device bfin_spi0_device = { | 293 | static struct platform_device bfin_spi0_device = { |
diff --git a/arch/blackfin/mach-bf537/boards/cm_bf537.c b/arch/blackfin/mach-bf537/boards/cm_bf537.c index 2915931045e..18bda5412b5 100644 --- a/arch/blackfin/mach-bf537/boards/cm_bf537.c +++ b/arch/blackfin/mach-bf537/boards/cm_bf537.c | |||
@@ -39,6 +39,7 @@ | |||
39 | #include <linux/irq.h> | 39 | #include <linux/irq.h> |
40 | #include <asm/dma.h> | 40 | #include <asm/dma.h> |
41 | #include <asm/bfin5xx_spi.h> | 41 | #include <asm/bfin5xx_spi.h> |
42 | #include <asm/portmux.h> | ||
42 | 43 | ||
43 | /* | 44 | /* |
44 | * Name the Board for the /proc/cpuinfo | 45 | * Name the Board for the /proc/cpuinfo |
@@ -194,6 +195,7 @@ static struct resource bfin_spi0_resource[] = { | |||
194 | static struct bfin5xx_spi_master bfin_spi0_info = { | 195 | static struct bfin5xx_spi_master bfin_spi0_info = { |
195 | .num_chipselect = 8, | 196 | .num_chipselect = 8, |
196 | .enable_dma = 1, /* master has the ability to do dma transfer */ | 197 | .enable_dma = 1, /* master has the ability to do dma transfer */ |
198 | .pin_req = {P_SPI0_SCK, P_SPI0_MISO, P_SPI0_MOSI, 0}, | ||
197 | }; | 199 | }; |
198 | 200 | ||
199 | static struct platform_device bfin_spi0_device = { | 201 | static struct platform_device bfin_spi0_device = { |
diff --git a/arch/blackfin/mach-bf537/boards/generic_board.c b/arch/blackfin/mach-bf537/boards/generic_board.c index 255da7a9848..ed0d26aa31f 100644 --- a/arch/blackfin/mach-bf537/boards/generic_board.c +++ b/arch/blackfin/mach-bf537/boards/generic_board.c | |||
@@ -44,6 +44,7 @@ | |||
44 | #include <asm/dma.h> | 44 | #include <asm/dma.h> |
45 | #include <asm/bfin5xx_spi.h> | 45 | #include <asm/bfin5xx_spi.h> |
46 | #include <asm/reboot.h> | 46 | #include <asm/reboot.h> |
47 | #include <asm/portmux.h> | ||
47 | #include <linux/spi/ad7877.h> | 48 | #include <linux/spi/ad7877.h> |
48 | 49 | ||
49 | /* | 50 | /* |
@@ -513,6 +514,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = { | |||
513 | static struct bfin5xx_spi_master bfin_spi0_info = { | 514 | static struct bfin5xx_spi_master bfin_spi0_info = { |
514 | .num_chipselect = 8, | 515 | .num_chipselect = 8, |
515 | .enable_dma = 1, /* master has the ability to do dma transfer */ | 516 | .enable_dma = 1, /* master has the ability to do dma transfer */ |
517 | .pin_req = {P_SPI0_SCK, P_SPI0_MISO, P_SPI0_MOSI, 0}, | ||
516 | }; | 518 | }; |
517 | 519 | ||
518 | /* SPI (0) */ | 520 | /* SPI (0) */ |
diff --git a/arch/blackfin/mach-bf537/boards/pnav10.c b/arch/blackfin/mach-bf537/boards/pnav10.c index 87b80892678..3c72fc34f14 100644 --- a/arch/blackfin/mach-bf537/boards/pnav10.c +++ b/arch/blackfin/mach-bf537/boards/pnav10.c | |||
@@ -40,6 +40,7 @@ | |||
40 | #include <linux/irq.h> | 40 | #include <linux/irq.h> |
41 | #include <asm/dma.h> | 41 | #include <asm/dma.h> |
42 | #include <asm/bfin5xx_spi.h> | 42 | #include <asm/bfin5xx_spi.h> |
43 | #include <asm/portmux.h> | ||
43 | #include <linux/usb/sl811.h> | 44 | #include <linux/usb/sl811.h> |
44 | 45 | ||
45 | #include <linux/spi/ad7877.h> | 46 | #include <linux/spi/ad7877.h> |
@@ -413,6 +414,7 @@ static struct resource bfin_spi0_resource[] = { | |||
413 | static struct bfin5xx_spi_master bfin_spi0_info = { | 414 | static struct bfin5xx_spi_master bfin_spi0_info = { |
414 | .num_chipselect = 8, | 415 | .num_chipselect = 8, |
415 | .enable_dma = 1, /* master has the ability to do dma transfer */ | 416 | .enable_dma = 1, /* master has the ability to do dma transfer */ |
417 | .pin_req = {P_SPI0_SCK, P_SPI0_MISO, P_SPI0_MOSI, 0}, | ||
416 | }; | 418 | }; |
417 | 419 | ||
418 | static struct platform_device bfin_spi0_device = { | 420 | static struct platform_device bfin_spi0_device = { |
diff --git a/arch/blackfin/mach-bf537/boards/stamp.c b/arch/blackfin/mach-bf537/boards/stamp.c index 5f7b91fbafe..3bd0dad14ae 100644 --- a/arch/blackfin/mach-bf537/boards/stamp.c +++ b/arch/blackfin/mach-bf537/boards/stamp.c | |||
@@ -44,6 +44,7 @@ | |||
44 | #include <asm/dma.h> | 44 | #include <asm/dma.h> |
45 | #include <asm/bfin5xx_spi.h> | 45 | #include <asm/bfin5xx_spi.h> |
46 | #include <asm/reboot.h> | 46 | #include <asm/reboot.h> |
47 | #include <asm/portmux.h> | ||
47 | #include <linux/spi/ad7877.h> | 48 | #include <linux/spi/ad7877.h> |
48 | 49 | ||
49 | /* | 50 | /* |
@@ -513,6 +514,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = { | |||
513 | static struct bfin5xx_spi_master bfin_spi0_info = { | 514 | static struct bfin5xx_spi_master bfin_spi0_info = { |
514 | .num_chipselect = 8, | 515 | .num_chipselect = 8, |
515 | .enable_dma = 1, /* master has the ability to do dma transfer */ | 516 | .enable_dma = 1, /* master has the ability to do dma transfer */ |
517 | .pin_req = {P_SPI0_SCK, P_SPI0_MISO, P_SPI0_MOSI, 0}, | ||
516 | }; | 518 | }; |
517 | 519 | ||
518 | /* SPI (0) */ | 520 | /* SPI (0) */ |
diff --git a/arch/blackfin/mach-bf548/boards/ezkit.c b/arch/blackfin/mach-bf548/boards/ezkit.c index 6b6490e66b3..2d30906626f 100644 --- a/arch/blackfin/mach-bf548/boards/ezkit.c +++ b/arch/blackfin/mach-bf548/boards/ezkit.c | |||
@@ -42,6 +42,7 @@ | |||
42 | #include <asm/dma.h> | 42 | #include <asm/dma.h> |
43 | #include <asm/gpio.h> | 43 | #include <asm/gpio.h> |
44 | #include <asm/nand.h> | 44 | #include <asm/nand.h> |
45 | #include <asm/portmux.h> | ||
45 | #include <asm/mach/bf54x_keys.h> | 46 | #include <asm/mach/bf54x_keys.h> |
46 | #include <linux/input.h> | 47 | #include <linux/input.h> |
47 | #include <linux/spi/ad7877.h> | 48 | #include <linux/spi/ad7877.h> |
@@ -453,9 +454,10 @@ static struct resource bfin_spi1_resource[] = { | |||
453 | }; | 454 | }; |
454 | 455 | ||
455 | /* SPI controller data */ | 456 | /* SPI controller data */ |
456 | static struct bfin5xx_spi_master bf54x_spi_master_info = { | 457 | static struct bfin5xx_spi_master bf54x_spi_master_info0 = { |
457 | .num_chipselect = 8, | 458 | .num_chipselect = 8, |
458 | .enable_dma = 1, /* master has the ability to do dma transfer */ | 459 | .enable_dma = 1, /* master has the ability to do dma transfer */ |
460 | .pin_req = {P_SPI0_SCK, P_SPI0_MISO, P_SPI0_MOSI, 0}, | ||
459 | }; | 461 | }; |
460 | 462 | ||
461 | static struct platform_device bf54x_spi_master0 = { | 463 | static struct platform_device bf54x_spi_master0 = { |
@@ -464,17 +466,23 @@ static struct platform_device bf54x_spi_master0 = { | |||
464 | .num_resources = ARRAY_SIZE(bfin_spi0_resource), | 466 | .num_resources = ARRAY_SIZE(bfin_spi0_resource), |
465 | .resource = bfin_spi0_resource, | 467 | .resource = bfin_spi0_resource, |
466 | .dev = { | 468 | .dev = { |
467 | .platform_data = &bf54x_spi_master_info, /* Passed to driver */ | 469 | .platform_data = &bf54x_spi_master_info0, /* Passed to driver */ |
468 | }, | 470 | }, |
469 | }; | 471 | }; |
470 | 472 | ||
473 | static struct bfin5xx_spi_master bf54x_spi_master_info1 = { | ||
474 | .num_chipselect = 8, | ||
475 | .enable_dma = 1, /* master has the ability to do dma transfer */ | ||
476 | .pin_req = {P_SPI1_SCK, P_SPI1_MISO, P_SPI1_MOSI, 0}, | ||
477 | }; | ||
478 | |||
471 | static struct platform_device bf54x_spi_master1 = { | 479 | static struct platform_device bf54x_spi_master1 = { |
472 | .name = "bfin-spi", | 480 | .name = "bfin-spi", |
473 | .id = 1, /* Bus number */ | 481 | .id = 1, /* Bus number */ |
474 | .num_resources = ARRAY_SIZE(bfin_spi1_resource), | 482 | .num_resources = ARRAY_SIZE(bfin_spi1_resource), |
475 | .resource = bfin_spi1_resource, | 483 | .resource = bfin_spi1_resource, |
476 | .dev = { | 484 | .dev = { |
477 | .platform_data = &bf54x_spi_master_info, /* Passed to driver */ | 485 | .platform_data = &bf54x_spi_master_info1, /* Passed to driver */ |
478 | }, | 486 | }, |
479 | }; | 487 | }; |
480 | #endif /* spi master and devices */ | 488 | #endif /* spi master and devices */ |
diff --git a/arch/blackfin/mach-bf561/boards/cm_bf561.c b/arch/blackfin/mach-bf561/boards/cm_bf561.c index 97aeb43fd8b..9e46b52a319 100644 --- a/arch/blackfin/mach-bf561/boards/cm_bf561.c +++ b/arch/blackfin/mach-bf561/boards/cm_bf561.c | |||
@@ -38,6 +38,7 @@ | |||
38 | #include <linux/irq.h> | 38 | #include <linux/irq.h> |
39 | #include <asm/dma.h> | 39 | #include <asm/dma.h> |
40 | #include <asm/bfin5xx_spi.h> | 40 | #include <asm/bfin5xx_spi.h> |
41 | #include <asm/portmux.h> | ||
41 | 42 | ||
42 | /* | 43 | /* |
43 | * Name the Board for the /proc/cpuinfo | 44 | * Name the Board for the /proc/cpuinfo |
@@ -182,6 +183,7 @@ static struct resource bfin_spi0_resource[] = { | |||
182 | static struct bfin5xx_spi_master bfin_spi0_info = { | 183 | static struct bfin5xx_spi_master bfin_spi0_info = { |
183 | .num_chipselect = 8, | 184 | .num_chipselect = 8, |
184 | .enable_dma = 1, /* master has the ability to do dma transfer */ | 185 | .enable_dma = 1, /* master has the ability to do dma transfer */ |
186 | .pin_req = {P_SPI0_SCK, P_SPI0_MISO, P_SPI0_MOSI, 0}, | ||
185 | }; | 187 | }; |
186 | 188 | ||
187 | static struct platform_device bfin_spi0_device = { | 189 | static struct platform_device bfin_spi0_device = { |
diff --git a/arch/blackfin/mach-bf561/boards/ezkit.c b/arch/blackfin/mach-bf561/boards/ezkit.c index 059d516cec2..6434ca216dd 100644 --- a/arch/blackfin/mach-bf561/boards/ezkit.c +++ b/arch/blackfin/mach-bf561/boards/ezkit.c | |||
@@ -35,6 +35,7 @@ | |||
35 | #include <linux/pata_platform.h> | 35 | #include <linux/pata_platform.h> |
36 | #include <asm/dma.h> | 36 | #include <asm/dma.h> |
37 | #include <asm/bfin5xx_spi.h> | 37 | #include <asm/bfin5xx_spi.h> |
38 | #include <asm/portmux.h> | ||
38 | 39 | ||
39 | /* | 40 | /* |
40 | * Name the Board for the /proc/cpuinfo | 41 | * Name the Board for the /proc/cpuinfo |
@@ -160,6 +161,7 @@ static struct resource bfin_spi0_resource[] = { | |||
160 | static struct bfin5xx_spi_master bfin_spi0_info = { | 161 | static struct bfin5xx_spi_master bfin_spi0_info = { |
161 | .num_chipselect = 8, | 162 | .num_chipselect = 8, |
162 | .enable_dma = 1, /* master has the ability to do dma transfer */ | 163 | .enable_dma = 1, /* master has the ability to do dma transfer */ |
164 | .pin_req = {P_SPI0_SCK, P_SPI0_MISO, P_SPI0_MOSI, 0}, | ||
163 | }; | 165 | }; |
164 | 166 | ||
165 | static struct platform_device bfin_spi0_device = { | 167 | static struct platform_device bfin_spi0_device = { |