diff options
author | Sonic Zhang <sonic.zhang@analog.com> | 2009-09-23 05:37:46 -0400 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2010-03-09 00:30:45 -0500 |
commit | c13ce9fd26c3a0e32b3bf0b00929181e66114ed2 (patch) | |
tree | 2f7093e48f93dfdea691b057d9a7ded6fddedc07 /arch/blackfin/mach-bf537 | |
parent | b635f1912da764c960c044ffd58ba27157aa2c85 (diff) |
Blackfin: add UART/SPORT early platform resources
This lets people easily select the UART/SPORT consoles for early printk
while leveraging the pins declared in the boards file.
Signed-off-by: Sonic Zhang <sonic.zhang@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Diffstat (limited to 'arch/blackfin/mach-bf537')
-rw-r--r-- | arch/blackfin/mach-bf537/boards/cm_bf537e.c | 27 | ||||
-rw-r--r-- | arch/blackfin/mach-bf537/boards/cm_bf537u.c | 27 | ||||
-rw-r--r-- | arch/blackfin/mach-bf537/boards/minotaur.c | 27 | ||||
-rw-r--r-- | arch/blackfin/mach-bf537/boards/pnav10.c | 18 | ||||
-rw-r--r-- | arch/blackfin/mach-bf537/boards/stamp.c | 28 | ||||
-rw-r--r-- | arch/blackfin/mach-bf537/boards/tcm_bf537.c | 27 |
6 files changed, 154 insertions, 0 deletions
diff --git a/arch/blackfin/mach-bf537/boards/cm_bf537e.c b/arch/blackfin/mach-bf537/boards/cm_bf537e.c index b4837776b274..c54331282baa 100644 --- a/arch/blackfin/mach-bf537/boards/cm_bf537e.c +++ b/arch/blackfin/mach-bf537/boards/cm_bf537e.c | |||
@@ -760,6 +760,33 @@ static int __init cm_bf537e_init(void) | |||
760 | 760 | ||
761 | arch_initcall(cm_bf537e_init); | 761 | arch_initcall(cm_bf537e_init); |
762 | 762 | ||
763 | static struct platform_device *cm_bf537e_early_devices[] __initdata = { | ||
764 | #if defined(CONFIG_SERIAL_BFIN_CONSOLE) || defined(CONFIG_EARLY_PRINTK) | ||
765 | #ifdef CONFIG_SERIAL_BFIN_UART0 | ||
766 | &bfin_uart0_device, | ||
767 | #endif | ||
768 | #ifdef CONFIG_SERIAL_BFIN_UART1 | ||
769 | &bfin_uart1_device, | ||
770 | #endif | ||
771 | #endif | ||
772 | |||
773 | #if defined(CONFIG_SERIAL_BFIN_SPORT_CONSOLE) | ||
774 | #ifdef CONFIG_SERIAL_BFIN_SPORT0_UART | ||
775 | &bfin_sport0_uart_device, | ||
776 | #endif | ||
777 | #ifdef CONFIG_SERIAL_BFIN_SPORT1_UART | ||
778 | &bfin_sport1_uart_device, | ||
779 | #endif | ||
780 | #endif | ||
781 | }; | ||
782 | |||
783 | void __init native_machine_early_platform_add_devices(void) | ||
784 | { | ||
785 | printk(KERN_INFO "register early platform devices\n"); | ||
786 | early_platform_add_devices(cm_bf537e_early_devices, | ||
787 | ARRAY_SIZE(cm_bf537e_early_devices)); | ||
788 | } | ||
789 | |||
763 | void bfin_get_ether_addr(char *addr) | 790 | void bfin_get_ether_addr(char *addr) |
764 | { | 791 | { |
765 | random_ether_addr(addr); | 792 | random_ether_addr(addr); |
diff --git a/arch/blackfin/mach-bf537/boards/cm_bf537u.c b/arch/blackfin/mach-bf537/boards/cm_bf537u.c index c6802be65fb1..18daacb00b2c 100644 --- a/arch/blackfin/mach-bf537/boards/cm_bf537u.c +++ b/arch/blackfin/mach-bf537/boards/cm_bf537u.c | |||
@@ -725,6 +725,33 @@ static int __init cm_bf537u_init(void) | |||
725 | 725 | ||
726 | arch_initcall(cm_bf537u_init); | 726 | arch_initcall(cm_bf537u_init); |
727 | 727 | ||
728 | static struct platform_device *cm_bf537u_early_devices[] __initdata = { | ||
729 | #if defined(CONFIG_SERIAL_BFIN_CONSOLE) || defined(CONFIG_EARLY_PRINTK) | ||
730 | #ifdef CONFIG_SERIAL_BFIN_UART0 | ||
731 | &bfin_uart0_device, | ||
732 | #endif | ||
733 | #ifdef CONFIG_SERIAL_BFIN_UART1 | ||
734 | &bfin_uart1_device, | ||
735 | #endif | ||
736 | #endif | ||
737 | |||
738 | #if defined(CONFIG_SERIAL_BFIN_SPORT_CONSOLE) | ||
739 | #ifdef CONFIG_SERIAL_BFIN_SPORT0_UART | ||
740 | &bfin_sport0_uart_device, | ||
741 | #endif | ||
742 | #ifdef CONFIG_SERIAL_BFIN_SPORT1_UART | ||
743 | &bfin_sport1_uart_device, | ||
744 | #endif | ||
745 | #endif | ||
746 | }; | ||
747 | |||
748 | void __init native_machine_early_platform_add_devices(void) | ||
749 | { | ||
750 | printk(KERN_INFO "register early platform devices\n"); | ||
751 | early_platform_add_devices(cm_bf537u_early_devices, | ||
752 | ARRAY_SIZE(cm_bf537u_early_devices)); | ||
753 | } | ||
754 | |||
728 | void bfin_get_ether_addr(char *addr) | 755 | void bfin_get_ether_addr(char *addr) |
729 | { | 756 | { |
730 | random_ether_addr(addr); | 757 | random_ether_addr(addr); |
diff --git a/arch/blackfin/mach-bf537/boards/minotaur.c b/arch/blackfin/mach-bf537/boards/minotaur.c index 6403964490d9..c489d602c590 100644 --- a/arch/blackfin/mach-bf537/boards/minotaur.c +++ b/arch/blackfin/mach-bf537/boards/minotaur.c | |||
@@ -516,6 +516,33 @@ static int __init minotaur_init(void) | |||
516 | 516 | ||
517 | arch_initcall(minotaur_init); | 517 | arch_initcall(minotaur_init); |
518 | 518 | ||
519 | static struct platform_device *minotaur_early_devices[] __initdata = { | ||
520 | #if defined(CONFIG_SERIAL_BFIN_CONSOLE) || defined(CONFIG_EARLY_PRINTK) | ||
521 | #ifdef CONFIG_SERIAL_BFIN_UART0 | ||
522 | &bfin_uart0_device, | ||
523 | #endif | ||
524 | #ifdef CONFIG_SERIAL_BFIN_UART1 | ||
525 | &bfin_uart1_device, | ||
526 | #endif | ||
527 | #endif | ||
528 | |||
529 | #if defined(CONFIG_SERIAL_BFIN_SPORT_CONSOLE) | ||
530 | #ifdef CONFIG_SERIAL_BFIN_SPORT0_UART | ||
531 | &bfin_sport0_uart_device, | ||
532 | #endif | ||
533 | #ifdef CONFIG_SERIAL_BFIN_SPORT1_UART | ||
534 | &bfin_sport1_uart_device, | ||
535 | #endif | ||
536 | #endif | ||
537 | }; | ||
538 | |||
539 | void __init native_machine_early_platform_add_devices(void) | ||
540 | { | ||
541 | printk(KERN_INFO "register early platform devices\n"); | ||
542 | early_platform_add_devices(minotaur_early_devices, | ||
543 | ARRAY_SIZE(minotaur_early_devices)); | ||
544 | } | ||
545 | |||
519 | void native_machine_restart(char *cmd) | 546 | void native_machine_restart(char *cmd) |
520 | { | 547 | { |
521 | /* workaround reboot hang when booting from SPI */ | 548 | /* workaround reboot hang when booting from SPI */ |
diff --git a/arch/blackfin/mach-bf537/boards/pnav10.c b/arch/blackfin/mach-bf537/boards/pnav10.c index 3c36abdf3405..f08533d4aee8 100644 --- a/arch/blackfin/mach-bf537/boards/pnav10.c +++ b/arch/blackfin/mach-bf537/boards/pnav10.c | |||
@@ -571,6 +571,24 @@ static int __init pnav_init(void) | |||
571 | 571 | ||
572 | arch_initcall(pnav_init); | 572 | arch_initcall(pnav_init); |
573 | 573 | ||
574 | static struct platform_device *stamp_early_devices[] __initdata = { | ||
575 | #if defined(CONFIG_SERIAL_BFIN_CONSOLE) || defined(CONFIG_EARLY_PRINTK) | ||
576 | #ifdef CONFIG_SERIAL_BFIN_UART0 | ||
577 | &bfin_uart0_device, | ||
578 | #endif | ||
579 | #ifdef CONFIG_SERIAL_BFIN_UART1 | ||
580 | &bfin_uart1_device, | ||
581 | #endif | ||
582 | #endif | ||
583 | }; | ||
584 | |||
585 | void __init native_machine_early_platform_add_devices(void) | ||
586 | { | ||
587 | printk(KERN_INFO "register early platform devices\n"); | ||
588 | early_platform_add_devices(stamp_early_devices, | ||
589 | ARRAY_SIZE(stamp_early_devices)); | ||
590 | } | ||
591 | |||
574 | void bfin_get_ether_addr(char *addr) | 592 | void bfin_get_ether_addr(char *addr) |
575 | { | 593 | { |
576 | random_ether_addr(addr); | 594 | random_ether_addr(addr); |
diff --git a/arch/blackfin/mach-bf537/boards/stamp.c b/arch/blackfin/mach-bf537/boards/stamp.c index df4b6b5c08d4..3cb20d7efbdb 100644 --- a/arch/blackfin/mach-bf537/boards/stamp.c +++ b/arch/blackfin/mach-bf537/boards/stamp.c | |||
@@ -1969,6 +1969,34 @@ static int __init stamp_init(void) | |||
1969 | 1969 | ||
1970 | arch_initcall(stamp_init); | 1970 | arch_initcall(stamp_init); |
1971 | 1971 | ||
1972 | |||
1973 | static struct platform_device *stamp_early_devices[] __initdata = { | ||
1974 | #if defined(CONFIG_SERIAL_BFIN_CONSOLE) || defined(CONFIG_EARLY_PRINTK) | ||
1975 | #ifdef CONFIG_SERIAL_BFIN_UART0 | ||
1976 | &bfin_uart0_device, | ||
1977 | #endif | ||
1978 | #ifdef CONFIG_SERIAL_BFIN_UART1 | ||
1979 | &bfin_uart1_device, | ||
1980 | #endif | ||
1981 | #endif | ||
1982 | |||
1983 | #if defined(CONFIG_SERIAL_BFIN_SPORT_CONSOLE) | ||
1984 | #ifdef CONFIG_SERIAL_BFIN_SPORT0_UART | ||
1985 | &bfin_sport0_uart_device, | ||
1986 | #endif | ||
1987 | #ifdef CONFIG_SERIAL_BFIN_SPORT1_UART | ||
1988 | &bfin_sport1_uart_device, | ||
1989 | #endif | ||
1990 | #endif | ||
1991 | }; | ||
1992 | |||
1993 | void __init native_machine_early_platform_add_devices(void) | ||
1994 | { | ||
1995 | printk(KERN_INFO "register early platform devices\n"); | ||
1996 | early_platform_add_devices(stamp_early_devices, | ||
1997 | ARRAY_SIZE(stamp_early_devices)); | ||
1998 | } | ||
1999 | |||
1972 | void native_machine_restart(char *cmd) | 2000 | void native_machine_restart(char *cmd) |
1973 | { | 2001 | { |
1974 | /* workaround reboot hang when booting from SPI */ | 2002 | /* workaround reboot hang when booting from SPI */ |
diff --git a/arch/blackfin/mach-bf537/boards/tcm_bf537.c b/arch/blackfin/mach-bf537/boards/tcm_bf537.c index 69a2fb804724..59951cdef588 100644 --- a/arch/blackfin/mach-bf537/boards/tcm_bf537.c +++ b/arch/blackfin/mach-bf537/boards/tcm_bf537.c | |||
@@ -727,6 +727,33 @@ static int __init tcm_bf537_init(void) | |||
727 | 727 | ||
728 | arch_initcall(tcm_bf537_init); | 728 | arch_initcall(tcm_bf537_init); |
729 | 729 | ||
730 | static struct platform_device *cm_bf537_early_devices[] __initdata = { | ||
731 | #if defined(CONFIG_SERIAL_BFIN_CONSOLE) || defined(CONFIG_EARLY_PRINTK) | ||
732 | #ifdef CONFIG_SERIAL_BFIN_UART0 | ||
733 | &bfin_uart0_device, | ||
734 | #endif | ||
735 | #ifdef CONFIG_SERIAL_BFIN_UART1 | ||
736 | &bfin_uart1_device, | ||
737 | #endif | ||
738 | #endif | ||
739 | |||
740 | #if defined(CONFIG_SERIAL_BFIN_SPORT_CONSOLE) | ||
741 | #ifdef CONFIG_SERIAL_BFIN_SPORT0_UART | ||
742 | &bfin_sport0_uart_device, | ||
743 | #endif | ||
744 | #ifdef CONFIG_SERIAL_BFIN_SPORT1_UART | ||
745 | &bfin_sport1_uart_device, | ||
746 | #endif | ||
747 | #endif | ||
748 | }; | ||
749 | |||
750 | void __init native_machine_early_platform_add_devices(void) | ||
751 | { | ||
752 | printk(KERN_INFO "register early platform devices\n"); | ||
753 | early_platform_add_devices(cm_bf537_early_devices, | ||
754 | ARRAY_SIZE(cm_bf537_early_devices)); | ||
755 | } | ||
756 | |||
730 | void bfin_get_ether_addr(char *addr) | 757 | void bfin_get_ether_addr(char *addr) |
731 | { | 758 | { |
732 | random_ether_addr(addr); | 759 | random_ether_addr(addr); |